aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/dir.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-04-19 12:17:29 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 12:17:29 -0400
commitadf6d34e460387ee3e8f1e1875d52bff51212c7d (patch)
tree88ef100143e6184103a608f82dfd232bf6376eaf /fs/hfsplus/dir.c
parentd1964dab60ce7c104dd21590e987a8787db18051 (diff)
parent3760d31f11bfbd0ead9eaeb8573e0602437a9d7c (diff)
Merge branch 'omap2-upstream' into devel
Diffstat (limited to 'fs/hfsplus/dir.c')
-rw-r--r--fs/hfsplus/dir.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index 29683645fa0a..5f4023678251 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -340,16 +340,23 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)
340 340
341 if (inode->i_nlink > 0) 341 if (inode->i_nlink > 0)
342 drop_nlink(inode); 342 drop_nlink(inode);
343 hfsplus_delete_inode(inode); 343 if (inode->i_ino == cnid)
344 if (inode->i_ino != cnid && !inode->i_nlink) { 344 clear_nlink(inode);
345 if (!atomic_read(&HFSPLUS_I(inode).opencnt)) { 345 if (!inode->i_nlink) {
346 res = hfsplus_delete_cat(inode->i_ino, HFSPLUS_SB(sb).hidden_dir, NULL); 346 if (inode->i_ino != cnid) {
347 if (!res) 347 HFSPLUS_SB(sb).file_count--;
348 hfsplus_delete_inode(inode); 348 if (!atomic_read(&HFSPLUS_I(inode).opencnt)) {
349 res = hfsplus_delete_cat(inode->i_ino,
350 HFSPLUS_SB(sb).hidden_dir,
351 NULL);
352 if (!res)
353 hfsplus_delete_inode(inode);
354 } else
355 inode->i_flags |= S_DEAD;
349 } else 356 } else
350 inode->i_flags |= S_DEAD; 357 hfsplus_delete_inode(inode);
351 } else 358 } else
352 clear_nlink(inode); 359 HFSPLUS_SB(sb).file_count--;
353 inode->i_ctime = CURRENT_TIME_SEC; 360 inode->i_ctime = CURRENT_TIME_SEC;
354 mark_inode_dirty(inode); 361 mark_inode_dirty(inode);
355 362