Steve French | 929be90 | 2021-06-18 00:31:49 -0500 | [diff] [blame] | 1 | // SPDX-License-Identifier: LGPL-2.1 |
Steve French | 1ae1bc4 | 2007-02-27 05:16:30 +0000 | [diff] [blame] | 2 | /* |
| 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 French | fb8c4b1 | 2007-07-10 01:16:18 +0000 | [diff] [blame] | 9 | * |
Steve French | 1ae1bc4 | 2007-02-27 05:16:30 +0000 | [diff] [blame] | 10 | * Operations related to support for exporting files via NFSD |
| 11 | * |
Steve French | 1ae1bc4 | 2007-02-27 05:16:30 +0000 | [diff] [blame] | 12 | */ |
Steve French | 50c2f75 | 2007-07-13 00:33:32 +0000 | [diff] [blame] | 13 | |
Steve French | fb8c4b1 | 2007-07-10 01:16:18 +0000 | [diff] [blame] | 14 | /* |
Mauro Carvalho Chehab | ec23eb5 | 2019-07-26 09:51:27 -0300 | [diff] [blame] | 15 | * See Documentation/filesystems/nfs/exporting.rst |
Steve French | 1ae1bc4 | 2007-02-27 05:16:30 +0000 | [diff] [blame] | 16 | * and examples in fs/exportfs |
Steve French | 7521a3c | 2007-07-11 18:30:34 +0000 | [diff] [blame] | 17 | * |
| 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 French | 1ae1bc4 | 2007-02-27 05:16:30 +0000 | [diff] [blame] | 28 | */ |
| 29 | |
| 30 | #include <linux/fs.h> |
Steve French | 70b315b | 2007-07-19 00:32:25 +0000 | [diff] [blame] | 31 | #include <linux/exportfs.h> |
Steve French | 7521a3c | 2007-07-11 18:30:34 +0000 | [diff] [blame] | 32 | #include "cifsglob.h" |
| 33 | #include "cifs_debug.h" |
Steve French | 297647c | 2007-10-12 04:11:59 +0000 | [diff] [blame] | 34 | #include "cifsfs.h" |
Steve French | 7521a3c | 2007-07-11 18:30:34 +0000 | [diff] [blame] | 35 | |
Paul Bolle | f3a6a60 | 2011-10-12 14:14:04 +0200 | [diff] [blame] | 36 | #ifdef CONFIG_CIFS_NFSD_EXPORT |
Steve French | 1ae1bc4 | 2007-02-27 05:16:30 +0000 | [diff] [blame] | 37 | static struct dentry *cifs_get_parent(struct dentry *dentry) |
| 38 | { |
Steve French | fb8c4b1 | 2007-07-10 01:16:18 +0000 | [diff] [blame] | 39 | /* BB need to add code here eventually to enable export via NFSD */ |
Joe Perches | f96637b | 2013-05-04 22:12:25 -0500 | [diff] [blame] | 40 | cifs_dbg(FYI, "get parent for %p\n", dentry); |
Steve French | fb8c4b1 | 2007-07-10 01:16:18 +0000 | [diff] [blame] | 41 | return ERR_PTR(-EACCES); |
Steve French | 1ae1bc4 | 2007-02-27 05:16:30 +0000 | [diff] [blame] | 42 | } |
Steve French | 50c2f75 | 2007-07-13 00:33:32 +0000 | [diff] [blame] | 43 | |
Christoph Hellwig | 3965516 | 2007-10-21 16:42:17 -0700 | [diff] [blame] | 44 | const struct export_operations cifs_export_ops = { |
Steve French | fb8c4b1 | 2007-07-10 01:16:18 +0000 | [diff] [blame] | 45 | .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 French | 50c2f75 | 2007-07-13 00:33:32 +0000 | [diff] [blame] | 53 | |
Paul Bolle | f3a6a60 | 2011-10-12 14:14:04 +0200 | [diff] [blame] | 54 | #endif /* CONFIG_CIFS_NFSD_EXPORT */ |
Steve French | 50c2f75 | 2007-07-13 00:33:32 +0000 | [diff] [blame] | 55 | |