diff options
author | Weston Andros Adamson <dros@netapp.com> | 2011-06-01 16:44:44 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-12 13:40:27 -0400 |
commit | 6382a44138e7aa40bf52170e7afc014443a24806 (patch) | |
tree | 9126d01d1fe2442fea057c3f45e4e3e532c85424 /fs/nfs/pnfs.c | |
parent | 35dbbc99e93e57680837c17f96efe370f0535064 (diff) |
NFS: move pnfs layouts to nfs_server structure
Layouts should be tracked per nfs_server (aka superblock)
instead of per struct nfs_client, which may have multiple FSIDs associated
with it.
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 29c0ca7fc347..ff8200772377 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -448,11 +448,17 @@ pnfs_destroy_layout(struct nfs_inode *nfsi) | |||
448 | void | 448 | void |
449 | pnfs_destroy_all_layouts(struct nfs_client *clp) | 449 | pnfs_destroy_all_layouts(struct nfs_client *clp) |
450 | { | 450 | { |
451 | struct nfs_server *server; | ||
451 | struct pnfs_layout_hdr *lo; | 452 | struct pnfs_layout_hdr *lo; |
452 | LIST_HEAD(tmp_list); | 453 | LIST_HEAD(tmp_list); |
453 | 454 | ||
454 | spin_lock(&clp->cl_lock); | 455 | spin_lock(&clp->cl_lock); |
455 | list_splice_init(&clp->cl_layouts, &tmp_list); | 456 | rcu_read_lock(); |
457 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { | ||
458 | if (!list_empty(&server->layouts)) | ||
459 | list_splice_init(&server->layouts, &tmp_list); | ||
460 | } | ||
461 | rcu_read_unlock(); | ||
456 | spin_unlock(&clp->cl_lock); | 462 | spin_unlock(&clp->cl_lock); |
457 | 463 | ||
458 | while (!list_empty(&tmp_list)) { | 464 | while (!list_empty(&tmp_list)) { |
@@ -920,7 +926,8 @@ pnfs_update_layout(struct inode *ino, | |||
920 | }; | 926 | }; |
921 | unsigned pg_offset; | 927 | unsigned pg_offset; |
922 | struct nfs_inode *nfsi = NFS_I(ino); | 928 | struct nfs_inode *nfsi = NFS_I(ino); |
923 | struct nfs_client *clp = NFS_SERVER(ino)->nfs_client; | 929 | struct nfs_server *server = NFS_SERVER(ino); |
930 | struct nfs_client *clp = server->nfs_client; | ||
924 | struct pnfs_layout_hdr *lo; | 931 | struct pnfs_layout_hdr *lo; |
925 | struct pnfs_layout_segment *lseg = NULL; | 932 | struct pnfs_layout_segment *lseg = NULL; |
926 | bool first = false; | 933 | bool first = false; |
@@ -964,7 +971,7 @@ pnfs_update_layout(struct inode *ino, | |||
964 | */ | 971 | */ |
965 | spin_lock(&clp->cl_lock); | 972 | spin_lock(&clp->cl_lock); |
966 | BUG_ON(!list_empty(&lo->plh_layouts)); | 973 | BUG_ON(!list_empty(&lo->plh_layouts)); |
967 | list_add_tail(&lo->plh_layouts, &clp->cl_layouts); | 974 | list_add_tail(&lo->plh_layouts, &server->layouts); |
968 | spin_unlock(&clp->cl_lock); | 975 | spin_unlock(&clp->cl_lock); |
969 | } | 976 | } |
970 | 977 | ||