History

NFS: Remove unused argument from nfs_create_request()

All the callers of nfs_create_request() are now creating page group heads, so we can remove the redundant 'last' page argument.

Trond Myklebust committed 7 years ago

Commit 28b1d3f1 parent c917cfa5 files · +13 −14Browse files

Unified · Split

5 files
  1. fs/nfs/direct.c +2 −2
  2. fs/nfs/pagelist.c +8 −8
  3. fs/nfs/read.c +2 −2
  4. fs/nfs/write.c +1 −1
  5. include/linux/nfs_page.h +0 −1
fs/nfs/direct.c+2−2
@@ -492,7 +492,7 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq, · 491 unmodified lines
492 struct nfs_page *req;492 struct nfs_page *req;
493 unsigned int req_len = min_t(size_t, bytes, PAGE_SIZE - pgbase);493 unsigned int req_len = min_t(size_t, bytes, PAGE_SIZE - pgbase);
494 /* XXX do we need to do the eof zeroing found in async_filler? */494 /* XXX do we need to do the eof zeroing found in async_filler? */
495 req = nfs_create_request(dreq->ctx, pagevec[i], NULL,495 req = nfs_create_request(dreq->ctx, pagevec[i],
496 pgbase, req_len);496 pgbase, req_len);
497 if (IS_ERR(req)) {497 if (IS_ERR(req)) {
498 result = PTR_ERR(req);498 result = PTR_ERR(req);
@@ -899,7 +899,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq, · 400 unmodified lines
899 struct nfs_page *req;899 struct nfs_page *req;
900 unsigned int req_len = min_t(size_t, bytes, PAGE_SIZE - pgbase);900 unsigned int req_len = min_t(size_t, bytes, PAGE_SIZE - pgbase);
901 901
902 req = nfs_create_request(dreq->ctx, pagevec[i], NULL,902 req = nfs_create_request(dreq->ctx, pagevec[i],
903 pgbase, req_len);903 pgbase, req_len);
904 if (IS_ERR(req)) {904 if (IS_ERR(req)) {
905 result = PTR_ERR(req);905 result = PTR_ERR(req);
fs/nfs/pagelist.c+8−8
@@ -297,8 +297,8 @@ out: · 296 unmodified lines
297 297
298static struct nfs_page *298static struct nfs_page *
299__nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page,299__nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page,
300 struct nfs_page *last, unsigned int pgbase,300 unsigned int pgbase, unsigned int offset,
301 unsigned int offset, unsigned int count)301 unsigned int count)
302{302{
303 struct nfs_page *req;303 struct nfs_page *req;
304 struct nfs_open_context *ctx = l_ctx->open_context;304 struct nfs_open_context *ctx = l_ctx->open_context;
@@ -327,7 +327,6 @@ __nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page, · 22 unmodified lines
327 req->wb_bytes = count;327 req->wb_bytes = count;
328 req->wb_context = get_nfs_open_context(ctx);328 req->wb_context = get_nfs_open_context(ctx);
329 kref_init(&req->wb_kref);329 kref_init(&req->wb_kref);
330 nfs_page_group_init(req, last);
331 return req;330 return req;
332}331}
333 332
@@ -335,7 +334,6 @@ __nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page, · 1 unmodified line
335 * nfs_create_request - Create an NFS read/write request.334 * nfs_create_request - Create an NFS read/write request.
336 * @ctx: open context to use335 * @ctx: open context to use
337 * @page: page to write336 * @page: page to write
338 * @last: last nfs request created for this page group or NULL if head
339 * @offset: starting offset within the page for the write337 * @offset: starting offset within the page for the write
340 * @count: number of bytes to read/write338 * @count: number of bytes to read/write
341 *339 *
@@ -345,15 +343,16 @@ __nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page, · 3 unmodified lines
345 */343 */
346struct nfs_page *344struct nfs_page *
347nfs_create_request(struct nfs_open_context *ctx, struct page *page,345nfs_create_request(struct nfs_open_context *ctx, struct page *page,
348 struct nfs_page *last, unsigned int offset,346 unsigned int offset, unsigned int count)
349 unsigned int count)
350{347{
351 struct nfs_lock_context *l_ctx = nfs_get_lock_context(ctx);348 struct nfs_lock_context *l_ctx = nfs_get_lock_context(ctx);
352 struct nfs_page *ret;349 struct nfs_page *ret;
353 350
354 if (IS_ERR(l_ctx))351 if (IS_ERR(l_ctx))
355 return ERR_CAST(l_ctx);352 return ERR_CAST(l_ctx);
356 ret = __nfs_create_request(l_ctx, page, last, offset, offset, count);353 ret = __nfs_create_request(l_ctx, page, offset, offset, count);
354 if (!IS_ERR(ret))
355 nfs_page_group_init(ret, NULL);
357 nfs_put_lock_context(l_ctx);356 nfs_put_lock_context(l_ctx);
358 return ret;357 return ret;
359}358}
@@ -365,11 +364,12 @@ nfs_create_subreq(struct nfs_page *req, struct nfs_page *last, · 5 unmodified lines
365{364{
366 struct nfs_page *ret;365 struct nfs_page *ret;
367 366
368 ret = __nfs_create_request(req->wb_lock_context, req->wb_page, last,367 ret = __nfs_create_request(req->wb_lock_context, req->wb_page,
369 pgbase, offset, count);368 pgbase, offset, count);
370 if (!IS_ERR(ret)) {369 if (!IS_ERR(ret)) {
371 nfs_lock_request(ret);370 nfs_lock_request(ret);
372 ret->wb_index = req->wb_index;371 ret->wb_index = req->wb_index;
372 nfs_page_group_init(ret, last);
373 }373 }
374 return ret;374 return ret;
375}375}
fs/nfs/read.c+2−2
@@ -118,7 +118,7 @@ int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode, · 117 unmodified lines
118 len = nfs_page_length(page);118 len = nfs_page_length(page);
119 if (len == 0)119 if (len == 0)
120 return nfs_return_empty_page(page);120 return nfs_return_empty_page(page);
121 new = nfs_create_request(ctx, page, NULL, 0, len);121 new = nfs_create_request(ctx, page, 0, len);
122 if (IS_ERR(new)) {122 if (IS_ERR(new)) {
123 unlock_page(page);123 unlock_page(page);
124 return PTR_ERR(new);124 return PTR_ERR(new);
@@ -363,7 +363,7 @@ readpage_async_filler(void *data, struct page *page) · 238 unmodified lines
363 if (len == 0)363 if (len == 0)
364 return nfs_return_empty_page(page);364 return nfs_return_empty_page(page);
365 365
366 new = nfs_create_request(desc->ctx, page, NULL, 0, len);366 new = nfs_create_request(desc->ctx, page, 0, len);
367 if (IS_ERR(new))367 if (IS_ERR(new))
368 goto out_error;368 goto out_error;
369 369
fs/nfs/write.c+1−1
@@ -1171,7 +1171,7 @@ static struct nfs_page * nfs_setup_write_request(struct nfs_open_context* ctx, · 1170 unmodified lines
1171 req = nfs_try_to_update_request(inode, page, offset, bytes);1171 req = nfs_try_to_update_request(inode, page, offset, bytes);
1172 if (req != NULL)1172 if (req != NULL)
1173 goto out;1173 goto out;
1174 req = nfs_create_request(ctx, page, NULL, offset, bytes);1174 req = nfs_create_request(ctx, page, offset, bytes);
1175 if (IS_ERR(req))1175 if (IS_ERR(req))
1176 goto out;1176 goto out;
1177 nfs_inode_add_request(inode, req);1177 nfs_inode_add_request(inode, req);
include/linux/nfs_page.h+0−1
@@ -114,7 +114,6 @@ struct nfs_pageio_descriptor { · 113 unmodified lines
114 114
115extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx,115extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx,
116 struct page *page,116 struct page *page,
117 struct nfs_page *last,
118 unsigned int offset,117 unsigned int offset,
119 unsigned int count);118 unsigned int count);
120extern void nfs_release_request(struct nfs_page *);119extern void nfs_release_request(struct nfs_page *);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t