Skip to content

Commit 2142914

Browse files
author
Al Viro
committed
lseek_execute() doesn't need an inode passed to it
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 5d48f3a commit 2142914

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

fs/read_write.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ static inline int unsigned_offsets(struct file *file)
4141
return file->f_mode & FMODE_UNSIGNED_OFFSET;
4242
}
4343

44-
static loff_t lseek_execute(struct file *file, struct inode *inode,
45-
loff_t offset, loff_t maxsize)
44+
static loff_t lseek_execute(struct file *file, loff_t offset, loff_t maxsize)
4645
{
4746
if (offset < 0 && !unsigned_offsets(file))
4847
return -EINVAL;
@@ -76,8 +75,6 @@ loff_t
7675
generic_file_llseek_size(struct file *file, loff_t offset, int whence,
7776
loff_t maxsize, loff_t eof)
7877
{
79-
struct inode *inode = file->f_mapping->host;
80-
8178
switch (whence) {
8279
case SEEK_END:
8380
offset += eof;
@@ -97,8 +94,7 @@ generic_file_llseek_size(struct file *file, loff_t offset, int whence,
9794
* like SEEK_SET.
9895
*/
9996
spin_lock(&file->f_lock);
100-
offset = lseek_execute(file, inode, file->f_pos + offset,
101-
maxsize);
97+
offset = lseek_execute(file, file->f_pos + offset, maxsize);
10298
spin_unlock(&file->f_lock);
10399
return offset;
104100
case SEEK_DATA:
@@ -120,7 +116,7 @@ generic_file_llseek_size(struct file *file, loff_t offset, int whence,
120116
break;
121117
}
122118

123-
return lseek_execute(file, inode, offset, maxsize);
119+
return lseek_execute(file, offset, maxsize);
124120
}
125121
EXPORT_SYMBOL(generic_file_llseek_size);
126122

0 commit comments

Comments
 (0)