[pnfs] [PATCH] update ds statid from mds
Marc Eshel
eshel at almaden.ibm.com
Mon May 12 23:48:17 EDT 2008
The si_generation is not part of the find id, we don't create a different
stateid if generation don't match we just want to updated the existing
one.
Marc.
Benny Halevy <bhalevy.lists at gmail.com> wrote on 05/12/2008 08:36:45 PM:
>
> On May. 12, 2008, 17:27 -0700, Marc Eshel <eshel at almaden.ibm.com> wrote:
> > From: Marc Eshel <eshel at almaden.ibm.com>
> >
> >
> > ---
> >
> > fs/nfsd/nfs4pnfsds.c | 27 +++++++++++++++++++++++----
> > 1 files changed, 23 insertions(+), 4 deletions(-)
> >
> > diff --git a/fs/nfsd/nfs4pnfsds.c b/fs/nfsd/nfs4pnfsds.c
> > index 2ed98f1..d1b06e5 100644
> > --- a/fs/nfsd/nfs4pnfsds.c
> > +++ b/fs/nfsd/nfs4pnfsds.c
> > @@ -272,6 +272,19 @@ alloc_init_ds_stateid(struct svc_fh *cfh,
> struct pnfs_get_state *gsp)
> > return dsp;
> > }
> >
> > +static void
> > +update_ds_stateid(struct pnfs_ds_stateid *dsp, struct svc_fh
> *cfh, struct pnfs_get_state *gsp)
> > +{
> > + dprintk("pNFSD: %s\n", __func__);
> > +
> > + dsp->ds_access = gsp->access;
> > + dsp->ds_status = 0;
> > + dsp->ds_verifier[0] = gsp->verifier[0];
> > + dsp->ds_verifier[1] = gsp->verifier[1];
> > +
> > + return;
> > +}
> > +
> > struct pnfs_ds_stateid *
> > nfsv4_ds_get_state(struct svc_fh *cfh, stateid_t *stidp)
> > {
> > @@ -286,8 +299,10 @@ nfsv4_ds_get_state(struct svc_fh *cfh,
> stateid_t *stidp)
> > dprintk("pNFSD: %s\n", __func__);
> >
> > dsp = find_pnfs_ds_stateid(stidp);
> > - if (dsp)
> > - return dsp;
> > + if (dsp) {
> > + if (stidp->si_generation == dsp->ds_stid.si_generation)
>
> Why not add this to the find_pnfs_ds_stateid()'s lookup conditions?
>
> Benny
>
> > + return dsp;
> > + }
> > memcpy(&gs.stid, stidp, sizeof(stateid_t));
> > sb = ino->i_sb;
> > if (sb && sb->s_export_op->get_state) {
> > @@ -298,8 +313,12 @@ nfsv4_ds_get_state(struct svc_fh *cfh,
> stateid_t *stidp)
> > }
> > if (status)
> > return NULL;
> > - /* create new pnfs_ds_stateid */
> > - dsp = alloc_init_ds_stateid(cfh, &gs);
> > + if (dsp)
> > + update_ds_stateid(dsp, cfh, &gs);
> > + else
> > + /* create new pnfs_ds_stateid */
> > + dsp = alloc_init_ds_stateid(cfh, &gs);
> > +
> > return dsp;
> > }
> >
> > _______________________________________________
> > pNFS mailing list
> > pNFS at linux-nfs.org
> > http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20080512/c403a265/attachment-0001.htm
More information about the pNFS
mailing list