]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/filemap.c
[PATCH] BLOCK: Make it possible to disable the block layer [try #6]
[mirror_ubuntu-bionic-kernel.git] / mm / filemap.c
index d6846de0888719308fab1f23c6bfa1442eebda5e..c4fe97f5ace0851d3023d1305d8de5c7ad2b1dd5 100644 (file)
@@ -2020,6 +2020,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
                if (unlikely(*pos + *count > inode->i_sb->s_maxbytes))
                        *count = inode->i_sb->s_maxbytes - *pos;
        } else {
+#ifdef CONFIG_BLOCK
                loff_t isize;
                if (bdev_read_only(I_BDEV(inode)))
                        return -EPERM;
@@ -2031,6 +2032,9 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
 
                if (*pos + *count > isize)
                        *count = isize - *pos;
+#else
+               return -EPERM;
+#endif
        }
        return 0;
 }