]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - fs/ocfs2/file.c
vfs: export lseek_execute() to modules
[linux-imx.git] / fs / ocfs2 / file.c
index ff54014a24ecd58511c37a16b33f5e27a1e3e6dd..41000f223ca42bb855a57f1cc27f08a28ecccba9 100644 (file)
@@ -2646,17 +2646,7 @@ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence)
                goto out;
        }
 
-       if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET))
-               ret = -EINVAL;
-       if (!ret && offset > inode->i_sb->s_maxbytes)
-               ret = -EINVAL;
-       if (ret)
-               goto out;
-
-       if (offset != file->f_pos) {
-               file->f_pos = offset;
-               file->f_version = 0;
-       }
+       offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
 
 out:
        mutex_unlock(&inode->i_mutex);
@@ -2712,7 +2702,7 @@ const struct file_operations ocfs2_fops = {
 const struct file_operations ocfs2_dops = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
-       .readdir        = ocfs2_readdir,
+       .iterate        = ocfs2_readdir,
        .fsync          = ocfs2_sync_file,
        .release        = ocfs2_dir_release,
        .open           = ocfs2_dir_open,
@@ -2759,7 +2749,7 @@ const struct file_operations ocfs2_fops_no_plocks = {
 const struct file_operations ocfs2_dops_no_plocks = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
-       .readdir        = ocfs2_readdir,
+       .iterate        = ocfs2_readdir,
        .fsync          = ocfs2_sync_file,
        .release        = ocfs2_dir_release,
        .open           = ocfs2_dir_open,