diff options
author | Fred Isaman <iisaman@netapp.com> | 2011-03-03 10:13:49 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-11 15:38:45 -0500 |
commit | 36fe432d33e078caee5c954e15e929819c2cacae (patch) | |
tree | 84bccc3434a423f8eabae42d543fad5914124ae2 /fs/nfs | |
parent | c76069bda0f17cd3e153e54d9ac01242909c6b15 (diff) |
NFSv4.1: Clear lseg pointer in ->doio function
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/pagelist.c | 1 | ||||
-rw-r--r-- | fs/nfs/read.c | 2 | ||||
-rw-r--r-- | 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 9f628746f5c8..23e794410669 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) | |||
312 | { | 312 | { |
313 | if (!list_empty(&desc->pg_list)) { | 313 | if (!list_empty(&desc->pg_list)) { |
314 | int error = desc->pg_doio(desc); | 314 | int error = desc->pg_doio(desc); |
315 | desc->pg_lseg = NULL; | ||
316 | if (error < 0) | 315 | if (error < 0) |
317 | desc->pg_error = error; | 316 | desc->pg_error = error; |
318 | else | 317 | else |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index ab9c7768b7c6..4b764c6048db 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) | |||
311 | nbytes -= rsize; | 311 | nbytes -= rsize; |
312 | } while (nbytes != 0); | 312 | } while (nbytes != 0); |
313 | put_lseg(lseg); | 313 | put_lseg(lseg); |
314 | desc->pg_lseg = NULL; | ||
314 | 315 | ||
315 | return ret; | 316 | return ret; |
316 | 317 | ||
@@ -357,6 +358,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc) | |||
357 | 0, lseg); | 358 | 0, lseg); |
358 | out: | 359 | out: |
359 | put_lseg(lseg); | 360 | put_lseg(lseg); |
361 | desc->pg_lseg = NULL; | ||
360 | return ret; | 362 | return ret; |
361 | } | 363 | } |
362 | 364 | ||
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index b74200a2f753..47a3ad63e0d5 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) | |||
949 | } while (nbytes != 0); | 949 | } while (nbytes != 0); |
950 | 950 | ||
951 | put_lseg(lseg); | 951 | put_lseg(lseg); |
952 | desc->pg_lseg = NULL; | ||
952 | return ret; | 953 | return ret; |
953 | 954 | ||
954 | out_bad: | 955 | out_bad: |
@@ -1005,6 +1006,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc) | |||
1005 | ret = nfs_write_rpcsetup(req, data, &nfs_write_full_ops, desc->pg_count, 0, lseg, desc->pg_ioflags); | 1006 | ret = nfs_write_rpcsetup(req, data, &nfs_write_full_ops, desc->pg_count, 0, lseg, desc->pg_ioflags); |
1006 | out: | 1007 | out: |
1007 | put_lseg(lseg); /* Cleans any gotten in ->pg_test */ | 1008 | put_lseg(lseg); /* Cleans any gotten in ->pg_test */ |
1009 | desc->pg_lseg = NULL; | ||
1008 | return ret; | 1010 | return ret; |
1009 | } | 1011 | } |
1010 | 1012 | ||