From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: [PATCH 9/9] NFSv4.1: Clear lseg pointer in ->doio function
Date: Thu, 3 Mar 2011 10:13:49 -0500 [thread overview]
Message-ID: <1299165229-3148-10-git-send-email-iisaman@netapp.com> (raw)
In-Reply-To: <1299165229-3148-1-git-send-email-iisaman@netapp.com>
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>
---
fs/nfs/pagelist.c | 1 -
fs/nfs/read.c | 2 ++
fs/nfs/write.c | 2 ++
3 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 9f62874..23e7944 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -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
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index ab9c776..4b764c6 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -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;
}
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index ccc7c22..bdb72f3 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -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;
}
--
1.7.2.1
prev parent reply other threads:[~2011-03-03 15:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 15:13 [PATCH 0/9] NFSv4.1: pnfs wave4 submission v2 Fred Isaman
2011-03-03 15:13 ` [PATCH 1/9] NFSv4.1: rearrange nfs_write_rpcsetup Fred Isaman
2011-03-03 15:13 ` [PATCH 2/9] NFSv4.1: add callback to nfs4_write_done Fred Isaman
2011-03-03 15:13 ` [PATCH 3/9] NFSv4.1: Send lseg down into nfs_write_rpcsetup Fred Isaman
2011-03-03 15:13 ` [PATCH 4/9] NFSv4.1: trigger LAYOUTGET for writes Fred Isaman
2011-03-03 15:13 ` [PATCH 5/9] NFSv4.1: implement generic pnfs layer write switch Fred Isaman
2011-03-03 15:13 ` [PATCH 6/9] NFSv4.1: remove GETATTR from ds writes Fred Isaman
2011-03-03 15:13 ` [PATCH 7/9] NFSv4.1: pnfs filelayout driver write Fred Isaman
2011-03-03 15:13 ` [PATCH 8/9] NFSv4.1: rearrange ->doio args Fred Isaman
2011-03-10 7:58 ` Benny Halevy
2011-03-03 15:13 ` Fred Isaman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1299165229-3148-10-git-send-email-iisaman@netapp.com \
--to=iisaman@netapp.com \
--cc=Trond.Myklebust@netapp.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).