xref: /OK3568_Linux_fs/kernel/fs/cifs/export.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  *   fs/cifs/export.c
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  *   Copyright (C) International Business Machines  Corp., 2007
5*4882a593Smuzhiyun  *   Author(s): Steve French (sfrench@us.ibm.com)
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  *   Common Internet FileSystem (CIFS) client
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  *   Operations related to support for exporting files via NFSD
10*4882a593Smuzhiyun  *
11*4882a593Smuzhiyun  *   This library is free software; you can redistribute it and/or modify
12*4882a593Smuzhiyun  *   it under the terms of the GNU Lesser General Public License as published
13*4882a593Smuzhiyun  *   by the Free Software Foundation; either version 2.1 of the License, or
14*4882a593Smuzhiyun  *   (at your option) any later version.
15*4882a593Smuzhiyun  *
16*4882a593Smuzhiyun  *   This library is distributed in the hope that it will be useful,
17*4882a593Smuzhiyun  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
18*4882a593Smuzhiyun  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
19*4882a593Smuzhiyun  *   the GNU Lesser General Public License for more details.
20*4882a593Smuzhiyun  *
21*4882a593Smuzhiyun  *   You should have received a copy of the GNU Lesser General Public License
22*4882a593Smuzhiyun  *   along with this library; if not, write to the Free Software
23*4882a593Smuzhiyun  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24*4882a593Smuzhiyun  */
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun  /*
27*4882a593Smuzhiyun   * See Documentation/filesystems/nfs/exporting.rst
28*4882a593Smuzhiyun   * and examples in fs/exportfs
29*4882a593Smuzhiyun   *
30*4882a593Smuzhiyun   * Since cifs is a network file system, an "fsid" must be included for
31*4882a593Smuzhiyun   * any nfs exports file entries which refer to cifs paths.  In addition
32*4882a593Smuzhiyun   * the cifs mount must be mounted with the "serverino" option (ie use stable
33*4882a593Smuzhiyun   * server inode numbers instead of locally generated temporary ones).
34*4882a593Smuzhiyun   * Although cifs inodes do not use generation numbers (have generation number
35*4882a593Smuzhiyun   * of zero) - the inode number alone should be good enough for simple cases
36*4882a593Smuzhiyun   * in which users want to export cifs shares with NFS. The decode and encode
37*4882a593Smuzhiyun   * could be improved by using a new routine which expects 64 bit inode numbers
38*4882a593Smuzhiyun   * instead of the default 32 bit routines in fs/exportfs
39*4882a593Smuzhiyun   *
40*4882a593Smuzhiyun   */
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun #include <linux/fs.h>
43*4882a593Smuzhiyun #include <linux/exportfs.h>
44*4882a593Smuzhiyun #include "cifsglob.h"
45*4882a593Smuzhiyun #include "cifs_debug.h"
46*4882a593Smuzhiyun #include "cifsfs.h"
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #ifdef CONFIG_CIFS_NFSD_EXPORT
cifs_get_parent(struct dentry * dentry)49*4882a593Smuzhiyun static struct dentry *cifs_get_parent(struct dentry *dentry)
50*4882a593Smuzhiyun {
51*4882a593Smuzhiyun 	/* BB need to add code here eventually to enable export via NFSD */
52*4882a593Smuzhiyun 	cifs_dbg(FYI, "get parent for %p\n", dentry);
53*4882a593Smuzhiyun 	return ERR_PTR(-EACCES);
54*4882a593Smuzhiyun }
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun const struct export_operations cifs_export_ops = {
57*4882a593Smuzhiyun 	.get_parent = cifs_get_parent,
58*4882a593Smuzhiyun /*	Following five export operations are unneeded so far and can default:
59*4882a593Smuzhiyun 	.get_dentry =
60*4882a593Smuzhiyun 	.get_name =
61*4882a593Smuzhiyun 	.find_exported_dentry =
62*4882a593Smuzhiyun 	.decode_fh =
63*4882a593Smuzhiyun 	.encode_fs =  */
64*4882a593Smuzhiyun };
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun #endif /* CONFIG_CIFS_NFSD_EXPORT */
67*4882a593Smuzhiyun 
68