diff options
| author | Chuck Lever <cel@citi.umich.edu> | 2002-12-20 06:27:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-12-20 06:27:42 -0800 |
| commit | 0607be177ff3076f119ff8ded85ba36615fc5f9a (patch) | |
| tree | c4a4f91f1b91022f748850a81317c9ac75886454 | |
| parent | 756e3174a1b2b80cdb688a9871926a07a54ba0a3 (diff) | |
[PATCH] cleanup: simplify req_offset function in NFS client
Description:
everywhere the NFS client uses the req_offset() function today, it adds
req->wb_offset to the result. this patch simply makes "+req->wb_offset"
a part of the req_offset() function.
Test status:
Passes all Connectathon '02 tests with v2, v3, UDP and TCP. Passes
NFS torture tests on an x86 UP highmem system.
| -rw-r--r-- | fs/nfs/nfs3proc.c | 4 | ||||
| -rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
| -rw-r--r-- | fs/nfs/proc.c | 4 | ||||
| -rw-r--r-- | fs/nfs/read.c | 6 | ||||
| -rw-r--r-- | fs/nfs/write.c | 10 | ||||
| -rw-r--r-- | include/linux/nfs_fs.h | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 9ccadb74518e..c7388075cc79 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -708,7 +708,7 @@ nfs3_proc_read_setup(struct nfs_read_data *data, unsigned int count) req = nfs_list_entry(data->pages.next); data->u.v3.args.fh = NFS_FH(inode); - data->u.v3.args.offset = req_offset(req) + req->wb_offset; + data->u.v3.args.offset = req_offset(req); data->u.v3.args.pgbase = req->wb_offset; data->u.v3.args.pages = data->pagevec; data->u.v3.args.count = count; @@ -764,7 +764,7 @@ nfs3_proc_write_setup(struct nfs_write_data *data, unsigned int count, int how) req = nfs_list_entry(data->pages.next); data->u.v3.args.fh = NFS_FH(inode); - data->u.v3.args.offset = req_offset(req) + req->wb_offset; + data->u.v3.args.offset = req_offset(req); data->u.v3.args.pgbase = req->wb_offset; data->u.v3.args.count = count; data->u.v3.args.stable = stable; diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 133ab997f684..aff976bd19c5 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1384,7 +1384,7 @@ nfs4_proc_read_setup(struct nfs_read_data *data, unsigned int count) nfs4_setup_compound(cp, data->u.v4.ops, NFS_SERVER(inode), "read [async]"); nfs4_setup_putfh(cp, NFS_FH(inode)); - nfs4_setup_read(cp, req_offset(req) + req->wb_offset, + nfs4_setup_read(cp, req_offset(req), count, data->pagevec, req->wb_offset, &data->u.v4.res_eof, &data->u.v4.res_count); @@ -1437,7 +1437,7 @@ nfs4_proc_write_setup(struct nfs_write_data *data, unsigned int count, int how) nfs4_setup_compound(cp, data->u.v4.ops, NFS_SERVER(inode), "write [async]"); nfs4_setup_putfh(cp, NFS_FH(inode)); - nfs4_setup_write(cp, req_offset(req) + req->wb_offset, + nfs4_setup_write(cp, req_offset(req), count, stable, data->pagevec, req->wb_offset, &data->u.v4.res_count, &data->verf); diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 8869191cfb1f..9e8785e540b9 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -543,7 +543,7 @@ nfs_proc_read_setup(struct nfs_read_data *data, unsigned int count) req = nfs_list_entry(data->pages.next); data->u.v3.args.fh = NFS_FH(inode); - data->u.v3.args.offset = req_offset(req) + req->wb_offset; + data->u.v3.args.offset = req_offset(req); data->u.v3.args.pgbase = req->wb_offset; data->u.v3.args.pages = data->pagevec; data->u.v3.args.count = count; @@ -589,7 +589,7 @@ nfs_proc_write_setup(struct nfs_write_data *data, unsigned int count, int how) req = nfs_list_entry(data->pages.next); data->u.v3.args.fh = NFS_FH(inode); - data->u.v3.args.offset = req_offset(req) + req->wb_offset; + data->u.v3.args.offset = req_offset(req); data->u.v3.args.pgbase = req->wb_offset; data->u.v3.args.count = count; data->u.v3.args.stable = NFS_FILE_SYNC; diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 696cf9f8a797..423f27748525 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -178,7 +178,7 @@ nfs_read_rpcsetup(struct list_head *head, struct nfs_read_data *data) inode->i_sb->s_id, (long long)NFS_FILEID(inode), count, - (unsigned long long)req_offset(req) + req->wb_offset); + (unsigned long long)req_offset(req)); } static void @@ -274,7 +274,7 @@ nfs_readpage_result(struct rpc_task *task, unsigned int count, int eof) if (eof || ((fattr->valid & NFS_ATTR_FATTR) && - ((req_offset(req) + req->wb_offset + count) >= fattr->size))) + ((req_offset(req) + count) >= fattr->size))) SetPageUptodate(page); else if (count < req->wb_bytes) @@ -292,7 +292,7 @@ nfs_readpage_result(struct rpc_task *task, unsigned int count, int eof) req->wb_inode->i_sb->s_id, (long long)NFS_FILEID(req->wb_inode), req->wb_bytes, - (long long)(req_offset(req) + req->wb_offset)); + (long long)req_offset(req)); nfs_clear_request(req); nfs_release_request(req); nfs_unlock_request(req); diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 21d30b3a36e6..9f03dee51420 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -768,7 +768,7 @@ nfs_write_rpcsetup(struct list_head *head, struct nfs_write_data *data, int how) inode->i_sb->s_id, (long long)NFS_FILEID(inode), count, - (unsigned long long)req_offset(req) + req->wb_offset); + (unsigned long long)req_offset(req)); } /* @@ -902,7 +902,7 @@ nfs_writeback_done(struct rpc_task *task, int stable, req->wb_inode->i_sb->s_id, (long long)NFS_FILEID(req->wb_inode), req->wb_bytes, - (long long)(req_offset(req) + req->wb_offset)); + (long long)req_offset(req)); if (task->tk_status < 0) { ClearPageUptodate(page); @@ -958,8 +958,8 @@ nfs_commit_rpcsetup(struct list_head *head, struct nfs_write_data *data, int how * Determine the offset range of requests in the COMMIT call. * We rely on the fact that data->pages is an ordered list... */ - start = req_offset(first) + first->wb_offset; - end = req_offset(last) + (last->wb_offset + last->wb_bytes); + start = req_offset(first); + end = req_offset(last) + last->wb_bytes; len = end - start; /* If 'len' is not a 32-bit quantity, pass '0' in the COMMIT call */ if (end >= inode->i_size || len < 0 || len > (~((u32)0) >> 1)) @@ -1031,7 +1031,7 @@ nfs_commit_done(struct rpc_task *task) req->wb_inode->i_sb->s_id, (long long)NFS_FILEID(req->wb_inode), req->wb_bytes, - (long long)(req_offset(req) + req->wb_offset)); + (long long)req_offset(req)); if (task->tk_status < 0) { if (req->wb_file) req->wb_file->f_error = task->tk_status; diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 2673e32cc4ba..bddf1207c3a8 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -222,7 +222,7 @@ loff_t page_offset(struct page *page) static inline loff_t req_offset(struct nfs_page *req) { - return ((loff_t)req->wb_index) << PAGE_CACHE_SHIFT; + return (((loff_t)req->wb_index) << PAGE_CACHE_SHIFT) + req->wb_offset; } /* |
