]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - fs/xfs/xfs_file.c
vfs: export lseek_execute() to modules
[linux-imx.git] / fs / xfs / xfs_file.c
index a5f2042aec8b27e730f0cbdedaef9eb50c9422f0..de3dc98f4e8f76067c1e7d0ee4631a8638d87988 100644 (file)
@@ -906,11 +906,10 @@ xfs_file_release(
 
 STATIC int
 xfs_file_readdir(
-       struct file     *filp,
-       void            *dirent,
-       filldir_t       filldir)
+       struct file     *file,
+       struct dir_context *ctx)
 {
-       struct inode    *inode = file_inode(filp);
+       struct inode    *inode = file_inode(file);
        xfs_inode_t     *ip = XFS_I(inode);
        int             error;
        size_t          bufsize;
@@ -929,8 +928,7 @@ xfs_file_readdir(
         */
        bufsize = (size_t)min_t(loff_t, 32768, ip->i_d.di_size);
 
-       error = xfs_readdir(ip, dirent, bufsize,
-                               (xfs_off_t *)&filp->f_pos, filldir);
+       error = xfs_readdir(ip, ctx, bufsize);
        if (error)
                return -error;
        return 0;
@@ -1270,8 +1268,7 @@ xfs_seek_data(
        }
 
 out:
-       if (offset != file->f_pos)
-               file->f_pos = offset;
+       offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
 
 out_unlock:
        xfs_iunlock_map_shared(ip, lock);
@@ -1379,8 +1376,7 @@ out:
         * situation in particular.
         */
        offset = min_t(loff_t, offset, isize);
-       if (offset != file->f_pos)
-               file->f_pos = offset;
+       offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
 
 out_unlock:
        xfs_iunlock_map_shared(ip, lock);
@@ -1432,7 +1428,7 @@ const struct file_operations xfs_file_operations = {
 const struct file_operations xfs_dir_file_operations = {
        .open           = xfs_dir_open,
        .read           = generic_read_dir,
-       .readdir        = xfs_file_readdir,
+       .iterate        = xfs_file_readdir,
        .llseek         = generic_file_llseek,
        .unlocked_ioctl = xfs_file_ioctl,
 #ifdef CONFIG_COMPAT