nfs41: pass iomode through layoutreturn args
authorPeng Tao <tao.peng@primarydata.com>
Fri, 5 Sep 2014 16:53:21 +0000 (00:53 +0800)
committerTom Haynes <loghyr@primarydata.com>
Tue, 3 Feb 2015 19:06:40 +0000 (11:06 -0800)
So that it is possible to return a specific iomode layouts.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
fs/nfs/nfs4xdr.c
fs/nfs/pnfs.c
include/linux/nfs_xdr.h

index 7d8d7a47f771bd65e588e9f4b11ad7dc7996c36d..3c3ff633dd171e150db918ea24f630e679a38112 100644 (file)
@@ -2012,7 +2012,7 @@ encode_layoutreturn(struct xdr_stream *xdr,
        p = reserve_space(xdr, 16);
        *p++ = cpu_to_be32(0);          /* reclaim. always 0 for now */
        *p++ = cpu_to_be32(args->layout_type);
-       *p++ = cpu_to_be32(IOMODE_ANY);
+       *p++ = cpu_to_be32(args->iomode);
        *p = cpu_to_be32(RETURN_FILE);
        p = reserve_space(xdr, 16);
        p = xdr_encode_hyper(p, 0);
index 7e1bac189d1cb91e7a63d84a112a85a659078e73..1b544c1a746c1a13b513ed4596e32175a49a761f 100644 (file)
@@ -914,6 +914,7 @@ _pnfs_return_layout(struct inode *ino)
        lrp->args.stateid = stateid;
        lrp->args.layout_type = NFS_SERVER(ino)->pnfs_curr_ld->id;
        lrp->args.inode = ino;
+       lrp->args.iomode = IOMODE_ANY;
        lrp->args.layout = lo;
        lrp->clp = NFS_SERVER(ino)->nfs_client;
        lrp->cred = lo->plh_lc_cred;
index 962f461c065d7566c5749d9b269be47999a4e716..4fd7793d45d16f403ba7ea1c514d383bf075bcb5 100644 (file)
@@ -293,6 +293,7 @@ struct nfs4_layoutreturn_args {
        struct nfs4_sequence_args seq_args;
        struct pnfs_layout_hdr *layout;
        struct inode *inode;
+       enum pnfs_iomode iomode;
        nfs4_stateid stateid;
        __u32   layout_type;
 };