]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
nfs/filelayout: use pnfs_error_mark_layout_for_return
authorPeng Tao <tao.peng@primarydata.com>
Fri, 5 Sep 2014 16:53:29 +0000 (00:53 +0800)
committerTom Haynes <loghyr@primarydata.com>
Tue, 3 Feb 2015 19:06:43 +0000 (11:06 -0800)
Instead of calling layoutreturn directly, call pnfs_error_mark_layout_for_return
to mark layouts for return and let generic code return layout when
layout segments are freed.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
Conflicts:
fs/nfs/filelayout/filelayout.c

fs/nfs/filelayout/filelayout.c
fs/nfs/pnfs_nfs.c

index bfa8547eb2d660666db98d00f9bde43a9af22090..5d2eadc65167afe0a59bc0630bd70b667f6e9022 100644 (file)
@@ -200,7 +200,7 @@ static int filelayout_async_handle_error(struct rpc_task *task,
                dprintk("%s DS connection error %d\n", __func__,
                        task->tk_status);
                nfs4_mark_deviceid_unavailable(devid);
-               set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags);
+               pnfs_error_mark_layout_for_return(inode, lseg);
                rpc_wake_up(&tbl->slot_tbl_waitq);
                /* fall through */
        default:
index c87f664587ee7372d7c547bfe7011ae9cc8a91e3..55bff41180e87a09f3f0b9cc1ad53fec3ae57a73 100644 (file)
 
 #define NFSDBG_FACILITY                NFSDBG_PNFS
 
-static void pnfs_generic_fenceme(struct inode *inode,
-                                struct pnfs_layout_hdr *lo)
-{
-       if (!test_and_clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags))
-               return;
-       pnfs_return_layout(inode);
-}
-
 void pnfs_generic_rw_release(void *data)
 {
        struct nfs_pgio_header *hdr = data;
-       struct pnfs_layout_hdr *lo = hdr->lseg->pls_layout;
 
-       pnfs_generic_fenceme(lo->plh_inode, lo);
        nfs_put_client(hdr->ds_clp);
        hdr->mds_ops->rpc_release(data);
 }