diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-07-22 06:06:20 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-08-13 04:28:44 -0400 |
commit | de94eb558b542873d3f6f9ede1b8575fb5662248 (patch) | |
tree | 3ba858a1c87870e22886ac3d4774287bbf367131 /fs/ubifs/ubifs.h | |
parent | 014eb04b03202dc75c1c749df4246d98045f5e69 (diff) |
UBIFS: optimize deletions
Every time anything is deleted, UBIFS writes the deletion inode
node twice - once in 'ubifs_jnl_update()' and the second time in
'ubifs_jnl_write_inode()'. However, the second write is not needed
if no commit happened after 'ubifs_jnl_update()'. This patch
checks that condition and avoids writing the deletion inode for
the second time.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r-- | fs/ubifs/ubifs.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 21502b6040f0..dfb4b93614ff 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -322,6 +322,8 @@ struct ubifs_gced_idx_leb { | |||
322 | * struct ubifs_inode - UBIFS in-memory inode description. | 322 | * struct ubifs_inode - UBIFS in-memory inode description. |
323 | * @vfs_inode: VFS inode description object | 323 | * @vfs_inode: VFS inode description object |
324 | * @creat_sqnum: sequence number at time of creation | 324 | * @creat_sqnum: sequence number at time of creation |
325 | * @del_cmtno: commit number corresponding to the time the inode was deleted, | ||
326 | * protected by @c->commit_sem; | ||
325 | * @xattr_size: summarized size of all extended attributes in bytes | 327 | * @xattr_size: summarized size of all extended attributes in bytes |
326 | * @xattr_cnt: count of extended attributes this inode has | 328 | * @xattr_cnt: count of extended attributes this inode has |
327 | * @xattr_names: sum of lengths of all extended attribute names belonging to | 329 | * @xattr_names: sum of lengths of all extended attribute names belonging to |
@@ -372,7 +374,10 @@ struct ubifs_gced_idx_leb { | |||
372 | */ | 374 | */ |
373 | struct ubifs_inode { | 375 | struct ubifs_inode { |
374 | struct inode vfs_inode; | 376 | struct inode vfs_inode; |
375 | unsigned long long creat_sqnum; | 377 | union { |
378 | unsigned long long creat_sqnum; | ||
379 | unsigned long long del_cmtno; | ||
380 | }; | ||
376 | unsigned int xattr_size; | 381 | unsigned int xattr_size; |
377 | unsigned int xattr_cnt; | 382 | unsigned int xattr_cnt; |
378 | unsigned int xattr_names; | 383 | unsigned int xattr_names; |
@@ -779,7 +784,7 @@ struct ubifs_compressor { | |||
779 | /** | 784 | /** |
780 | * struct ubifs_budget_req - budget requirements of an operation. | 785 | * struct ubifs_budget_req - budget requirements of an operation. |
781 | * | 786 | * |
782 | * @fast: non-zero if the budgeting should try to aquire budget quickly and | 787 | * @fast: non-zero if the budgeting should try to acquire budget quickly and |
783 | * should not try to call write-back | 788 | * should not try to call write-back |
784 | * @recalculate: non-zero if @idx_growth, @data_growth, and @dd_growth fields | 789 | * @recalculate: non-zero if @idx_growth, @data_growth, and @dd_growth fields |
785 | * have to be re-calculated | 790 | * have to be re-calculated |
@@ -860,7 +865,7 @@ struct ubifs_mount_opts { | |||
860 | * struct ubifs_info - UBIFS file-system description data structure | 865 | * struct ubifs_info - UBIFS file-system description data structure |
861 | * (per-superblock). | 866 | * (per-superblock). |
862 | * @vfs_sb: VFS @struct super_block object | 867 | * @vfs_sb: VFS @struct super_block object |
863 | * @bdi: backing device info object to make VFS happy and disable readahead | 868 | * @bdi: backing device info object to make VFS happy and disable read-ahead |
864 | * | 869 | * |
865 | * @highest_inum: highest used inode number | 870 | * @highest_inum: highest used inode number |
866 | * @vfs_gen: VFS inode generation counter | 871 | * @vfs_gen: VFS inode generation counter |
@@ -1402,6 +1407,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir, | |||
1402 | int ubifs_jnl_write_data(struct ubifs_info *c, const struct inode *inode, | 1407 | int ubifs_jnl_write_data(struct ubifs_info *c, const struct inode *inode, |
1403 | const union ubifs_key *key, const void *buf, int len); | 1408 | const union ubifs_key *key, const void *buf, int len); |
1404 | int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode); | 1409 | int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode); |
1410 | int ubifs_jnl_delete_inode(struct ubifs_info *c, const struct inode *inode); | ||
1405 | int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir, | 1411 | int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir, |
1406 | const struct dentry *old_dentry, | 1412 | const struct dentry *old_dentry, |
1407 | const struct inode *new_dir, | 1413 | const struct inode *new_dir, |