pNFS: Cleanup - don't open code pnfs_mark_layout_stateid_invalid()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 22 Jul 2016 15:25:27 +0000 (11:25 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 24 Jul 2016 20:16:40 +0000 (16:16 -0400)
Ensure nfs42_layoutstat_done() layoutget don't open code layout stateid
invalidation.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs42proc.c
fs/nfs/nfs4proc.c
fs/nfs/pnfs.c
fs/nfs/pnfs.h

index aa03ed09ba06f79763146b0a6f8cb171c9778b0c..6ea5ad6f0d44e68773b9af7fa3961c25f44eb5c8 100644 (file)
@@ -336,8 +336,7 @@ nfs42_layoutstat_done(struct rpc_task *task, void *calldata)
                         * Mark the bad layout state as invalid, then retry
                         * with the current stateid.
                         */
-                       set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
-                       pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0);
+                       pnfs_mark_layout_stateid_invalid(lo, &head);
                        spin_unlock(&inode->i_lock);
                        pnfs_free_lseg_list(&head);
                } else
index dc50ba4d84adf17b4ac75c4c8ead9eed2535dede..8c453515d98c4c598ff5513d06578096869ebe9d 100644 (file)
@@ -7931,8 +7931,7 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
                         * Mark the bad layout state as invalid, then retry
                         * with the current stateid.
                         */
-                       set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
-                       pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0);
+                       pnfs_mark_layout_stateid_invalid(lo, &head);
                        spin_unlock(&inode->i_lock);
                        pnfs_free_lseg_list(&head);
                        status = -EAGAIN;
index 52b2a4dfdcb0218ce4fe1128d3ec3ef01b15bf0b..1374fcd404843b985fe4bd97da152a933a1a425a 100644 (file)
@@ -259,7 +259,7 @@ pnfs_put_layout_hdr(struct pnfs_layout_hdr *lo)
  * is required.
  * Note that caller must hold inode->i_lock.
  */
-static int
+int
 pnfs_mark_layout_stateid_invalid(struct pnfs_layout_hdr *lo,
                struct list_head *lseg_list)
 {
index 2f4f26905c03768761c3ef54e745667c815fe350..d71c9493693ac871dc3e4f0db205caa82bf490b9 100644 (file)
@@ -268,6 +268,8 @@ int pnfs_mark_matching_lsegs_return(struct pnfs_layout_hdr *lo,
                                struct list_head *tmp_list,
                                const struct pnfs_layout_range *recall_range,
                                u32 seq);
+int pnfs_mark_layout_stateid_invalid(struct pnfs_layout_hdr *lo,
+               struct list_head *lseg_list);
 bool pnfs_roc(struct inode *ino);
 void pnfs_roc_release(struct inode *ino);
 void pnfs_roc_set_barrier(struct inode *ino, u32 barrier);