diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2008-04-29 08:11:12 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-04-29 08:11:12 -0400 |
commit | e65187e6d0d541f992e684f88a7e090dcff1aac8 (patch) | |
tree | bf8af79f6f78596b8ca0f9affe94586f3a74f7eb | |
parent | 95c3889cb88ca4833096553c12cde9e7eb792f4c (diff) |
ext4: Enable extent format for symlinks.
This patch enables extent-formatted normal symlinks. Using extents
format allows a symlink to refer to a block number larger than 2^32
on large filesystems. We still don't enable extent format for fast
symlinks, which are contained in the inode itself.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | fs/ext4/ialloc.c | 4 | ||||
-rw-r--r-- | fs/ext4/namei.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 486e46a3918d..cb14646117f0 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -750,8 +750,8 @@ got: | |||
750 | goto fail_free_drop; | 750 | goto fail_free_drop; |
751 | } | 751 | } |
752 | if (test_opt(sb, EXTENTS)) { | 752 | if (test_opt(sb, EXTENTS)) { |
753 | /* set extent flag only for directory and file */ | 753 | /* set extent flag only for diretory, file and normal symlink*/ |
754 | if (S_ISDIR(mode) || S_ISREG(mode)) { | 754 | if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) { |
755 | EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL; | 755 | EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL; |
756 | ext4_ext_tree_init(handle, inode); | 756 | ext4_ext_tree_init(handle, inode); |
757 | err = ext4_update_incompat_feature(handle, sb, | 757 | err = ext4_update_incompat_feature(handle, sb, |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 28aa2ed4297e..68611945687d 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -2217,6 +2217,8 @@ retry: | |||
2217 | goto out_stop; | 2217 | goto out_stop; |
2218 | } | 2218 | } |
2219 | } else { | 2219 | } else { |
2220 | /* clear the extent format for fast symlink */ | ||
2221 | EXT4_I(inode)->i_flags &= ~EXT4_EXTENTS_FL; | ||
2220 | inode->i_op = &ext4_fast_symlink_inode_operations; | 2222 | inode->i_op = &ext4_fast_symlink_inode_operations; |
2221 | memcpy((char*)&EXT4_I(inode)->i_data,symname,l); | 2223 | memcpy((char*)&EXT4_I(inode)->i_data,symname,l); |
2222 | inode->i_size = l-1; | 2224 | inode->i_size = l-1; |