[RFC 3/5] parse options at mount operation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch presents a proposed use of the just introduced interface.
The caller is expected to have passed a vfs_dcache_size=%d option. If this is
not true, nothing should be changed.

If such an option is present, however, two things can happen:
* A new dentry group (mob) is created, rooted at the given mount point. It has
  the size specified in the arguments.
* An existing dentry group (mob) is modified, such that the argument passed reflects
  the new maximum number of dentries.

Note that the existance of bind mounts allow us to specify dentry groups starting
at any arbitrary point in the hierarchy.

---
 fs/namespace.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 3ccd264..0d8a53b 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2275,6 +2275,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
 	struct path path;
 	int retval = 0;
 	int mnt_flags = 0;
+	int dcache_size = 0;
 
 	/* Discard magic */
 	if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
@@ -2298,6 +2299,10 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
 	if (retval)
 		goto dput_out;
 
+
+	dcache_size = path.mnt->dcache_size;
+	vfs_parse_options(data_page, path.mnt);
+
 	/* Default to relatime unless overriden */
 	if (!(flags & MS_NOATIME))
 		mnt_flags |= MNT_RELATIME;
@@ -2334,6 +2339,17 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
 	else
 		retval = do_new_mount(&path, type_page, flags, mnt_flags,
 				      dev_name, data_page);
+
+
+	if (retval || !path.mnt->dcache_size)
+		goto dput_out;
+
+	if (!dentry_is_mob_root(path.mnt->mnt_mountpoint))
+		dcache_new_mob(path.mnt->mnt_mountpoint);
+	if (dcache_size != path.mnt->dcache_size)
+		dcache_set_mob_size(path.mnt->mnt_mountpoint, path.mnt->dcache_size);
+
+
 dput_out:
 	path_put(&path);
 	return retval;
-- 
1.7.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux