aboutsummaryrefslogtreecommitdiffstats
path: root/fs/coda/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/coda/dir.c')
-rw-r--r--fs/coda/dir.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index 56a3b76b91ca..01f55f447d82 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -391,28 +391,23 @@ int coda_rmdir(struct inode *dir, struct dentry *de)
391{ 391{
392 const char *name = de->d_name.name; 392 const char *name = de->d_name.name;
393 int len = de->d_name.len; 393 int len = de->d_name.len;
394 int error; 394 int error;
395 395
396 lock_kernel(); 396 lock_kernel();
397 coda_vfs_stat.rmdir++; 397 coda_vfs_stat.rmdir++;
398 398
399 if (!d_unhashed(de)) {
400 unlock_kernel();
401 return -EBUSY;
402 }
403 error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len); 399 error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len);
400 if (!error) {
401 /* VFS may delete the child */
402 if (de->d_inode)
403 de->d_inode->i_nlink = 0;
404 404
405 if ( error ) { 405 /* fix the link count of the parent */
406 unlock_kernel(); 406 coda_dir_drop_nlink(dir);
407 return error; 407 coda_dir_update_mtime(dir);
408 } 408 }
409
410 coda_dir_drop_nlink(dir);
411 coda_dir_update_mtime(dir);
412 drop_nlink(de->d_inode);
413 d_delete(de);
414 unlock_kernel(); 409 unlock_kernel();
415 return 0; 410 return error;
416} 411}
417 412
418/* rename */ 413/* rename */