diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-16 20:33:01 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-16 20:33:01 -0500 |
| commit | 36cd5c19c3fe8291fac45a262c44c00bd14b531a (patch) | |
| tree | 77813e551c82546c9f6cddc8a3216ba5d02807ed | |
| parent | 2a74dbb9a86e8102dcd07d284135b4530a84826e (diff) | |
| parent | bd9926e80330d43f15b710c2935fa41b792d56fd (diff) | |
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 update from Ted Ts'o:
"There are two major features for this merge window. The first is
inline data, which allows small files or directories to be stored in
the in-inode extended attribute area. (This requires that the file
system use inodes which are at least 256 bytes or larger; 128 byte
inodes do not have any room for in-inode xattrs.)
The second new feature is SEEK_HOLE/SEEK_DATA support. This is
enabled by the extent status tree patches, and this infrastructure
will be used to further optimize ext4 in the future.
Beyond that, we have the usual collection of code cleanups and bug
fixes."
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (63 commits)
ext4: zero out inline data using memset() instead of empty_zero_page
ext4: ensure Inode flags consistency are checked at build time
ext4: Remove CONFIG_EXT4_FS_XATTR
ext4: remove unused variable from ext4_ext_in_cache()
ext4: remove redundant initialization in ext4_fill_super()
ext4: remove redundant code in ext4_alloc_inode()
ext4: use sync_inode_metadata() when syncing inode metadata
ext4: enable ext4 inline support
ext4: let fallocate handle inline data correctly
ext4: let ext4_truncate handle inline data correctly
ext4: evict inline data out if we need to strore xattr in inode
ext4: let fiemap work with inline data
ext4: let ext4_rename handle inline dir
ext4: let empty_dir handle inline dir
ext4: let ext4_delete_entry() handle inline data
ext4: make ext4_delete_entry generic
ext4: let ext4_find_entry handle inline data
ext4: create a new function search_dir
ext4: let ext4_readdir handle inline data
ext4: let add_dir_entry handle inline data properly
...
| -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 ca | ||
