From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, nfsv4@linux-nfs.org,
nfs@lists.sourceforge.net
Subject: Re: RFC [PATCH 1/6] VFS: Add GPL_EXPORTED function vfs_kern_mount()
Date: Mon, 17 Apr 2006 19:39:32 -0400 [thread overview]
Message-ID: <1145317172.8163.4.camel@lade.trondhjem.org> (raw)
In-Reply-To: <1145306673.10827.36.camel@lade.trondhjem.org>
[-- Attachment #1: Type: text/plain, Size: 627 bytes --]
On Mon, 2006-04-17 at 16:44 -0400, Trond Myklebust wrote:
> Hmm... Unfortunately, there appears to be a couple of cases in the VFS
> where we actually prefer to use do_kern_mount. I'm thinking in
> particular of the cases of fs/nfsctl.c (where we don't want to introduce
> a dependency of the VFS on the nfsd module), and of the case of "rootfs"
> mounting (where a couple of the arm architectures appear to have quirky
> private structures).
>
> We can eliminate all but 3 callers, though through something like the
> attached (untested!) patch.
...and here is the version that actually compiles and runs.
Cheers,
Trond
[-- Attachment #2: linux-2.6.17-019-unexport_do_kern_mount.dif --]
[-- Type: text/plain, Size: 8100 bytes --]
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
VFS: Unexport do_kern_mount() and clean up simple_pin_fs()
Replace all module uses with the new vfs_kern_mount() interface, and fix up
simple_pin_fs().
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
Documentation/filesystems/automount-support.txt | 2 +-
drivers/usb/core/inode.c | 2 +-
fs/afs/mntpt.c | 2 +-
fs/afs/super.c | 2 +-
fs/afs/super.h | 2 ++
fs/binfmt_misc.c | 3 ++-
fs/configfs/mount.c | 2 +-
fs/debugfs/inode.c | 2 +-
fs/libfs.c | 4 ++--
fs/super.c | 4 +---
include/linux/fs.h | 2 +-
mm/shmem.c | 2 +-
net/sunrpc/rpc_pipe.c | 2 +-
security/inode.c | 2 +-
14 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/Documentation/filesystems/automount-support.txt b/Documentation/filesystems/automount-support.txt
index 58c65a1..7cac200 100644
--- a/Documentation/filesystems/automount-support.txt
+++ b/Documentation/filesystems/automount-support.txt
@@ -19,7 +19,7 @@ following procedure:
(2) Have the follow_link() op do the following steps:
- (a) Call do_kern_mount() to call the appropriate filesystem to set up a
+ (a) Call vfs_kern_mount() to call the appropriate filesystem to set up a
superblock and gain a vfsmount structure representing it.
(b) Copy the nameidata provided as an argument and substitute the dentry
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 3cf945c..695b90a 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -569,7 +569,7 @@ static int create_special_files (void)
ignore_mount = 1;
/* create the devices special file */
- retval = simple_pin_fs("usbfs", &usbfs_mount, &usbfs_mount_count);
+ retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count);
if (retval) {
err ("Unable to get usbfs mount");
goto exit;
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c
index 4e6eeb5..7b6dc03 100644
--- a/fs/afs/mntpt.c
+++ b/fs/afs/mntpt.c
@@ -210,7 +210,7 @@ static struct vfsmount *afs_mntpt_do_aut
/* try and do the mount */
kdebug("--- attempting mount %s -o %s ---", devname, options);
- mnt = do_kern_mount("afs", 0, devname, options);
+ mnt = vfs_kern_mount(&afs_fs_type, 0, devname, options);
kdebug("--- mount result %p ---", mnt);
free_page((unsigned long) devname);
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 53c56e7..93a7821 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -48,7 +48,7 @@ static void afs_put_super(struct super_b
static void afs_destroy_inode(struct inode *inode);
-static struct file_system_type afs_fs_type = {
+struct file_system_type afs_fs_type = {
.owner = THIS_MODULE,
.name = "afs",
.get_sb = afs_get_sb,
diff --git a/fs/afs/super.h b/fs/afs/super.h
index ac11362..32de8cc 100644
--- a/fs/afs/super.h
+++ b/fs/afs/super.h
@@ -38,6 +38,8 @@ static inline struct afs_super_info *AFS
return sb->s_fs_info;
}
+extern struct file_system_type afs_fs_type;
+
#endif /* __KERNEL__ */
#endif /* _LINUX_AFS_SUPER_H */
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index d73d755..c0a909e 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -55,6 +55,7 @@ typedef struct {
} Node;
static DEFINE_RWLOCK(entries_lock);
+static struct file_system_type bm_fs_type;
static struct vfsmount *bm_mnt;
static int entry_count;
@@ -638,7 +639,7 @@ static ssize_t bm_register_write(struct
if (!inode)
goto out2;
- err = simple_pin_fs("binfmt_misc", &bm_mnt, &entry_count);
+ err = simple_pin_fs(&bm_fs_type, &bm_mnt, &entry_count);
if (err) {
iput(inode);
inode = NULL;
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index f920d30..be5d86a 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -118,7 +118,7 @@ static struct file_system_type configfs_
int configfs_pin_fs(void)
{
- return simple_pin_fs("configfs", &configfs_mount,
+ return simple_pin_fs(&configfs_fs_type, &configfs_mount,
&configfs_mnt_count);
}
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 85d166c..579e1b6 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -198,7 +198,7 @@ struct dentry *debugfs_create_file(const
pr_debug("debugfs: creating file '%s'\n",name);
- error = simple_pin_fs("debugfs", &debugfs_mount, &debugfs_mount_count);
+ error = simple_pin_fs(&debug_fs_type, &debugfs_mount, &debugfs_mount_count);
if (error)
goto exit;
diff --git a/fs/libfs.c b/fs/libfs.c
index 7145ba7..4a3ec9a 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -424,13 +424,13 @@ out:
static DEFINE_SPINLOCK(pin_fs_lock);
-int simple_pin_fs(char *name, struct vfsmount **mount, int *count)
+int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *count)
{
struct vfsmount *mnt = NULL;
spin_lock(&pin_fs_lock);
if (unlikely(!*mount)) {
spin_unlock(&pin_fs_lock);
- mnt = do_kern_mount(name, 0, name, NULL);
+ mnt = vfs_kern_mount(type, 0, type->name, NULL);
if (IS_ERR(mnt))
return PTR_ERR(mnt);
spin_lock(&pin_fs_lock);
diff --git a/fs/super.c b/fs/super.c
index 848be4f..15f2afd 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -864,11 +864,9 @@ do_kern_mount(const char *fstype, int fl
return mnt;
}
-EXPORT_SYMBOL_GPL(do_kern_mount);
-
struct vfsmount *kern_mount(struct file_system_type *type)
{
- return do_kern_mount(type->name, 0, type->name, NULL);
+ return vfs_kern_mount(type, 0, type->name, NULL);
}
EXPORT_SYMBOL(kern_mount);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3de2bfb..0d1d2b4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1762,7 +1762,7 @@ extern struct inode_operations simple_di
struct tree_descr { char *name; const struct file_operations *ops; int mode; };
struct dentry *d_alloc_name(struct dentry *, const char *);
extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
-extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);
+extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
extern void simple_release_fs(struct vfsmount **mount, int *count);
extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
diff --git a/mm/shmem.c b/mm/shmem.c
index 37eaf42..180deb4 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2258,7 +2258,7 @@ static int __init init_tmpfs(void)
#ifdef CONFIG_TMPFS
devfs_mk_dir("shm");
#endif
- shm_mnt = do_kern_mount(tmpfs_fs_type.name, MS_NOUSER,
+ shm_mnt = vfs_kern_mount(&tmpfs_fs_type, MS_NOUSER,
tmpfs_fs_type.name, NULL);
if (IS_ERR(shm_mnt)) {
error = PTR_ERR(shm_mnt);
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index cc673dd..a5226df 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -439,7 +439,7 @@ struct vfsmount *rpc_get_mount(void)
{
int err;
- err = simple_pin_fs("rpc_pipefs", &rpc_mount, &rpc_mount_count);
+ err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mount, &rpc_mount_count);
if (err != 0)
return ERR_PTR(err);
return rpc_mount;
diff --git a/security/inode.c b/security/inode.c
index 0f77b02..8bf4062 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -224,7 +224,7 @@ struct dentry *securityfs_create_file(co
pr_debug("securityfs: creating file '%s'\n",name);
- error = simple_pin_fs("securityfs", &mount, &mount_count);
+ error = simple_pin_fs(&fs_type, &mount, &mount_count);
if (error) {
dentry = ERR_PTR(error);
goto exit;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
NFSv4 mailing list
NFSv4@linux-nfs.org
http://linux-nfs.org/cgi-bin/mailman/listinfo/nfsv4
next prev parent reply other threads:[~2006-04-17 23:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-11 17:45 RFC [PATCH 0/6] Client support for crossing NFS server mountpoints Trond Myklebust
2006-04-11 18:05 ` RFC [PATCH 1/6] VFS: Add GPL_EXPORTED function vfs_kern_mount() Trond Myklebust
2006-04-17 18:52 ` Christoph Hellwig
2006-04-17 19:35 ` Trond Myklebust
2006-04-17 19:39 ` Christoph Hellwig
2006-04-17 20:44 ` Trond Myklebust
2006-04-17 23:39 ` Trond Myklebust [this message]
2006-04-11 18:05 ` RFC [PATCH 2/6] VFS: Add shrink_submounts() Trond Myklebust
2006-04-11 18:05 ` RFC [PATCH 3/6] VFS: Remove dependency of ->umount_begin() call on MNT_FORCE Trond Myklebust
2006-04-11 18:05 ` RFC [PATCH 4/6] NFS: Store the file system "fsid" value in the NFS super block Trond Myklebust
2006-04-11 18:05 ` RFC [PATCH 5/6] NFS: Ensure the client submounts, when it crosses a server mountpoint Trond Myklebust
2006-04-11 18:05 ` RFC [PATCH 6/6] NFS: Add timeout to submounts Trond Myklebust
2007-05-24 1:16 ` possible bug/oops in nfs_pageio_add_request (2.6.22-rc2)? Erez Zadok
2007-05-24 12:51 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1145317172.8163.4.camel@lade.trondhjem.org \
--to=trond.myklebust@netapp.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=nfs@lists.sourceforge.net \
--cc=nfsv4@linux-nfs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).