blob: 37c28415df1e0227d52956a173e12cd6d9f6b9e5 [file] [log] [blame]
Steve French929be902021-06-18 00:31:49 -05001// SPDX-License-Identifier: LGPL-2.1
Steve French1ae1bc42007-02-27 05:16:30 +00002/*
Steve French1ae1bc42007-02-27 05:16:30 +00003 *
4 * Copyright (C) International Business Machines Corp., 2007
5 * Author(s): Steve French (sfrench@us.ibm.com)
6 *
7 * Common Internet FileSystem (CIFS) client
Steve Frenchfb8c4b12007-07-10 01:16:18 +00008 *
Steve French1ae1bc42007-02-27 05:16:30 +00009 * Operations related to support for exporting files via NFSD
10 *
Steve French1ae1bc42007-02-27 05:16:30 +000011 */
Steve French50c2f752007-07-13 00:33:32 +000012
Steve Frenchfb8c4b12007-07-10 01:16:18 +000013 /*
Mauro Carvalho Chehabec23eb52019-07-26 09:51:27 -030014 * See Documentation/filesystems/nfs/exporting.rst
Steve French1ae1bc42007-02-27 05:16:30 +000015 * and examples in fs/exportfs
Steve French7521a3c2007-07-11 18:30:34 +000016 *
17 * Since cifs is a network file system, an "fsid" must be included for
18 * any nfs exports file entries which refer to cifs paths. In addition
19 * the cifs mount must be mounted with the "serverino" option (ie use stable
20 * server inode numbers instead of locally generated temporary ones).
21 * Although cifs inodes do not use generation numbers (have generation number
22 * of zero) - the inode number alone should be good enough for simple cases
23 * in which users want to export cifs shares with NFS. The decode and encode
24 * could be improved by using a new routine which expects 64 bit inode numbers
25 * instead of the default 32 bit routines in fs/exportfs
26 *
Steve French1ae1bc42007-02-27 05:16:30 +000027 */
28
29#include <linux/fs.h>
Steve French70b315b2007-07-19 00:32:25 +000030#include <linux/exportfs.h>
Steve French7521a3c2007-07-11 18:30:34 +000031#include "cifsglob.h"
32#include "cifs_debug.h"
Steve French297647c2007-10-12 04:11:59 +000033#include "cifsfs.h"
Steve French7521a3c2007-07-11 18:30:34 +000034
Paul Bollef3a6a602011-10-12 14:14:04 +020035#ifdef CONFIG_CIFS_NFSD_EXPORT
Steve French1ae1bc42007-02-27 05:16:30 +000036static struct dentry *cifs_get_parent(struct dentry *dentry)
37{
Steve Frenchfb8c4b12007-07-10 01:16:18 +000038 /* BB need to add code here eventually to enable export via NFSD */
Joe Perchesf96637b2013-05-04 22:12:25 -050039 cifs_dbg(FYI, "get parent for %p\n", dentry);
Steve Frenchfb8c4b12007-07-10 01:16:18 +000040 return ERR_PTR(-EACCES);
Steve French1ae1bc42007-02-27 05:16:30 +000041}
Steve French50c2f752007-07-13 00:33:32 +000042
Christoph Hellwig39655162007-10-21 16:42:17 -070043const struct export_operations cifs_export_ops = {
Steve Frenchfb8c4b12007-07-10 01:16:18 +000044 .get_parent = cifs_get_parent,
45/* Following five export operations are unneeded so far and can default:
46 .get_dentry =
47 .get_name =
48 .find_exported_dentry =
49 .decode_fh =
50 .encode_fs = */
51};
Steve French50c2f752007-07-13 00:33:32 +000052
Paul Bollef3a6a602011-10-12 14:14:04 +020053#endif /* CONFIG_CIFS_NFSD_EXPORT */
Steve French50c2f752007-07-13 00:33:32 +000054