Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308650
b: refs/heads/master
c: f092075
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed May 22, 2012
1 parent 1656418 commit ded6ce2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c820d9a97f07b273b2c8a5960bd52b1b5864c68
refs/heads/master: f092075dd33ea04000590e8ffea65c2e7d03d764
2 changes: 1 addition & 1 deletion trunk/fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
spin_lock_init(&clp->cl_lock);
INIT_DELAYED_WORK(&clp->cl_renewd, nfs4_renew_state);
rpc_init_wait_queue(&clp->cl_rpcwaitq, "NFS client");
clp->cl_boot_time = CURRENT_TIME;
clp->cl_state = 1 << NFS4CLNT_LEASE_EXPIRED;
clp->cl_minorversion = cl_init->minorversion;
clp->cl_mvops = nfs_v4_minor_ops[cl_init->minorversion];
Expand Down Expand Up @@ -1813,6 +1812,7 @@ void nfs_clients_init(struct net *net)
idr_init(&nn->cb_ident_idr);
#endif
spin_lock_init(&nn->nfs_client_lock);
nn->boot_time = CURRENT_TIME;
}

#ifdef CONFIG_PROC_FS
Expand Down
5 changes: 5 additions & 0 deletions trunk/fs/nfs/netns.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* NFS-private data for each "struct net". Accessed with net_generic().
*/

#ifndef __NFS_NETNS_H__
#define __NFS_NETNS_H__

Expand All @@ -20,6 +24,7 @@ struct nfs_net {
struct idr cb_ident_idr; /* Protected by nfs_client_lock */
#endif
spinlock_t nfs_client_lock;
struct timespec boot_time;
};

extern int nfs_net_id;
Expand Down
14 changes: 8 additions & 6 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include "iostat.h"
#include "callback.h"
#include "pnfs.h"
#include "netns.h"

#define NFSDBG_FACILITY NFSDBG_PROC

Expand Down Expand Up @@ -3903,8 +3904,8 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
return -EAGAIN;
}

static void nfs4_construct_boot_verifier(struct nfs_client *clp,
nfs4_verifier *bootverf)
static void nfs4_init_boot_verifier(const struct nfs_client *clp,
nfs4_verifier *bootverf)
{
__be32 verf[2];

Expand All @@ -3914,8 +3915,9 @@ static void nfs4_construct_boot_verifier(struct nfs_client *clp,
verf[0] = 0;
verf[1] = (__be32)(NSEC_PER_SEC + 1);
} else {
verf[0] = (__be32)clp->cl_boot_time.tv_sec;
verf[1] = (__be32)clp->cl_boot_time.tv_nsec;
struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
verf[0] = (__be32)nn->boot_time.tv_sec;
verf[1] = (__be32)nn->boot_time.tv_nsec;
}
memcpy(bootverf->data, verf, sizeof(bootverf->data));
}
Expand All @@ -3939,7 +3941,7 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program,
int loop = 0;
int status;

nfs4_construct_boot_verifier(clp, &sc_verifier);
nfs4_init_boot_verifier(clp, &sc_verifier);

for(;;) {
rcu_read_lock();
Expand Down Expand Up @@ -5099,7 +5101,7 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
dprintk("--> %s\n", __func__);
BUG_ON(clp == NULL);

nfs4_construct_boot_verifier(clp, &verifier);
nfs4_init_boot_verifier(clp, &verifier);

args.id_len = scnprintf(args.id, sizeof(args.id),
"%s/%s/%u",
Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
#include <linux/nfs4.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_idmap.h>

#include "nfs4_fs.h"
#include "internal.h"
#include "pnfs.h"
#include "netns.h"

#define NFSDBG_FACILITY NFSDBG_XDR

Expand Down Expand Up @@ -1702,6 +1704,7 @@ static void encode_create_session(struct xdr_stream *xdr,
char machine_name[NFS4_MAX_MACHINE_NAME_LEN];
uint32_t len;
struct nfs_client *clp = args->client;
struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
u32 max_resp_sz_cached;

/*
Expand Down Expand Up @@ -1743,7 +1746,7 @@ static void encode_create_session(struct xdr_stream *xdr,
*p++ = cpu_to_be32(RPC_AUTH_UNIX); /* auth_sys */

/* authsys_parms rfc1831 */
*p++ = cpu_to_be32((u32)clp->cl_boot_time.tv_nsec); /* stamp */
*p++ = (__be32)nn->boot_time.tv_nsec; /* stamp */
p = xdr_encode_opaque(p, machine_name, len);
*p++ = cpu_to_be32(0); /* UID */
*p++ = cpu_to_be32(0); /* GID */
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/nfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ struct nfs_client {

struct rpc_wait_queue cl_rpcwaitq;

/* used for the setclientid verifier */
struct timespec cl_boot_time;

/* idmapper */
struct idmap * cl_idmap;

Expand Down

0 comments on commit ded6ce2

Please sign in to comment.