Skip to content

Commit

Permalink
NFS: Always provide aligned buffers to the RPC read layers
Browse files Browse the repository at this point in the history
Instead of messing around with XDR padding in the RDMA layer, we should
just give the RPC layer an aligned buffer. Try to avoid creating extra
RPC calls by aligning to the smaller value of ALIGN(len, rsize) and
PAGE_SIZE.

Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
  • Loading branch information
Trond Myklebust authored and amschuma-ntap committed Aug 30, 2021
1 parent 2a7a451 commit 8cfb901
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,19 @@ static int
readpage_async_filler(void *data, struct page *page)
{
struct nfs_readdesc *desc = data;
struct inode *inode = page_file_mapping(page)->host;
unsigned int rsize = NFS_SERVER(inode)->rsize;
struct nfs_page *new;
unsigned int len;
unsigned int len, aligned_len;
int error;

len = nfs_page_length(page);
if (len == 0)
return nfs_return_empty_page(page);

new = nfs_create_request(desc->ctx, page, 0, len);
aligned_len = min_t(unsigned int, ALIGN(len, rsize), PAGE_SIZE);

new = nfs_create_request(desc->ctx, page, 0, aligned_len);
if (IS_ERR(new))
goto out_error;

Expand Down

0 comments on commit 8cfb901

Please sign in to comment.