summaryrefslogtreecommitdiffstats
path: root/fs/squashfs/dir.c
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2012-03-09 03:27:49 +0100
committerPhillip Lougher <phillip@squashfs.org.uk>2012-03-10 04:01:02 +0100
commit2158d3fd2769546cd9004eaeb776fee946155238 (patch)
treefbaa85fc0635c7a968b969ac1795cf2e79ddbcfa /fs/squashfs/dir.c
parentSquashfs: get rid of obsolete definitions in header file (diff)
downloadlinux-2158d3fd2769546cd9004eaeb776fee946155238.tar.xz
linux-2158d3fd2769546cd9004eaeb776fee946155238.zip
Squashfs: fix f_pos check in get_dir_index_using_offset
One off error in the f_pos check. If f_pos is 3 or less don't bother reading the index because we're at the start of the directory, and we obviously already know where that is on disk. This eliminates an unnecessary read. Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Diffstat (limited to 'fs/squashfs/dir.c')
-rw-r--r--fs/squashfs/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/squashfs/dir.c b/fs/squashfs/dir.c
index 7142a6fd28d3..b381305c9a47 100644
--- a/fs/squashfs/dir.c
+++ b/fs/squashfs/dir.c
@@ -64,7 +64,7 @@ static int get_dir_index_using_offset(struct super_block *sb,
* is offset by 3 because we invent "." and ".." entries which are
* not actually stored in the directory.
*/
- if (f_pos < 3)
+ if (f_pos <= 3)
return f_pos;
f_pos -= 3;