]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/open.c
perf report: Drop cycles 0 for LBR print
[mirror_ubuntu-artful-kernel.git] / fs / open.c
index 9921f70bc5ca07dab62d19ff9fded8d4a60ae9f0..949cef29c3bba9395efd2e461d2078d0a9a9b47c 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -301,12 +301,10 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
        if (S_ISFIFO(inode->i_mode))
                return -ESPIPE;
 
-       /*
-        * Let individual file system decide if it supports preallocation
-        * for directories or not.
-        */
-       if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode) &&
-           !S_ISBLK(inode->i_mode))
+       if (S_ISDIR(inode->i_mode))
+               return -EISDIR;
+
+       if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))
                return -ENODEV;
 
        /* Check for wrap through zero too */
@@ -316,7 +314,7 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
        if (!file->f_op->fallocate)
                return -EOPNOTSUPP;
 
-       sb_start_write(inode->i_sb);
+       file_start_write(file);
        ret = file->f_op->fallocate(file, mode, offset, len);
 
        /*
@@ -329,7 +327,7 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
        if (ret == 0)
                fsnotify_modify(file);
 
-       sb_end_write(inode->i_sb);
+       file_end_write(file);
        return ret;
 }
 EXPORT_SYMBOL_GPL(vfs_fallocate);