Skip to content

Commit 17f26b1

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFSv4: Deal with some more sparse warnings
Technically, we don't really need to convert these time stamps, since they are actually cookies. Signed-off-by: Trond Myklebust <[email protected]> Cc: Chuck Lever <[email protected]>
1 parent c281fa9 commit 17f26b1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

fs/nfs/nfs4proc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ static int update_open_stateid(struct nfs4_state *state, nfs4_stateid *open_stat
11031103
goto no_delegation;
11041104

11051105
spin_lock(&deleg_cur->lock);
1106-
if (nfsi->delegation != deleg_cur ||
1106+
if (rcu_dereference(nfsi->delegation) != deleg_cur ||
11071107
test_bit(NFS_DELEGATION_RETURNING, &deleg_cur->flags) ||
11081108
(deleg_cur->type & fmode) != fmode)
11091109
goto no_delegation_unlock;
@@ -4632,11 +4632,11 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
46324632
/* An impossible timestamp guarantees this value
46334633
* will never match a generated boot time. */
46344634
verf[0] = 0;
4635-
verf[1] = (__be32)(NSEC_PER_SEC + 1);
4635+
verf[1] = cpu_to_be32(NSEC_PER_SEC + 1);
46364636
} else {
46374637
struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
4638-
verf[0] = (__be32)nn->boot_time.tv_sec;
4639-
verf[1] = (__be32)nn->boot_time.tv_nsec;
4638+
verf[0] = cpu_to_be32(nn->boot_time.tv_sec);
4639+
verf[1] = cpu_to_be32(nn->boot_time.tv_nsec);
46404640
}
46414641
memcpy(bootverf->data, verf, sizeof(bootverf->data));
46424642
}
@@ -7263,7 +7263,7 @@ static void nfs41_free_stateid_release(void *calldata)
72637263
kfree(calldata);
72647264
}
72657265

7266-
const struct rpc_call_ops nfs41_free_stateid_ops = {
7266+
static const struct rpc_call_ops nfs41_free_stateid_ops = {
72677267
.rpc_call_prepare = nfs41_free_stateid_prepare,
72687268
.rpc_call_done = nfs41_free_stateid_done,
72697269
.rpc_release = nfs41_free_stateid_release,
@@ -7483,7 +7483,7 @@ const struct nfs4_minor_version_ops *nfs_v4_minor_ops[] = {
74837483
#endif
74847484
};
74857485

7486-
const struct inode_operations nfs4_dir_inode_operations = {
7486+
static const struct inode_operations nfs4_dir_inode_operations = {
74877487
.create = nfs_create,
74887488
.lookup = nfs_lookup,
74897489
.atomic_open = nfs_atomic_open,

fs/nfs/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ static void encode_create_session(struct xdr_stream *xdr,
18161816
*p++ = cpu_to_be32(RPC_AUTH_UNIX); /* auth_sys */
18171817

18181818
/* authsys_parms rfc1831 */
1819-
*p++ = (__be32)nn->boot_time.tv_nsec; /* stamp */
1819+
*p++ = cpu_to_be32(nn->boot_time.tv_nsec); /* stamp */
18201820
p = xdr_encode_opaque(p, machine_name, len);
18211821
*p++ = cpu_to_be32(0); /* UID */
18221822
*p++ = cpu_to_be32(0); /* GID */

0 commit comments

Comments
 (0)