NFSD: Make @gdev parameter of ->encode_getdeviceinfo a const pointer
authorChuck Lever <chuck.lever@oracle.com>
Mon, 25 Sep 2023 13:28:17 +0000 (09:28 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:29 +0000 (12:44 -0400)
This enables callers to be passed const pointer parameters.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/blocklayoutxdr.c
fs/nfsd/blocklayoutxdr.h
fs/nfsd/flexfilelayoutxdr.c
fs/nfsd/flexfilelayoutxdr.h
fs/nfsd/pnfs.h

index f846934..ce78f74 100644 (file)
@@ -77,7 +77,7 @@ nfsd4_block_encode_volume(struct xdr_stream *xdr, struct pnfs_block_volume *b)
 
 __be32
 nfsd4_block_encode_getdeviceinfo(struct xdr_stream *xdr,
-               struct nfsd4_getdeviceinfo *gdp)
+               const struct nfsd4_getdeviceinfo *gdp)
 {
        struct pnfs_block_deviceaddr *dev = gdp->gd_device;
        int len = sizeof(__be32), ret, i;
index 5f88539..b0361e8 100644 (file)
@@ -51,7 +51,7 @@ struct pnfs_block_deviceaddr {
 };
 
 __be32 nfsd4_block_encode_getdeviceinfo(struct xdr_stream *xdr,
-               struct nfsd4_getdeviceinfo *gdp);
+               const struct nfsd4_getdeviceinfo *gdp);
 __be32 nfsd4_block_encode_layoutget(struct xdr_stream *xdr,
                const struct nfsd4_layoutget *lgp);
 int nfsd4_block_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp,
index 5319cb9..aeb71c1 100644 (file)
@@ -77,7 +77,7 @@ nfsd4_ff_encode_layoutget(struct xdr_stream *xdr,
 
 __be32
 nfsd4_ff_encode_getdeviceinfo(struct xdr_stream *xdr,
-               struct nfsd4_getdeviceinfo *gdp)
+               const struct nfsd4_getdeviceinfo *gdp)
 {
        struct pnfs_ff_device_addr *da = gdp->gd_device;
        int len;
index a447efb..6d5a106 100644 (file)
@@ -43,7 +43,7 @@ struct pnfs_ff_layout {
 };
 
 __be32 nfsd4_ff_encode_getdeviceinfo(struct xdr_stream *xdr,
-               struct nfsd4_getdeviceinfo *gdp);
+               const struct nfsd4_getdeviceinfo *gdp);
 __be32 nfsd4_ff_encode_layoutget(struct xdr_stream *xdr,
                const struct nfsd4_layoutget *lgp);
 
index d8e1a33..de1e0df 100644 (file)
@@ -27,7 +27,7 @@ struct nfsd4_layout_ops {
                        struct nfs4_client *clp,
                        struct nfsd4_getdeviceinfo *gdevp);
        __be32 (*encode_getdeviceinfo)(struct xdr_stream *xdr,
-                       struct nfsd4_getdeviceinfo *gdevp);
+                       const struct nfsd4_getdeviceinfo *gdevp);
 
        __be32 (*proc_layoutget)(struct inode *, const struct svc_fh *fhp,
                        struct nfsd4_layoutget *lgp);