blob: 747a540db9544d87dea397f26b606295a0c7e0f1 [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/*
3 * fs/cifs/export.c
4 *
5 * Copyright (C) International Business Machines Corp., 2007
6 * Author(s): Steve French (sfrench@us.ibm.com)
7 *
8 * Common Internet FileSystem (CIFS) client
Steve Frenchfb8c4b12007-07-10 01:16:18 +00009 *
Steve French1ae1bc42007-02-27 05:16:30 +000010 * Operations related to support for exporting files via NFSD
11 *
Steve French1ae1bc42007-02-27 05:16:30 +000012 */
Steve French50c2f752007-07-13 00:33:32 +000013
Steve Frenchfb8c4b12007-07-10 01:16:18 +000014 /*
Mauro Carvalho Chehabec23eb52019-07-26 09:51:27 -030015 * See Documentation/filesystems/nfs/exporting.rst
Steve French1ae1bc42007-02-27 05:16:30 +000016 * and examples in fs/exportfs
Steve French7521a3c2007-07-11 18:30:34 +000017 *
18 * Since cifs is a network file system, an "fsid" must be included for
19 * any nfs exports file entries which refer to cifs paths. In addition
20 * the cifs mount must be mounted with the "serverino" option (ie use stable
21 * server inode numbers instead of locally generated temporary ones).
22 * Although cifs inodes do not use generation numbers (have generation number
23 * of zero) - the inode number alone should be good enough for simple cases
24 * in which users want to export cifs shares with NFS. The decode and encode
25 * could be improved by using a new routine which expects 64 bit inode numbers
26 * instead of the default 32 bit routines in fs/exportfs
27 *
Steve French1ae1bc42007-02-27 05:16:30 +000028 */
29
30#include <linux/fs.h>
Steve French70b315b2007-07-19 00:32:25 +000031#include <linux/exportfs.h>
Steve French7521a3c2007-07-11 18:30:34 +000032#include "cifsglob.h"
33#include "cifs_debug.h"
Steve French297647c2007-10-12 04:11:59 +000034#include "cifsfs.h"
Steve French7521a3c2007-07-11 18:30:34 +000035
Paul Bollef3a6a602011-10-12 14:14:04 +020036#ifdef CONFIG_CIFS_NFSD_EXPORT
Steve French1ae1bc42007-02-27 05:16:30 +000037static struct dentry *cifs_get_parent(struct dentry *dentry)
38{
Steve Frenchfb8c4b12007-07-10 01:16:18 +000039 /* BB need to add code here eventually to enable export via NFSD */
Joe Perchesf96637b2013-05-04 22:12:25 -050040 cifs_dbg(FYI, "get parent for %p\n", dentry);
Steve Frenchfb8c4b12007-07-10 01:16:18 +000041 return ERR_PTR(-EACCES);
Steve French1ae1bc42007-02-27 05:16:30 +000042}
Steve French50c2f752007-07-13 00:33:32 +000043
Christoph Hellwig39655162007-10-21 16:42:17 -070044const struct export_operations cifs_export_ops = {
Steve Frenchfb8c4b12007-07-10 01:16:18 +000045 .get_parent = cifs_get_parent,
46/* Following five export operations are unneeded so far and can default:
47 .get_dentry =
48 .get_name =
49 .find_exported_dentry =
50 .decode_fh =
51 .encode_fs = */
52};
Steve French50c2f752007-07-13 00:33:32 +000053
Paul Bollef3a6a602011-10-12 14:14:04 +020054#endif /* CONFIG_CIFS_NFSD_EXPORT */
Steve French50c2f752007-07-13 00:33:32 +000055