Commit c21e7168848d4ff4158120dbd4464f0d5cfb1456
1 parent
d7242c4641
NFSv4/pnfs: Support a list of commit arrays in struct pnfs_ds_commit_info
When we have multiple layout segments with different lists of mirrored data, we need to track the commits on a per layout segment basis. This patch adds a list to support this tracking in struct pnfs_ds_commit_info. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Showing 5 changed files with 18 additions and 1 deletions Side-by-side Diff
fs/nfs/direct.c
... | ... | @@ -305,6 +305,7 @@ |
305 | 305 | kref_get(&dreq->kref); |
306 | 306 | init_completion(&dreq->completion); |
307 | 307 | INIT_LIST_HEAD(&dreq->mds_cinfo.list); |
308 | + pnfs_init_ds_commit_info(&dreq->ds_cinfo); | |
308 | 309 | dreq->verf.committed = NFS_INVALID_STABLE_HOW; /* not set yet */ |
309 | 310 | INIT_WORK(&dreq->work, nfs_direct_write_schedule_work); |
310 | 311 | spin_lock_init(&dreq->lock); |
fs/nfs/filelayout/filelayout.c
... | ... | @@ -1140,7 +1140,10 @@ |
1140 | 1140 | struct nfs4_filelayout *flo; |
1141 | 1141 | |
1142 | 1142 | flo = kzalloc(sizeof(*flo), gfp_flags); |
1143 | - return flo != NULL ? &flo->generic_hdr : NULL; | |
1143 | + if (flo == NULL) | |
1144 | + return NULL; | |
1145 | + pnfs_init_ds_commit_info(&flo->commit_info); | |
1146 | + return &flo->generic_hdr; | |
1144 | 1147 | } |
1145 | 1148 | |
1146 | 1149 | static void |
fs/nfs/flexfilelayout/flexfilelayout.c
fs/nfs/pnfs.h
... | ... | @@ -463,6 +463,12 @@ |
463 | 463 | } |
464 | 464 | |
465 | 465 | static inline void |
466 | +pnfs_init_ds_commit_info(struct pnfs_ds_commit_info *fl_cinfo) | |
467 | +{ | |
468 | + INIT_LIST_HEAD(&fl_cinfo->commits); | |
469 | +} | |
470 | + | |
471 | +static inline void | |
466 | 472 | pnfs_generic_mark_devid_invalid(struct nfs4_deviceid_node *node) |
467 | 473 | { |
468 | 474 | set_bit(NFS_DEVICEID_INVALID, &node->flags); |
... | ... | @@ -757,6 +763,11 @@ |
757 | 763 | pnfs_get_ds_info(struct inode *inode) |
758 | 764 | { |
759 | 765 | return NULL; |
766 | +} | |
767 | + | |
768 | +static inline void | |
769 | +pnfs_init_ds_commit_info(struct pnfs_ds_commit_info *fl_cinfo) | |
770 | +{ | |
760 | 771 | } |
761 | 772 | |
762 | 773 | static inline bool |