diff options
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index e781b7ea5630..67fd0b025858 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "xattr.h" | 40 | #include "xattr.h" |
41 | #include "acl.h" | 41 | #include "acl.h" |
42 | 42 | ||
43 | #include <trace/events/ext4.h> | ||
43 | /* | 44 | /* |
44 | * define how far ahead to read directories while searching them. | 45 | * define how far ahead to read directories while searching them. |
45 | */ | 46 | */ |
@@ -2183,6 +2184,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry) | |||
2183 | struct ext4_dir_entry_2 *de; | 2184 | struct ext4_dir_entry_2 *de; |
2184 | handle_t *handle; | 2185 | handle_t *handle; |
2185 | 2186 | ||
2187 | trace_ext4_unlink_enter(dir, dentry); | ||
2186 | /* Initialize quotas before so that eventual writes go | 2188 | /* Initialize quotas before so that eventual writes go |
2187 | * in separate transaction */ | 2189 | * in separate transaction */ |
2188 | dquot_initialize(dir); | 2190 | dquot_initialize(dir); |
@@ -2228,6 +2230,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry) | |||
2228 | end_unlink: | 2230 | end_unlink: |
2229 | ext4_journal_stop(handle); | 2231 | ext4_journal_stop(handle); |
2230 | brelse(bh); | 2232 | brelse(bh); |
2233 | trace_ext4_unlink_exit(dentry, retval); | ||
2231 | return retval; | 2234 | return retval; |
2232 | } | 2235 | } |
2233 | 2236 | ||
@@ -2402,6 +2405,10 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2402 | if (!new_inode && new_dir != old_dir && | 2405 | if (!new_inode && new_dir != old_dir && |
2403 | EXT4_DIR_LINK_MAX(new_dir)) | 2406 | EXT4_DIR_LINK_MAX(new_dir)) |
2404 | goto end_rename; | 2407 | goto end_rename; |
2408 | BUFFER_TRACE(dir_bh, "get_write_access"); | ||
2409 | retval = ext4_journal_get_write_access(handle, dir_bh); | ||
2410 | if (retval) | ||
2411 | goto end_rename; | ||
2405 | } | 2412 | } |
2406 | if (!new_bh) { | 2413 | if (!new_bh) { |
2407 | retval = ext4_add_entry(handle, new_dentry, old_inode); | 2414 | retval = ext4_add_entry(handle, new_dentry, old_inode); |
@@ -2409,7 +2416,9 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2409 | goto end_rename; | 2416 | goto end_rename; |
2410 | } else { | 2417 | } else { |
2411 | BUFFER_TRACE(new_bh, "get write access"); | 2418 | BUFFER_TRACE(new_bh, "get write access"); |
2412 | ext4_journal_get_write_access(handle, new_bh); | 2419 | retval = ext4_journal_get_write_access(handle, new_bh); |
2420 | if (retval) | ||
2421 | goto end_rename; | ||
2413 | new_de->inode = cpu_to_le32(old_inode->i_ino); | 2422 | new_de->inode = cpu_to_le32(old_inode->i_ino); |
2414 | if (EXT4_HAS_INCOMPAT_FEATURE(new_dir->i_sb, | 2423 | if (EXT4_HAS_INCOMPAT_FEATURE(new_dir->i_sb, |
2415 | EXT4_FEATURE_INCOMPAT_FILETYPE)) | 2424 | EXT4_FEATURE_INCOMPAT_FILETYPE)) |
@@ -2470,8 +2479,6 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2470 | old_dir->i_ctime = old_dir->i_mtime = ext4_current_time(old_dir); | 2479 | old_dir->i_ctime = old_dir->i_mtime = ext4_current_time(old_dir); |
2471 | ext4_update_dx_flag(old_dir); | 2480 | ext4_update_dx_flag(old_dir); |
2472 | if (dir_bh) { | 2481 | if (dir_bh) { |
2473 | BUFFER_TRACE(dir_bh, "get_write_access"); | ||
2474 | ext4_journal_get_write_access(handle, dir_bh); | ||
2475 | PARENT_INO(dir_bh->b_data, new_dir->i_sb->s_blocksize) = | 2482 | PARENT_INO(dir_bh->b_data, new_dir->i_sb->s_blocksize) = |
2476 | cpu_to_le32(new_dir->i_ino); | 2483 | cpu_to_le32(new_dir->i_ino); |
2477 | BUFFER_TRACE(dir_bh, "call ext4_handle_dirty_metadata"); | 2484 | BUFFER_TRACE(dir_bh, "call ext4_handle_dirty_metadata"); |