aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inline.c
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2012-12-10 14:06:01 -0500
committerTheodore Ts'o <tytso@mit.edu>2012-12-10 14:06:01 -0500
commit32f7f22c0b52e8189fef83986b16dc7abe95f2c4 (patch)
treec11441065aa244746f17bf0efd322fe6dd06c04c /fs/ext4/inline.c
parent61f86638d8a656101bb0f9c41c55d9685f8a2357 (diff)
downloadkernel_goldelico_gta04-32f7f22c0b52e8189fef83986b16dc7abe95f2c4.zip
kernel_goldelico_gta04-32f7f22c0b52e8189fef83986b16dc7abe95f2c4.tar.gz
kernel_goldelico_gta04-32f7f22c0b52e8189fef83986b16dc7abe95f2c4.tar.bz2
ext4: let ext4_rename handle inline dir
In case we rename a directory, ext4_rename has to read the dir block and change its dotdot's information. The old ext4_rename encapsulated the dir_block read into itself. So this patch adds a new function ext4_get_first_dir_block() which gets the dir buffer information so the ext4_rename can handle it properly. As it will also change the parent inode number, we return the parent_de so that ext4_rename() can handle it more easily. ext4_find_entry is also changed so that the caller(rename) can tell whether the found entry is an inlined one or not and journaling the corresponding buffer head. Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inline.c')
-rw-r--r--fs/ext4/inline.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index e5da458..fc36299 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -1424,6 +1424,21 @@ out:
return ret;
}
+struct buffer_head *ext4_get_first_inline_block(struct inode *inode,
+ struct ext4_dir_entry_2 **parent_de,
+ int *retval)
+{
+ struct ext4_iloc iloc;
+
+ *retval = ext4_get_inode_loc(inode, &iloc);
+ if (*retval)
+ return NULL;
+
+ *parent_de = (struct ext4_dir_entry_2 *)ext4_raw_inode(&iloc)->i_block;
+
+ return iloc.bh;
+}
+
/*
* Try to create the inline data for the new dir.
* If it succeeds, return 0, otherwise return the error.