Return-Path: linux-nfs-owner@vger.kernel.org Received: from mx1.redhat.com ([209.132.183.28]:7367 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752569Ab1LNNyx (ORCPT ); Wed, 14 Dec 2011 08:54:53 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBEDsrts025784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 14 Dec 2011 08:54:53 -0500 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [10.11.228.66]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBEDspPl026219 for ; Wed, 14 Dec 2011 08:54:53 -0500 From: Jeff Layton To: linux-nfs@vger.kernel.org Subject: [PATCH 4/5] nfsd: add a cl_daddr field and a generic flags field to nfs4_client Date: Wed, 14 Dec 2011 08:54:50 -0500 Message-Id: <1323870891-3124-5-git-send-email-jlayton@redhat.com> In-Reply-To: <1323870891-3124-1-git-send-email-jlayton@redhat.com> References: <1323870891-3124-1-git-send-email-jlayton@redhat.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: The new clstate daemon tracks client name strings on a per-server address basis. In order to support this model, we need to pass the address where a call came in to the upcall. We'll also need a way to flag the nfs4_client as already being recorded on stable storage so that we don't continually upcall. Once we're able to deprecate the old state tracking code, we can get rid of cl_recdir to recoup some of the space we're using here. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 3 ++- fs/nfsd/state.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index e32ef02..7f0a124 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1194,7 +1194,8 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir, clear_bit(0, &clp->cl_cb_slot_busy); rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table"); copy_verf(clp, verf); - rpc_copy_addr((struct sockaddr *) &clp->cl_addr, sa); + rpc_copy_addr((struct sockaddr *)&clp->cl_addr, sa); + rpc_copy_addr((struct sockaddr *)&clp->cl_daddr, svc_daddr(rqstp)); clp->cl_flavor = rqstp->rq_flavor; copy_cred(&clp->cl_cred, &rqstp->rq_cred); gen_confirm(clp); diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index b07f5ea..7879db5 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -240,6 +240,9 @@ struct nfs4_client { nfs4_verifier cl_verifier; /* generated by client */ time_t cl_time; /* time of last lease renewal */ struct sockaddr_storage cl_addr; /* client ipaddress */ + struct sockaddr_storage cl_daddr; /* server ipaddress */ +#define NFSD4_CLIENT_STABLE (0) /* client on stable storage */ + unsigned long cl_flags; u32 cl_flavor; /* setclientid pseudoflavor */ char *cl_principal; /* setclientid principal name */ struct svc_cred cl_cred; /* setclientid principal */ -- 1.7.1