162306a36Sopenharmony_ci// SPDX-License-Identifier: LGPL-2.1
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci *   Copyright (C) International Business Machines  Corp., 2007
562306a36Sopenharmony_ci *   Author(s): Steve French (sfrench@us.ibm.com)
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci *   Common Internet FileSystem (CIFS) client
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci *   Operations related to support for exporting files via NFSD
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci */
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci /*
1462306a36Sopenharmony_ci  * See Documentation/filesystems/nfs/exporting.rst
1562306a36Sopenharmony_ci  * and examples in fs/exportfs
1662306a36Sopenharmony_ci  *
1762306a36Sopenharmony_ci  * Since cifs is a network file system, an "fsid" must be included for
1862306a36Sopenharmony_ci  * any nfs exports file entries which refer to cifs paths.  In addition
1962306a36Sopenharmony_ci  * the cifs mount must be mounted with the "serverino" option (ie use stable
2062306a36Sopenharmony_ci  * server inode numbers instead of locally generated temporary ones).
2162306a36Sopenharmony_ci  * Although cifs inodes do not use generation numbers (have generation number
2262306a36Sopenharmony_ci  * of zero) - the inode number alone should be good enough for simple cases
2362306a36Sopenharmony_ci  * in which users want to export cifs shares with NFS. The decode and encode
2462306a36Sopenharmony_ci  * could be improved by using a new routine which expects 64 bit inode numbers
2562306a36Sopenharmony_ci  * instead of the default 32 bit routines in fs/exportfs
2662306a36Sopenharmony_ci  *
2762306a36Sopenharmony_ci  */
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci#include <linux/fs.h>
3062306a36Sopenharmony_ci#include <linux/exportfs.h>
3162306a36Sopenharmony_ci#include "cifsglob.h"
3262306a36Sopenharmony_ci#include "cifs_debug.h"
3362306a36Sopenharmony_ci#include "cifsfs.h"
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci#ifdef CONFIG_CIFS_NFSD_EXPORT
3662306a36Sopenharmony_cistatic struct dentry *cifs_get_parent(struct dentry *dentry)
3762306a36Sopenharmony_ci{
3862306a36Sopenharmony_ci	/* BB need to add code here eventually to enable export via NFSD */
3962306a36Sopenharmony_ci	cifs_dbg(FYI, "get parent for %p\n", dentry);
4062306a36Sopenharmony_ci	return ERR_PTR(-EACCES);
4162306a36Sopenharmony_ci}
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ciconst struct export_operations cifs_export_ops = {
4462306a36Sopenharmony_ci	.get_parent = cifs_get_parent,
4562306a36Sopenharmony_ci/*	Following five export operations are unneeded so far and can default:
4662306a36Sopenharmony_ci	.get_dentry =
4762306a36Sopenharmony_ci	.get_name =
4862306a36Sopenharmony_ci	.find_exported_dentry =
4962306a36Sopenharmony_ci	.decode_fh =
5062306a36Sopenharmony_ci	.encode_fs =  */
5162306a36Sopenharmony_ci};
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#endif /* CONFIG_CIFS_NFSD_EXPORT */
5462306a36Sopenharmony_ci
55