aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.h
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-20 14:47:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:36 -0400
commit799ba8d53d32c84bd2a867ca2689538a48176140 (patch)
treee17ad842898a2c9b63183f7a435c984191336859 /fs/nfs/nfs4filelayout.h
parent1acbbb4e16209e85c35ff6cacad61d802c07289b (diff)
NFS4.1: Add lseg to struct nfs4_fl_commit_bucket
Also create a commit_info structure to hold the bucket array and push it up from the lseg to the layout where it really belongs. While we are at it, fix a refcounting bug due to an (incorrect) implicit assumption that filelayout_scan_ds_commit_list always completely emptied the src list. This clarifies refcounting, removes the ugly find_only_write_lseg functions, and pushes the file layout commit code along on the path to supporting multiple lsegs. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.h')
-rw-r--r--fs/nfs/nfs4filelayout.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/fs/nfs/nfs4filelayout.h b/fs/nfs/nfs4filelayout.h
index 21190bb1f5e3..333a3ac97606 100644
--- a/fs/nfs/nfs4filelayout.h
+++ b/fs/nfs/nfs4filelayout.h
@@ -77,6 +77,13 @@ struct nfs4_file_layout_dsaddr {
77struct nfs4_fl_commit_bucket { 77struct nfs4_fl_commit_bucket {
78 struct list_head written; 78 struct list_head written;
79 struct list_head committing; 79 struct list_head committing;
80 struct pnfs_layout_segment *wlseg;
81 struct pnfs_layout_segment *clseg;
82};
83
84struct nfs4_fl_commit_info {
85 int nbuckets;
86 struct nfs4_fl_commit_bucket *buckets;
80}; 87};
81 88
82struct nfs4_filelayout_segment { 89struct nfs4_filelayout_segment {
@@ -89,10 +96,19 @@ struct nfs4_filelayout_segment {
89 struct nfs4_file_layout_dsaddr *dsaddr; /* Point to GETDEVINFO data */ 96 struct nfs4_file_layout_dsaddr *dsaddr; /* Point to GETDEVINFO data */
90 unsigned int num_fh; 97 unsigned int num_fh;
91 struct nfs_fh **fh_array; 98 struct nfs_fh **fh_array;
92 struct nfs4_fl_commit_bucket *commit_buckets; /* Sort commits to ds */
93 int number_of_buckets;
94}; 99};
95 100
101struct nfs4_filelayout {
102 struct pnfs_layout_hdr generic_hdr;
103 struct nfs4_fl_commit_info commit_info;
104};
105
106static inline struct nfs4_filelayout *
107FILELAYOUT_FROM_HDR(struct pnfs_layout_hdr *lo)
108{
109 return container_of(lo, struct nfs4_filelayout, generic_hdr);
110}
111
96static inline struct nfs4_filelayout_segment * 112static inline struct nfs4_filelayout_segment *
97FILELAYOUT_LSEG(struct pnfs_layout_segment *lseg) 113FILELAYOUT_LSEG(struct pnfs_layout_segment *lseg)
98{ 114{