diff options
| -rw-r--r-- | Documentation/filesystems/ext4.txt | 9 | ||||
| -rw-r--r-- | fs/Kconfig | 4 | ||||
| -rw-r--r-- | fs/ext4/Kconfig | 15 | ||||
| -rw-r--r-- | fs/ext4/Makefile | 4 | ||||
| -rw-r--r-- | fs/ext4/acl.c | 6 | ||||
| -rw-r--r-- | fs/ext4/dir.c | 41 | ||||
| -rw-r--r-- | fs/ext4/ext4.h | 165 | ||||
| -rw-r--r-- | fs/ext4/ext4_extents.h | 40 | ||||
| -rw-r--r-- | fs/ext4/ext4_jbd2.h | 7 | ||||
| -rw-r--r-- | fs/ext4/extents.c | 480 | ||||
| -rw-r--r-- | fs/ext4/extents_status.c | 500 | ||||
| -rw-r--r-- | fs/ext4/extents_status.h | 45 | ||||
| -rw-r--r-- | fs/ext4/file.c | 336 | ||||
| -rw-r--r-- | fs/ext4/fsync.c | 6 | ||||
| -rw-r--r-- | fs/ext4/ialloc.c | 6 | ||||
| -rw-r--r-- | fs/ext4/indirect.c | 5 | ||||
| -rw-r--r-- | fs/ext4/inline.c | 1884 | ||||
| -rw-r--r-- | fs/ext4/inode.c | 629 | ||||
| -rw-r--r-- | fs/ext4/mballoc.c | 60 | ||||
| -rw-r--r-- | fs/ext4/migrate.c | 1 | ||||
| -rw-r--r-- | fs/ext4/move_extent.c | 1 | ||||
| -rw-r--r-- | fs/ext4/namei.c | 531 | ||||
| -rw-r--r-- | fs/ext4/page-io.c | 3 | ||||
| -rw-r--r-- | fs/ext4/resize.c | 17 | ||||
| -rw-r--r-- | fs/ext4/super.c | 57 | ||||
| -rw-r--r-- | fs/ext4/symlink.c | 4 | ||||
| -rw-r--r-- | fs/ext4/xattr.c | 110 | ||||
| -rw-r--r-- | fs/ext4/xattr.h | 158 | ||||
| -rw-r--r-- | fs/jbd2/journal.c | 1 | ||||
| -rw-r--r-- | fs/jbd2/transaction.c | 11 | ||||
| -rw-r--r-- | include/linux/jbd2.h | 9 | ||||
| -rw-r--r-- | include/trace/events/ext4.h | 136 |
32 files changed, 4175 insertions, 1106 deletions
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 104322bf378c..34ea4f1fa6ea 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
| @@ -200,12 +200,9 @@ inode_readahead_blks=n This tuning parameter controls the maximum | |||
| 200 | table readahead algorithm will pre-read into | 200 | table readahead algorithm will pre-read into |
| 201 | the buffer cache. The default value is 32 blocks. | 201 | the buffer cache. The default value is 32 blocks. |
| 202 | 202 | ||
| 203 | nouser_xattr Disables Extended User Attributes. If you have extended | 203 | nouser_xattr Disables Extended User Attributes. See the |
| 204 | attribute support enabled in the kernel configuration | 204 | attr(5) manual page and http://acl.bestbits.at/ |
| 205 | (CONFIG_EXT4_FS_XATTR), extended attribute support | 205 | for more information about extended attributes. |
| 206 | is enabled by default on mount. See the attr(5) manual | ||
| 207 | page and http://acl.bestbits.at/ for more information | ||
| 208 | about extended attributes. | ||
| 209 | 206 | ||
| 210 | noacl This option disables POSIX Access Control List | 207 | noacl This option disables POSIX Access Control List |
| 211 | support. If ACL support is enabled in the kernel | 208 | support. If ACL support is enabled in the kernel |
diff --git a/fs/Kconfig b/fs/Kconfig index f95ae3a027f3..eaff24a19502 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
| @@ -28,8 +28,8 @@ config FS_MBCACHE | |||
| 28 | tristate | 28 | tristate |
| 29 | default y if EXT2_FS=y && EXT2_FS_XATTR | 29 | default y if EXT2_FS=y && EXT2_FS_XATTR |
| 30 | default y if EXT3_FS=y && EXT3_FS_XATTR | 30 | default y if EXT3_FS=y && EXT3_FS_XATTR |
| 31 | default y if EXT4_FS=y && EXT4_FS_XATTR | 31 | default y if EXT4_FS=y |
| 32 | default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS_XATTR | 32 | default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS |
| 33 | 33 | ||
| 34 | source "fs/reiserfs/Kconfig" | 34 | source "fs/reiserfs/Kconfig" |
| 35 | source "fs/jfs/Kconfig" | 35 | source "fs/jfs/Kconfig" |
diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig index c22f17021b6e..0a475c881852 100644 --- a/fs/ext4/Kconfig +++ b/fs/ext4/Kconfig | |||
| @@ -39,22 +39,8 @@ config EXT4_USE_FOR_EXT23 | |||
| 39 | compiled kernel size by using one file system driver for | 39 | compiled kernel size by using one file system driver for |
| 40 | ext2, ext3, and ext4 file systems. | 40 | ext2, ext3, and ext4 file systems. |
| 41 | 41 | ||
| 42 | config EXT4_FS_XATTR | ||
| 43 | bool "Ext4 extended attributes" | ||
| 44 | depends on EXT4_FS | ||
| 45 | default y | ||
| 46 | help | ||
| 47 | Extended attributes are name:value pairs associated with inodes by | ||
| 48 | the kernel or by users (see the attr(5) manual page, or visit | ||
| 49 | <http://acl.bestbits.at/> for details). | ||
| 50 | |||
| 51 | If unsure, say N. | ||
| 52 | |||
| 53 | You need this for POSIX ACL support on ext4. | ||
| 54 | |||
| 55 | config EXT4_FS_POSIX_ACL | 42 | config EXT4_FS_POSIX_ACL |
| 56 | bool "Ext4 POSIX Access Control Lists" | 43 | bool "Ext4 POSIX Access Control Lists" |
| 57 | depends on EXT4_FS_XATTR | ||
| 58 | select FS_POSIX_ACL | 44 | select FS_POSIX_ACL |
| 59 | help | 45 | help |
| 60 | POSIX Access Control Lists (ACLs) support permissions for users and | 46 | POSIX Access Control Lists (ACLs) support permissions for users and |
| @@ -67,7 +53,6 @@ config EXT4_FS_POSIX_ACL | |||
| 67 | 53 | ||
| 68 | config EXT4_FS_SECURITY | 54 | config EXT4_FS_SECURITY |
| 69 | bool "Ext4 Security Labels" | 55 | bool "Ext4 Security Labels" |
| 70 | depends on EXT4_FS_XATTR | ||
| 71 | help | 56 | help |
| 72 | Security labels support alternative access control models | 57 | Security labels support alternative access control models |
| 73 | implemented by security modules like SELinux. This option | 58 | implemented by security modules like SELinux. This option |
diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile index 56fd8f865930..0310fec2ee3d 100644 --- a/fs/ext4/Makefile +++ b/fs/ext4/Makefile | |||
| @@ -7,8 +7,8 @@ obj-$(CONFIG_EXT4_FS) += ext4.o | |||
| 7 | ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o page-io.o \ | 7 | ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o page-io.o \ |
| 8 | ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \ | 8 | ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \ |
| 9 | ext4_jbd2.o migrate.o mballoc.o block_validity.o move_extent.o \ | 9 | ext4_jbd2.o migrate.o mballoc.o block_validity.o move_extent.o \ |
| 10 | mmp.o indirect.o | 10 | mmp.o indirect.o extents_status.o xattr.o xattr_user.o \ |
| 11 | xattr_trusted.o inline.o | ||
| 11 | 12 | ||
| 12 | ext4-$(CONFIG_EXT4_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o | ||
| 13 | ext4-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o | 13 | ext4-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o |
| 14 | ext4-$(CONFIG_EXT4_FS_SECURITY) += xattr_security.o | 14 | ext4-$(CONFIG_EXT4_FS_SECURITY) += xattr_security.o |
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c index d3c5b88fd89f..e6e0d988439b 100644 --- a/fs/ext4/acl.c +++ b/fs/ext4/acl.c | |||
| @@ -423,8 +423,10 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, | |||
| 423 | 423 | ||
| 424 | retry: | 424 | retry: |
| 425 | handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb)); | 425 | handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb)); |
| 426 | if (IS_ERR(handle)) | 426 | if (IS_ERR(handle)) { |
| 427 | return PTR_ERR(handle); | 427 | error = PTR_ERR(handle); |
| 428 | goto release_and_out; | ||
| 429 | } | ||
| 428 | error = ext4_set_acl(handle, inode, type, acl); | 430 | error = ext4_set_acl(handle, inode, type, acl); |
| 429 | ext4_journal_stop(handle); | 431 | ext4_journal_stop(handle); |
| 430 | if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) | 432 | if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) |
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 8e07d2a5a139..b8d877f6c1fa 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
| @@ -27,23 +27,11 @@ | |||
| 27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
| 28 | #include <linux/rbtree.h> | 28 | #include <linux/rbtree.h> |
| 29 | #include "ext4.h" | 29 | #include "ext4.h" |
| 30 | 30 | #include "xattr.h" | |
| 31 | static unsigned char ext4_filetype_table[] = { | ||
| 32 | DT_UNKNOWN, DT_REG, DT_DIR, DT_CHR, DT_BLK, DT_FIFO, DT_SOCK, DT_LNK | ||
| 33 | }; | ||
| 34 | 31 | ||
| 35 | static int ext4_dx_readdir(struct file *filp, | 32 | static int ext4_dx_readdir(struct file *filp, |
| 36 | void *dirent, filldir_t filldir); | 33 | void *dirent, filldir_t filldir); |
| 37 | 34 | ||
| 38 | static unsigned char get_dtype(struct super_block *sb, int filetype) | ||
| 39 | { | ||
| 40 | if (!EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FILETYPE) || | ||
| 41 | (filetype >= EXT4_FT_MAX)) | ||
| 42 | return DT_UNKNOWN; | ||
| 43 | |||
| 44 | return (ext4_filetype_table[filetype]); | ||
| 45 | } | ||
| 46 | |||
| 47 | /** | 35 | /** |
| 48 | * Check if the given dir-inode refers to an htree-indexed directory | 36 | * Check if the given dir-inode refers to an htree-indexed directory |
| 49 | * (or a directory which chould potentially get coverted to use htree | 37 | * (or a directory which chould potentially get coverted to use htree |
| @@ -68,11 +56,14 @@ static int is_dx_dir(struct inode *inode) | |||
| 68 | * Return 0 if the directory entry is OK, and 1 if there is a problem | 56 | * Return 0 if the directory entry is OK, and 1 if there is a problem |
| 69 | * | 57 | * |
| 70 | * Note: this is the opposite of what ext2 and ext3 historically returned... | 58 | * Note: this is the opposite of what ext2 and ext3 historically returned... |
| 59 | * | ||
| 60 | * bh passed here can be an inode block or a dir data block, depending | ||
| 61 | * on the inode inline data flag. | ||
| 71 | */ | 62 | */ |
| 72 | int __ext4_check_dir_entry(const char *function, unsigned int line, | 63 | int __ext4_check_dir_entry(const char *function, unsigned int line, |
| 73 | struct inode *dir, struct file *filp, | 64 | struct inode *dir, struct file *filp, |
| 74 | struct ext4_dir_entry_2 *de, | 65 | struct ext4_dir_entry_2 *de, |
| 75 | struct buffer_head *bh, | 66 | struct buffer_head *bh, char *buf, int size, |
| 76 | unsigned int offset) | 67 | unsigned int offset) |
| 77 | { | 68 | { |
| 78 | const char *error_m | ||
