diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-18 20:14:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-07-06 17:39:50 -0400 |
commit | cc7231e30916f5326bdde55a7a4c59431e15bc1b (patch) | |
tree | ae1d56214218cb5b8b5a5491cf9c2dcb4ec66c3c /fs/ufs | |
parent | b6eede0ec642d1be17065110718cb4f4ed7ba5e0 (diff) |
free_full_branch(): don't bother modifying the block we are going to free
Note that it's already made unreachable from the inode, so we don't have
to worry about ufs_frag_map() walking into something already freed.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/inode.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 26835a80f7dd..424949f459c8 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -1081,13 +1081,8 @@ static void free_full_branch(struct inode *inode, u64 ind_block, int depth) | |||
1081 | for (i = 0; i < uspi->s_apb; i++) { | 1081 | for (i = 0; i < uspi->s_apb; i++) { |
1082 | void *p = ubh_get_data_ptr(uspi, ubh, i); | 1082 | void *p = ubh_get_data_ptr(uspi, ubh, i); |
1083 | u64 block = ufs_data_ptr_to_cpu(sb, p); | 1083 | u64 block = ufs_data_ptr_to_cpu(sb, p); |
1084 | if (block) { | 1084 | if (block) |
1085 | write_seqlock(&UFS_I(inode)->meta_lock); | ||
1086 | ufs_data_ptr_clear(uspi, p); | ||
1087 | write_sequnlock(&UFS_I(inode)->meta_lock); | ||
1088 | free_full_branch(inode, block, depth); | 1085 | free_full_branch(inode, block, depth); |
1089 | ubh_mark_buffer_dirty(ubh); | ||
1090 | } | ||
1091 | } | 1086 | } |
1092 | } else { | 1087 | } else { |
1093 | struct to_free ctx = {.inode = inode}; | 1088 | struct to_free ctx = {.inode = inode}; |
@@ -1095,13 +1090,8 @@ static void free_full_branch(struct inode *inode, u64 ind_block, int depth) | |||
1095 | for (i = 0; i < uspi->s_apb; i++) { | 1090 | for (i = 0; i < uspi->s_apb; i++) { |
1096 | void *p = ubh_get_data_ptr(uspi, ubh, i); | 1091 | void *p = ubh_get_data_ptr(uspi, ubh, i); |
1097 | u64 block = ufs_data_ptr_to_cpu(sb, p); | 1092 | u64 block = ufs_data_ptr_to_cpu(sb, p); |
1098 | if (block) { | 1093 | if (block) |
1099 | write_seqlock(&UFS_I(inode)->meta_lock); | ||
1100 | ufs_data_ptr_clear(uspi, p); | ||
1101 | write_sequnlock(&UFS_I(inode)->meta_lock); | ||
1102 | ubh_mark_buffer_dirty(ubh); | ||
1103 | free_data(&ctx, block, uspi->s_fpb); | 1094 | free_data(&ctx, block, uspi->s_fpb); |
1104 | } | ||
1105 | } | 1095 | } |
1106 | free_data(&ctx, 0, 0); | 1096 | free_data(&ctx, 0, 0); |
1107 | } | 1097 | } |