aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-04-03 11:42:42 -0400
committerDavid Howells <dhowells@redhat.com>2009-04-03 11:42:42 -0400
commit08734048b380103f0412f58b84c2f76a2c8b599f (patch)
tree34a65d40e33b12d36f5c82adb686bcdae6eab0fe /fs/nfs/super.c
parent147272813e043fb44bd112527951da70c1e663de (diff)
NFS: Define and create superblock-level objects
Define and create superblock-level cache index objects (as managed by nfs_server structs). Each superblock object is created in a server level index object and is itself an index into which inode-level objects are inserted. Ideally there would be one superblock-level object per server, and the former would be folded into the latter; however, since the "nosharecache" option exists this isn't possible. The superblock object key is a sequence consisting of: (1) Certain superblock s_flags. (2) Various connection parameters that serve to distinguish superblocks for sget(). (3) The volume FSID. (4) The security flavour. (5) The uniquifier length. (6) The uniquifier text. This is normally an empty string, unless the fsc=xyz mount option was used to explicitly specify a uniquifier. The key blob is of variable length, depending on the length of (6). The superblock object is given no coherency data to carry in the auxiliary data permitted by the cache. It is assumed that the superblock is always coherent. This patch also adds uniquification handling such that two otherwise identical superblocks, at least one of which is marked "nosharecache", won't end up trying to share the on-disk cache. It will be possible to manually provide a uniquifier through a mount option with a later patch to avoid the error otherwise produced. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 0942fcbbad3c..87f65ae07f32 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -60,6 +60,7 @@
60#include "delegation.h" 60#include "delegation.h"
61#include "iostat.h" 61#include "iostat.h"
62#include "internal.h" 62#include "internal.h"
63#include "fscache.h"
63 64
64#define NFSDBG_FACILITY NFSDBG_VFS 65#define NFSDBG_FACILITY NFSDBG_VFS
65 66
@@ -1870,8 +1871,6 @@ static void nfs_clone_super(struct super_block *sb,
1870 nfs_initialise_sb(sb); 1871 nfs_initialise_sb(sb);
1871} 1872}
1872 1873
1873#define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS)
1874
1875static int nfs_compare_mount_options(const struct super_block *s, const struct nfs_server *b, int flags) 1874static int nfs_compare_mount_options(const struct super_block *s, const struct nfs_server *b, int flags)
1876{ 1875{
1877 const struct nfs_server *a = s->s_fs_info; 1876 const struct nfs_server *a = s->s_fs_info;
@@ -2036,6 +2035,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,
2036 if (!s->s_root) { 2035 if (!s->s_root) {
2037 /* initial superblock/root creation */ 2036 /* initial superblock/root creation */
2038 nfs_fill_super(s, data); 2037 nfs_fill_super(s, data);
2038 nfs_fscache_get_super_cookie(s, data);
2039 } 2039 }
2040 2040
2041 mntroot = nfs_get_root(s, mntfh); 2041 mntroot = nfs_get_root(s, mntfh);
@@ -2056,6 +2056,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,
2056out: 2056out:
2057 kfree(data->nfs_server.hostname); 2057 kfree(data->nfs_server.hostname);
2058 kfree(data->mount_server.hostname); 2058 kfree(data->mount_server.hostname);
2059 kfree(data->fscache_uniq);
2059 security_free_mnt_opts(&data->lsm_opts); 2060 security_free_mnt_opts(&data->lsm_opts);
2060out_free_fh: 2061out_free_fh:
2061 kfree(mntfh); 2062 kfree(mntfh);
@@ -2083,6 +2084,7 @@ static void nfs_kill_super(struct super_block *s)
2083 2084
2084 bdi_unregister(&server->backing_dev_info); 2085 bdi_unregister(&server->backing_dev_info);
2085 kill_anon_super(s); 2086 kill_anon_super(s);
2087 nfs_fscache_release_super_cookie(s);
2086 nfs_free_server(server); 2088 nfs_free_server(server);
2087} 2089}
2088 2090
@@ -2390,6 +2392,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
2390 if (!s->s_root) { 2392 if (!s->s_root) {
2391 /* initial superblock/root creation */ 2393 /* initial superblock/root creation */
2392 nfs4_fill_super(s); 2394 nfs4_fill_super(s);
2395 nfs_fscache_get_super_cookie(s, data);
2393 } 2396 }
2394 2397
2395 mntroot = nfs4_get_root(s, mntfh); 2398 mntroot = nfs4_get_root(s, mntfh);
@@ -2411,6 +2414,7 @@ out:
2411 kfree(data->client_address); 2414 kfree(data->client_address);
2412 kfree(data->nfs_server.export_path); 2415 kfree(data->nfs_server.export_path);
2413 kfree(data->nfs_server.hostname); 2416 kfree(data->nfs_server.hostname);
2417 kfree(data->fscache_uniq);
2414 security_free_mnt_opts(&data->lsm_opts); 2418 security_free_mnt_opts(&data->lsm_opts);
2415out_free_fh: 2419out_free_fh:
2416 kfree(mntfh); 2420 kfree(mntfh);
@@ -2437,6 +2441,7 @@ static void nfs4_kill_super(struct super_block *sb)
2437 kill_anon_super(sb); 2441 kill_anon_super(sb);
2438 2442
2439 nfs4_renewd_prepare_shutdown(server); 2443 nfs4_renewd_prepare_shutdown(server);
2444 nfs_fscache_release_super_cookie(sb);
2440 nfs_free_server(server); 2445 nfs_free_server(server);
2441} 2446}
2442 2447