NFSv4.1: Clear lseg pointer in ->doio function
authorFred Isaman <iisaman@netapp.com>
Thu, 3 Mar 2011 15:13:49 +0000 (15:13 +0000)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 11 Mar 2011 20:38:45 +0000 (15:38 -0500)
Now that we have access to the pointer, clear it immediately after
the put, instead of in caller.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/pagelist.c
fs/nfs/read.c
fs/nfs/write.c

index 9f628746f5c8c0df42aa83630d88e3baa7940566..23e7944106692a99a15118667a7d21820de3c1be 100644 (file)
@@ -312,7 +312,6 @@ static void nfs_pageio_doio(struct nfs_pageio_descriptor *desc)
 {
        if (!list_empty(&desc->pg_list)) {
                int error = desc->pg_doio(desc);
-               desc->pg_lseg = NULL;
                if (error < 0)
                        desc->pg_error = error;
                else
index ab9c7768b7c62bba24c7c525cfb5b4c8469dedd2..4b764c6048dbf4caa80be732e2423daf8102fa4b 100644 (file)
@@ -311,6 +311,7 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc)
                nbytes -= rsize;
        } while (nbytes != 0);
        put_lseg(lseg);
+       desc->pg_lseg = NULL;
 
        return ret;
 
@@ -357,6 +358,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc)
                                0, lseg);
 out:
        put_lseg(lseg);
+       desc->pg_lseg = NULL;
        return ret;
 }
 
index b74200a2f753686c3b343c852c1c3a7a92bd550e..47a3ad63e0d573b1211560bc20f5e7fe612d74fb 100644 (file)
@@ -949,6 +949,7 @@ static int nfs_flush_multi(struct nfs_pageio_descriptor *desc)
        } while (nbytes != 0);
 
        put_lseg(lseg);
+       desc->pg_lseg = NULL;
        return ret;
 
 out_bad:
@@ -1005,6 +1006,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc)
        ret = nfs_write_rpcsetup(req, data, &nfs_write_full_ops, desc->pg_count, 0, lseg, desc->pg_ioflags);
 out:
        put_lseg(lseg); /* Cleans any gotten in ->pg_test */
+       desc->pg_lseg = NULL;
        return ret;
 }