From: Jeff Moyer <jmoyer@redhat.com>
To: linux-kernel@vger.kernel.org
Subject: unused 'size' assignment in filemap_nopage
Date: Tue, 22 Mar 2005 16:52:54 -0500 [thread overview]
Message-ID: <16960.37814.651437.634849@segfault.boston.redhat.com> (raw)
filemap_nopage has the following code:
retry_all:
size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
if (pgoff >= size)
goto outside_data_content;
/* If we don't want any read-ahead, don't bother */
if (VM_RandomReadHint(area))
goto no_cached_page;
/*
* The "size" of the file, as far as mmap is concerned, isn't bigger
* than the mapping
*/
if (size > endoff)
size = endoff;
After this, size is not referenced. So, either this potential reassignment
of size is superfluous, or we are missing some other code later on in the
function. If it is the former, I've attached a patch which will remove the
code.
Thanks,
Jeff
--- linux-2.6.12-rc1/mm/filemap.c.orig 2005-03-22 16:28:01.429426880 -0500
+++ linux-2.6.12-rc1/mm/filemap.c 2005-03-22 16:29:22.564092536 -0500
@@ -1191,13 +1191,6 @@ retry_all:
goto no_cached_page;
/*
- * The "size" of the file, as far as mmap is concerned, isn't bigger
- * than the mapping
- */
- if (size > endoff)
- size = endoff;
-
- /*
* The readahead code wants to be told about each and every page
* so it can build and shrink its windows appropriately
*
next reply other threads:[~2005-03-22 21:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-22 21:52 Jeff Moyer [this message]
2005-03-23 6:53 ` Jan Engelhardt
2005-03-23 11:08 ` Herbert Xu
2005-03-23 13:44 ` Jeff Moyer
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=16960.37814.651437.634849@segfault.boston.redhat.com \
--to=jmoyer@redhat.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®