diff options
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index a5f2042aec8b..de3dc98f4e8f 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -906,11 +906,10 @@ xfs_file_release( | |||
906 | 906 | ||
907 | STATIC int | 907 | STATIC int |
908 | xfs_file_readdir( | 908 | xfs_file_readdir( |
909 | struct file *filp, | 909 | struct file *file, |
910 | void *dirent, | 910 | struct dir_context *ctx) |
911 | filldir_t filldir) | ||
912 | { | 911 | { |
913 | struct inode *inode = file_inode(filp); | 912 | struct inode *inode = file_inode(file); |
914 | xfs_inode_t *ip = XFS_I(inode); | 913 | xfs_inode_t *ip = XFS_I(inode); |
915 | int error; | 914 | int error; |
916 | size_t bufsize; | 915 | size_t bufsize; |
@@ -929,8 +928,7 @@ xfs_file_readdir( | |||
929 | */ | 928 | */ |
930 | bufsize = (size_t)min_t(loff_t, 32768, ip->i_d.di_size); | 929 | bufsize = (size_t)min_t(loff_t, 32768, ip->i_d.di_size); |
931 | 930 | ||
932 | error = xfs_readdir(ip, dirent, bufsize, | 931 | error = xfs_readdir(ip, ctx, bufsize); |
933 | (xfs_off_t *)&filp->f_pos, filldir); | ||
934 | if (error) | 932 | if (error) |
935 | return -error; | 933 | return -error; |
936 | return 0; | 934 | return 0; |
@@ -1270,8 +1268,7 @@ xfs_seek_data( | |||
1270 | } | 1268 | } |
1271 | 1269 | ||
1272 | out: | 1270 | out: |
1273 | if (offset != file->f_pos) | 1271 | offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes); |
1274 | file->f_pos = offset; | ||
1275 | 1272 | ||
1276 | out_unlock: | 1273 | out_unlock: |
1277 | xfs_iunlock_map_shared(ip, lock); | 1274 | xfs_iunlock_map_shared(ip, lock); |
@@ -1379,8 +1376,7 @@ out: | |||
1379 | * situation in particular. | 1376 | * situation in particular. |
1380 | */ | 1377 | */ |
1381 | offset = min_t(loff_t, offset, isize); | 1378 | offset = min_t(loff_t, offset, isize); |
1382 | if (offset != file->f_pos) | 1379 | offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes); |
1383 | file->f_pos = offset; | ||
1384 | 1380 | ||
1385 | out_unlock: | 1381 | out_unlock: |
1386 | xfs_iunlock_map_shared(ip, lock); | 1382 | xfs_iunlock_map_shared(ip, lock); |
@@ -1432,7 +1428,7 @@ const struct file_operations xfs_file_operations = { | |||
1432 | const struct file_operations xfs_dir_file_operations = { | 1428 | const struct file_operations xfs_dir_file_operations = { |
1433 | .open = xfs_dir_open, | 1429 | .open = xfs_dir_open, |
1434 | .read = generic_read_dir, | 1430 | .read = generic_read_dir, |
1435 | .readdir = xfs_file_readdir, | 1431 | .iterate = xfs_file_readdir, |
1436 | .llseek = generic_file_llseek, | 1432 | .llseek = generic_file_llseek, |
1437 | .unlocked_ioctl = xfs_file_ioctl, | 1433 | .unlocked_ioctl = xfs_file_ioctl, |
1438 | #ifdef CONFIG_COMPAT | 1434 | #ifdef CONFIG_COMPAT |