From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 2/4] pnfs-submit: Remove readahead_range
Date: Thu, 8 Jul 2010 15:25:20 -0400 [thread overview]
Message-ID: <1278617122-24164-3-git-send-email-iisaman@netapp.com> (raw)
In-Reply-To: <1278617122-24164-2-git-send-email-iisaman@netapp.com>
This is not needed if we always use full file layout.
Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
fs/nfs/pnfs.c | 47 +++++++----------------------------------------
1 files changed, 7 insertions(+), 40 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 5b0c4ec..a3b934d 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1196,32 +1196,6 @@ out:
}
void
-readahead_range(struct inode *inode, struct list_head *pages, loff_t *offset,
- size_t *count)
-{
- struct page *first, *last;
- loff_t foff, i_size = i_size_read(inode);
- pgoff_t end_index = (i_size - 1) >> PAGE_CACHE_SHIFT;
- size_t range;
-
-
- first = list_entry((pages)->prev, struct page, lru);
- last = list_entry((pages)->next, struct page, lru);
-
- foff = (loff_t)first->index << PAGE_CACHE_SHIFT;
-
- range = (last->index - first->index) * PAGE_CACHE_SIZE;
- if (last->index == end_index)
- range += ((i_size - 1) & ~PAGE_CACHE_MASK) + 1;
- else
- range += PAGE_CACHE_SIZE;
- dprintk("%s foff %lu, range %Zu\n", __func__, (unsigned long)foff,
- range);
- *offset = foff;
- *count = range;
-}
-
-void
pnfs_set_pg_test(struct inode *inode, struct nfs_pageio_descriptor *pgio)
{
struct pnfs_layout_type *laytype;
@@ -1280,8 +1254,6 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,
struct list_head *pages)
{
struct nfs_server *nfss = NFS_SERVER(inode);
- size_t count = 0;
- loff_t loff;
pgio->pg_iswrite = 0;
pgio->pg_boundary = 0;
@@ -1291,19 +1263,14 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,
if (!pnfs_enabled_sb(nfss))
return;
- /* Calculate the total read-ahead count */
- readahead_range(inode, pages, &loff, &count);
-
- if (count > 0) {
- _pnfs_update_layout(inode, ctx, loff, count, IOMODE_READ,
- &pgio->pg_lseg);
- if (!pgio->pg_lseg)
- return;
+ _pnfs_update_layout(inode, ctx, 0, NFS4_MAX_UINT64, IOMODE_READ,
+ &pgio->pg_lseg);
+ if (!pgio->pg_lseg)
+ return;
- pgio->pg_boundary = pnfs_getboundary(inode);
- if (pgio->pg_boundary)
- pnfs_set_pg_test(inode, pgio);
- }
+ pgio->pg_boundary = pnfs_getboundary(inode);
+ if (pgio->pg_boundary)
+ pnfs_set_pg_test(inode, pgio);
}
void
--
1.6.6.1
next prev parent reply other threads:[~2010-07-08 19:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-08 19:25 [PATCH 0/4] pnfs-submit code removal patches Fred Isaman
2010-07-08 19:25 ` [PATCH 1/4] pnfs-submit: Rely on full-file layout assumption to clean out some code Fred Isaman
2010-07-08 19:25 ` Fred Isaman [this message]
2010-07-08 19:25 ` [PATCH 3/4] pnfs-submit: Remove offset and count arguments from pnfs_update_layout Fred Isaman
2010-07-08 19:25 ` [PATCH 4/4] pnfs-submit: Remove unused encode_getattr_three code Fred Isaman
2010-07-12 15:46 ` [PATCH 0/4] pnfs-submit code removal patches Benny Halevy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1278617122-24164-3-git-send-email-iisaman@netapp.com \
--to=iisaman@netapp.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).