Messages in this thread Patch in this message | | | Date | Tue, 25 May 2004 15:41:07 -0700 | From | Andrew Morton <> | Subject | Re: very low performance on SCSI disks if device node is in tmpfs |
| |
Andrew Morton <akpm@osdl.org> wrote: > > Everything there is consistent with "not doing readahead". >
We need to set file->f_ra _after_ calling blkdev_open(), when inode->i_mapping points at the right thing. And we need to get it from inode->i_mapping->host->i_mapping too, which represents the underlying device.
--- 25/fs/open.c~blockdev-readahead-fix Tue May 25 15:38:15 2004 +++ 25-akpm/fs/open.c Tue May 25 15:38:15 2004 @@ -790,7 +790,6 @@ struct file *dentry_open(struct dentry * } f->f_mapping = inode->i_mapping; - file_ra_state_init(&f->f_ra, f->f_mapping); f->f_dentry = dentry; f->f_vfsmnt = mnt; f->f_pos = 0; @@ -804,6 +803,8 @@ struct file *dentry_open(struct dentry * } f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC); + file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping); + /* NB: we're sure to have correct a_ops only after f_op->open */ if (f->f_flags & O_DIRECT) { if (!f->f_mapping || !f->f_mapping->a_ops || _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |