Commit 256fdd4b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag '6.10-rc6-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fix from Steve French:
 "Fix for smb3 readahead performance regression"

* tag '6.10-rc6-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: Fix read-performance regression by dropping readahead expansion
parents 22f902df 08f70c0a
...@@ -245,35 +245,6 @@ static int cifs_init_request(struct netfs_io_request *rreq, struct file *file) ...@@ -245,35 +245,6 @@ static int cifs_init_request(struct netfs_io_request *rreq, struct file *file)
return 0; return 0;
} }
/*
* Expand the size of a readahead to the size of the rsize, if at least as
* large as a page, allowing for the possibility that rsize is not pow-2
* aligned.
*/
static void cifs_expand_readahead(struct netfs_io_request *rreq)
{
unsigned int rsize = rreq->rsize;
loff_t misalignment, i_size = i_size_read(rreq->inode);
if (rsize < PAGE_SIZE)
return;
if (rsize < INT_MAX)
rsize = roundup_pow_of_two(rsize);
else
rsize = ((unsigned int)INT_MAX + 1) / 2;
misalignment = rreq->start & (rsize - 1);
if (misalignment) {
rreq->start -= misalignment;
rreq->len += misalignment;
}
rreq->len = round_up(rreq->len, rsize);
if (rreq->start < i_size && rreq->len > i_size - rreq->start)
rreq->len = i_size - rreq->start;
}
/* /*
* Completion of a request operation. * Completion of a request operation.
*/ */
...@@ -329,7 +300,6 @@ const struct netfs_request_ops cifs_req_ops = { ...@@ -329,7 +300,6 @@ const struct netfs_request_ops cifs_req_ops = {
.init_request = cifs_init_request, .init_request = cifs_init_request,
.free_request = cifs_free_request, .free_request = cifs_free_request,
.free_subrequest = cifs_free_subrequest, .free_subrequest = cifs_free_subrequest,
.expand_readahead = cifs_expand_readahead,
.clamp_length = cifs_clamp_length, .clamp_length = cifs_clamp_length,
.issue_read = cifs_req_issue_read, .issue_read = cifs_req_issue_read,
.done = cifs_rreq_done, .done = cifs_rreq_done,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment