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/super.c | |
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/super.c')
-rw-r--r-- | fs/ubifs/super.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index cf1fb6cffa09..6cc4175f23c1 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -341,13 +341,15 @@ static void ubifs_delete_inode(struct inode *inode) | |||
341 | goto out; | 341 | goto out; |
342 | 342 | ||
343 | ui->ui_size = inode->i_size = 0; | 343 | ui->ui_size = inode->i_size = 0; |
344 | err = ubifs_jnl_write_inode(c, inode); | 344 | err = ubifs_jnl_delete_inode(c, inode); |
345 | if (err) | 345 | if (err) |
346 | /* | 346 | /* |
347 | * Worst case we have a lost orphan inode wasting space, so a | 347 | * Worst case we have a lost orphan inode wasting space, so a |
348 | * simple error message is ok here. | 348 | * simple error message is ok here. |
349 | */ | 349 | */ |
350 | ubifs_err("can't write inode %lu, error %d", inode->i_ino, err); | 350 | ubifs_err("can't delete inode %lu, error %d", |
351 | inode->i_ino, err); | ||
352 | |||
351 | out: | 353 | out: |
352 | if (ui->dirty) | 354 | if (ui->dirty) |
353 | ubifs_release_dirty_inode_budget(c, ui); | 355 | ubifs_release_dirty_inode_budget(c, ui); |