Commit d891ea7b authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] - kNFSd in 2.5.15 - Require export operations for exporting a filesystem

This removes the old alternates to export_operations for exporting a
filesystem.

It removes fh_to_dentry, dentry_to_fh, and s_nfsd_free_path_sem.  It
also removes a lot of code.

The fs/ntfs change is because it was setting fh_to_dentry and
dentry_to_fh (which no longer exist) to NULL.
parent b64b7f8e
......@@ -146,3 +146,9 @@ support for this helper, particularly get_parent.
It is planned that this will be required for exporting once the code
settles down a bit.
[mandatory]
s_export_op is now required for exporting a filesystem.
isofs, ext2, ext3, resierfs, fat
can be used as examples of very different filesystems.
......@@ -313,15 +313,12 @@ exp_export(struct nfsctl_export *nxp)
* either a device number (so FS_REQUIRES_DEV needed)
* or an FSID number (so NFSEXP_FSID needed).
* 2: We must be able to find an inode from a filehandle.
* either using fh_to_dentry (prefered)
* or using read_inode (the hack).
* This means that s_export_op must be set.
*/
if (((inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV)
|| (nxp->ex_flags & NFSEXP_FSID))
&&
(inode->i_sb->s_op->read_inode
|| inode->i_sb->s_export_op
|| inode->i_sb->s_op->fh_to_dentry))
inode->i_sb->s_export_op)
/* Ok, we can export it */;
else {
dprintk("exp_export: export of invalid fs type.\n");
......
This diff is collapsed.
......@@ -1441,14 +1441,7 @@ struct super_operations ntfs_sops = {
clear_inode: ntfs_clear_big_inode, /* VFS: Called when an inode is
removed from memory. */
umount_begin: NULL, /* Forced umount. */
/*
* These are NFSd support functions but NTFS is a standard fs so
* shouldn't need to implement these manually. At least we can try
* without and if it doesn't work in some way we can always implement
* something here.
*/
fh_to_dentry: NULL, /* Get dentry for given file handle. */
dentry_to_fh: NULL, /* Get file handle for given dentry. */
show_options: ntfs_show_options, /* Show mount options in proc. */
};
......
......@@ -58,7 +58,6 @@ static struct super_block *alloc_super(void)
s->s_count = S_BIAS;
atomic_set(&s->s_active, 1);
sema_init(&s->s_vfs_rename_sem,1);
sema_init(&s->s_nfsd_free_path_sem,1);
sema_init(&s->s_dquot.dqio_sem, 1);
sema_init(&s->s_dquot.dqoff_sem, 1);
s->s_maxbytes = MAX_NON_LFS;
......
......@@ -660,15 +660,6 @@ struct super_block {
* even looking at it. You had been warned.
*/
struct semaphore s_vfs_rename_sem; /* Kludge */
/* The next field is used by knfsd when converting a (inode number based)
* file handle into a dentry. As it builds a path in the dcache tree from
* the bottom up, there may for a time be a subpath of dentrys which is not
* connected to the main tree. This semaphore ensure that there is only ever
* one such free path per filesystem. Note that unconnected files (or other
* non-directories) are allowed, but not unconnected diretories.
*/
struct semaphore s_nfsd_free_path_sem;
};
/*
......@@ -798,30 +789,6 @@ struct super_operations {
void (*clear_inode) (struct inode *);
void (*umount_begin) (struct super_block *);
/* Following are for knfsd to interact with "interesting" filesystems
* Currently just reiserfs, but possibly FAT and others later
*
* fh_to_dentry is given a filehandle fragement with length, and a type flag
* and must return a dentry for the referenced object or, if "parent" is
* set, a dentry for the parent of the object.
* If a dentry cannot be found, a "root" dentry should be created and
* flaged as DCACHE_DISCONNECTED. nfsd_iget is an example implementation.
*
* dentry_to_fh is given a dentry and must generate the filesys specific
* part of the file handle. Available length is passed in *lenp and used
* length should be returned therein.
* If need_parent is set, then dentry_to_fh should encode sufficient information
* to find the (current) parent.
* dentry_to_fh should return a 1byte "type" which will be passed back in
* the fhtype arguement to fh_to_dentry. Type of 0 is reserved.
* If filesystem was exportable before the introduction of fh_to_dentry,
* types 1 and 2 should be used is that same way as the generic code.
* Type 255 means error.
*
* Lengths are in units of 4bytes, not bytes.
*/
struct dentry * (*fh_to_dentry)(struct super_block *sb, __u32 *fh, int len, int fhtype, int parent);
int (*dentry_to_fh)(struct dentry *, __u32 *fh, int *lenp, int need_parent);
int (*show_options)(struct seq_file *, struct vfsmount *);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment