18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci *   fs/cifs/export.c
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *   Copyright (C) International Business Machines  Corp., 2007
58c2ecf20Sopenharmony_ci *   Author(s): Steve French (sfrench@us.ibm.com)
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci *   Common Internet FileSystem (CIFS) client
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci *   Operations related to support for exporting files via NFSD
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci *   This library is free software; you can redistribute it and/or modify
128c2ecf20Sopenharmony_ci *   it under the terms of the GNU Lesser General Public License as published
138c2ecf20Sopenharmony_ci *   by the Free Software Foundation; either version 2.1 of the License, or
148c2ecf20Sopenharmony_ci *   (at your option) any later version.
158c2ecf20Sopenharmony_ci *
168c2ecf20Sopenharmony_ci *   This library is distributed in the hope that it will be useful,
178c2ecf20Sopenharmony_ci *   but WITHOUT ANY WARRANTY; without even the implied warranty of
188c2ecf20Sopenharmony_ci *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
198c2ecf20Sopenharmony_ci *   the GNU Lesser General Public License for more details.
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci *   You should have received a copy of the GNU Lesser General Public License
228c2ecf20Sopenharmony_ci *   along with this library; if not, write to the Free Software
238c2ecf20Sopenharmony_ci *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
248c2ecf20Sopenharmony_ci */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci /*
278c2ecf20Sopenharmony_ci  * See Documentation/filesystems/nfs/exporting.rst
288c2ecf20Sopenharmony_ci  * and examples in fs/exportfs
298c2ecf20Sopenharmony_ci  *
308c2ecf20Sopenharmony_ci  * Since cifs is a network file system, an "fsid" must be included for
318c2ecf20Sopenharmony_ci  * any nfs exports file entries which refer to cifs paths.  In addition
328c2ecf20Sopenharmony_ci  * the cifs mount must be mounted with the "serverino" option (ie use stable
338c2ecf20Sopenharmony_ci  * server inode numbers instead of locally generated temporary ones).
348c2ecf20Sopenharmony_ci  * Although cifs inodes do not use generation numbers (have generation number
358c2ecf20Sopenharmony_ci  * of zero) - the inode number alone should be good enough for simple cases
368c2ecf20Sopenharmony_ci  * in which users want to export cifs shares with NFS. The decode and encode
378c2ecf20Sopenharmony_ci  * could be improved by using a new routine which expects 64 bit inode numbers
388c2ecf20Sopenharmony_ci  * instead of the default 32 bit routines in fs/exportfs
398c2ecf20Sopenharmony_ci  *
408c2ecf20Sopenharmony_ci  */
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#include <linux/fs.h>
438c2ecf20Sopenharmony_ci#include <linux/exportfs.h>
448c2ecf20Sopenharmony_ci#include "cifsglob.h"
458c2ecf20Sopenharmony_ci#include "cifs_debug.h"
468c2ecf20Sopenharmony_ci#include "cifsfs.h"
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#ifdef CONFIG_CIFS_NFSD_EXPORT
498c2ecf20Sopenharmony_cistatic struct dentry *cifs_get_parent(struct dentry *dentry)
508c2ecf20Sopenharmony_ci{
518c2ecf20Sopenharmony_ci	/* BB need to add code here eventually to enable export via NFSD */
528c2ecf20Sopenharmony_ci	cifs_dbg(FYI, "get parent for %p\n", dentry);
538c2ecf20Sopenharmony_ci	return ERR_PTR(-EACCES);
548c2ecf20Sopenharmony_ci}
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ciconst struct export_operations cifs_export_ops = {
578c2ecf20Sopenharmony_ci	.get_parent = cifs_get_parent,
588c2ecf20Sopenharmony_ci/*	Following five export operations are unneeded so far and can default:
598c2ecf20Sopenharmony_ci	.get_dentry =
608c2ecf20Sopenharmony_ci	.get_name =
618c2ecf20Sopenharmony_ci	.find_exported_dentry =
628c2ecf20Sopenharmony_ci	.decode_fh =
638c2ecf20Sopenharmony_ci	.encode_fs =  */
648c2ecf20Sopenharmony_ci};
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci#endif /* CONFIG_CIFS_NFSD_EXPORT */
678c2ecf20Sopenharmony_ci
68