summaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4filelayout.h
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-20 22:47:38 +0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 22:10:36 +0400
commit799ba8d53d32c84bd2a867ca2689538a48176140 (patch)
treee17ad842898a2c9b63183f7a435c984191336859 /fs/nfs/nfs4filelayout.h
parent1acbbb4e16209e85c35ff6cacad61d802c07289b (diff)
downloadlinux-799ba8d53d32c84bd2a867ca2689538a48176140.tar.xz
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 {
struct nfs4_fl_commit_bucket {
struct list_head written;
struct list_head committing;
+ struct pnfs_layout_segment *wlseg;
+ struct pnfs_layout_segment *clseg;
+};
+
+struct nfs4_fl_commit_info {
+ int nbuckets;
+ struct nfs4_fl_commit_bucket *buckets;
};
struct nfs4_filelayout_segment {
@@ -89,10 +96,19 @@ struct nfs4_filelayout_segment {
struct nfs4_file_layout_dsaddr *dsaddr; /* Point to GETDEVINFO data */
unsigned int num_fh;
struct nfs_fh **fh_array;
- struct nfs4_fl_commit_bucket *commit_buckets; /* Sort commits to ds */
- int number_of_buckets;
};
+struct nfs4_filelayout {
+ struct pnfs_layout_hdr generic_hdr;
+ struct nfs4_fl_commit_info commit_info;
+};
+
+static inline struct nfs4_filelayout *
+FILELAYOUT_FROM_HDR(struct pnfs_layout_hdr *lo)
+{
+ return container_of(lo, struct nfs4_filelayout, generic_hdr);
+}
+
static inline struct nfs4_filelayout_segment *
FILELAYOUT_LSEG(struct pnfs_layout_segment *lseg)
{