mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
fix for smb3 readahead performance regression
-----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmaJpfQACgkQiiy9cAdy T1FfYQwAiSSAbQJjKccFPQUCJkRnZoR8rSriRbWY7AfVoran11Bqzlc9LjnP4b0e tGiRvPu+rqtdfB++wrhcLr/Y3RMSsyzGtbLMMHpsymqr/nQsEUL+E2xq5qzHGgsc oanynas9kzSfLqWKvJ/CE9FBx1nHGYwd4/6T3GuxJWOjiAq52OTQ/SuzffbinuZ5 6nl028eOCIIVB44sDVPfkqkTYqvMawpgEU70J/z4HEGpnYMeFiTtKwWC4Poq+L4W cGM+3vS2rg6yxHid05hJXudMwVnCZbUr7nGJEJ4/iMYyzfwqF6JHx74Ymxzk/Fwl 2ILnyZn9gywmlVH3FuaibmaySg5XtaFPJPDyDe96AnMgyvWlx8g0p/gz0pTESFVx hNDGjpeZo1peDGBcXCCitD1zd1Tz/JrsJbgNxMmbAKPZqOxdV5qj/P85SLVggI7T DWcs0g+UGDIncVQwWkUyuzJygRbT4s2gA87Bi2080ObwoCqd/HyCVRVm5U8lxZJS 8AOWLQS5 =l6y6 -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
256fdd4b71
@ -245,35 +245,6 @@ static int cifs_init_request(struct netfs_io_request *rreq, struct file *file)
|
||||
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.
|
||||
*/
|
||||
@ -329,7 +300,6 @@ const struct netfs_request_ops cifs_req_ops = {
|
||||
.init_request = cifs_init_request,
|
||||
.free_request = cifs_free_request,
|
||||
.free_subrequest = cifs_free_subrequest,
|
||||
.expand_readahead = cifs_expand_readahead,
|
||||
.clamp_length = cifs_clamp_length,
|
||||
.issue_read = cifs_req_issue_read,
|
||||
.done = cifs_rreq_done,
|
||||
|
Loading…
Reference in New Issue
Block a user