Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269975
b: refs/heads/master
c: 66bfaad
h: refs/heads/master
i:
  269973: 77ef089
  269971: 63c2679
  269967: 99a3f43
v: v3
  • Loading branch information
Jeff Layton committed Oct 19, 2011
1 parent 6eeea03 commit 154ecc7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5eba8ab3606621f7e175ae9f521d71f3ac534f82
refs/heads/master: 66bfaadc3da74fecb4ba8b03f6b81d5f58b031fa
21 changes: 19 additions & 2 deletions trunk/fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3182,6 +3182,22 @@ cifs_get_volume_info(char *mount_data, const char *devname)
return volume_info;
}

/* make sure ra_pages is a multiple of rsize */
static inline unsigned int
cifs_ra_pages(struct cifs_sb_info *cifs_sb)
{
unsigned int reads;
unsigned int rsize_pages = cifs_sb->rsize / PAGE_CACHE_SIZE;

if (rsize_pages >= default_backing_dev_info.ra_pages)
return default_backing_dev_info.ra_pages;
else if (rsize_pages == 0)
return rsize_pages;

reads = default_backing_dev_info.ra_pages / rsize_pages;
return reads * rsize_pages;
}

int
cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
{
Expand All @@ -3200,8 +3216,6 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
if (rc)
return rc;

cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages;

#ifdef CONFIG_CIFS_DFS_UPCALL
try_mount_again:
/* cleanup activities if we're chasing a referral */
Expand Down Expand Up @@ -3269,6 +3283,9 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
cifs_sb->wsize = cifs_negotiate_wsize(tcon, volume_info);
cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info);

/* tune readahead according to rsize */
cifs_sb->bdi.ra_pages = cifs_ra_pages(cifs_sb);

remote_path_check:
#ifdef CONFIG_CIFS_DFS_UPCALL
/*
Expand Down

0 comments on commit 154ecc7

Please sign in to comment.