Skip to content

Commit 924cf3c

Browse files
Trond Myklebustamschuma-ntap
authored andcommitted
NFSv4.1: constify the stateid argument in nfs41_test_stateid()
Signed-off-by: Trond Myklebust <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent b8ec59c commit 924cf3c

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

fs/nfs/nfs4_fs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ struct nfs4_minor_version_ops {
6767
void (*free_lock_state)(struct nfs_server *,
6868
struct nfs4_lock_state *);
6969
int (*test_and_free_expired)(struct nfs_server *,
70-
nfs4_stateid *, const struct cred *);
70+
const nfs4_stateid *,
71+
const struct cred *);
7172
struct nfs_seqid *
7273
(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t);
7374
void (*session_trunk)(struct rpc_clnt *clnt,

fs/nfs/nfs4proc.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp,
103103
const struct cred *cred,
104104
struct nfs4_slot *slot,
105105
bool is_privileged);
106-
static int nfs41_test_stateid(struct nfs_server *, nfs4_stateid *,
107-
const struct cred *);
106+
static int nfs41_test_stateid(struct nfs_server *, const nfs4_stateid *,
107+
const struct cred *);
108108
static int nfs41_free_stateid(struct nfs_server *, const nfs4_stateid *,
109-
const struct cred *, bool);
109+
const struct cred *, bool);
110110
#endif
111111

112112
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
@@ -2875,16 +2875,16 @@ static int nfs40_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *st
28752875
}
28762876

28772877
static int nfs40_test_and_free_expired_stateid(struct nfs_server *server,
2878-
nfs4_stateid *stateid,
2879-
const struct cred *cred)
2878+
const nfs4_stateid *stateid,
2879+
const struct cred *cred)
28802880
{
28812881
return -NFS4ERR_BAD_STATEID;
28822882
}
28832883

28842884
#if defined(CONFIG_NFS_V4_1)
28852885
static int nfs41_test_and_free_expired_stateid(struct nfs_server *server,
2886-
nfs4_stateid *stateid,
2887-
const struct cred *cred)
2886+
const nfs4_stateid *stateid,
2887+
const struct cred *cred)
28882888
{
28892889
int status;
28902890

@@ -10386,12 +10386,12 @@ nfs41_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
1038610386
}
1038710387

1038810388
static int _nfs41_test_stateid(struct nfs_server *server,
10389-
nfs4_stateid *stateid,
10390-
const struct cred *cred)
10389+
const nfs4_stateid *stateid,
10390+
const struct cred *cred)
1039110391
{
1039210392
int status;
1039310393
struct nfs41_test_stateid_args args = {
10394-
.stateid = stateid,
10394+
.stateid = *stateid,
1039510395
};
1039610396
struct nfs41_test_stateid_res res;
1039710397
struct rpc_message msg = {
@@ -10447,8 +10447,8 @@ static void nfs4_handle_delay_or_session_error(struct nfs_server *server,
1044710447
* failed or the state ID is not currently valid.
1044810448
*/
1044910449
static int nfs41_test_stateid(struct nfs_server *server,
10450-
nfs4_stateid *stateid,
10451-
const struct cred *cred)
10450+
const nfs4_stateid *stateid,
10451+
const struct cred *cred)
1045210452
{
1045310453
struct nfs4_exception exception = {
1045410454
.interruptible = true,

fs/nfs/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ static void encode_test_stateid(struct xdr_stream *xdr,
21372137
{
21382138
encode_op_hdr(xdr, OP_TEST_STATEID, decode_test_stateid_maxsz, hdr);
21392139
encode_uint32(xdr, 1);
2140-
encode_nfs4_stateid(xdr, args->stateid);
2140+
encode_nfs4_stateid(xdr, &args->stateid);
21412141
}
21422142

21432143
static void encode_free_stateid(struct xdr_stream *xdr,

include/linux/nfs_xdr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ struct nfs41_secinfo_no_name_args {
14381438

14391439
struct nfs41_test_stateid_args {
14401440
struct nfs4_sequence_args seq_args;
1441-
nfs4_stateid *stateid;
1441+
nfs4_stateid stateid;
14421442
};
14431443

14441444
struct nfs41_test_stateid_res {

0 commit comments

Comments
 (0)