aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/namei.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-02 14:41:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-02 14:41:01 -0400
commitd211858837ff8d8e31942ca7d27e6e08b3b46f5e (patch)
treea8ec83a791066e64ad02052498dbe39ebefacab9 /fs/udf/namei.c
parentf1f8935a5c38a2c61e86a42bc971a2539eef2211 (diff)
parentf0023bc617ba600956b9226f1806033d7486c8ba (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue: vfs: add d_prune dentry operation vfs: protect i_nlink filesystems: add set_nlink() filesystems: add missing nlink wrappers logfs: remove unnecessary nlink setting ocfs2: remove unnecessary nlink setting jfs: remove unnecessary nlink setting hypfs: remove unnecessary nlink setting vfs: ignore error on forced remount readlinkat: ensure we return ENOENT for the empty pathname for normal lookups vfs: fix dentry leak in simple_fill_super()
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r--fs/udf/namei.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 78d59ebd0656..4639e137222f 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -577,8 +577,7 @@ static int udf_create(struct inode *dir, struct dentry *dentry, int mode,
577 577
578 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); 578 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
579 if (!fi) { 579 if (!fi) {
580 inode->i_nlink--; 580 inode_dec_link_count(inode);
581 mark_inode_dirty(inode);
582 iput(inode); 581 iput(inode);
583 return err; 582 return err;
584 } 583 }
@@ -618,8 +617,7 @@ static int udf_mknod(struct inode *dir, struct dentry *dentry, int mode,
618 init_special_inode(inode, mode, rdev); 617 init_special_inode(inode, mode, rdev);
619 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); 618 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
620 if (!fi) { 619 if (!fi) {
621 inode->i_nlink--; 620 inode_dec_link_count(inode);
622 mark_inode_dirty(inode);
623 iput(inode); 621 iput(inode);
624 return err; 622 return err;
625 } 623 }
@@ -665,12 +663,11 @@ static int udf_mkdir(struct inode *dir, struct dentry *dentry, int mode)
665 inode->i_fop = &udf_dir_operations; 663 inode->i_fop = &udf_dir_operations;
666 fi = udf_add_entry(inode, NULL, &fibh, &cfi, &err); 664 fi = udf_add_entry(inode, NULL, &fibh, &cfi, &err);
667 if (!fi) { 665 if (!fi) {
668 inode->i_nlink--; 666 inode_dec_link_count(inode);
669 mark_inode_dirty(inode);
670 iput(inode); 667 iput(inode);
671 goto out; 668 goto out;
672 } 669 }
673 inode->i_nlink = 2; 670 set_nlink(inode, 2);
674 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); 671 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
675 cfi.icb.extLocation = cpu_to_lelb(dinfo->i_location); 672 cfi.icb.extLocation = cpu_to_lelb(dinfo->i_location);
676 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = 673 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
@@ -683,7 +680,7 @@ static int udf_mkdir(struct inode *dir, struct dentry *dentry, int mode)
683 680
684 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); 681 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
685 if (!fi) { 682 if (!fi) {
686 inode->i_nlink = 0; 683 clear_nlink(inode);
687 mark_inode_dirty(inode); 684 mark_inode_dirty(inode);
688 iput(inode); 685 iput(inode);
689 goto out; 686 goto out;
@@ -839,7 +836,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry)
839 if (!inode->i_nlink) { 836 if (!inode->i_nlink) {
840 udf_debug("Deleting nonexistent file (%lu), %d\n", 837 udf_debug("Deleting nonexistent file (%lu), %d\n",
841 inode->i_ino, inode->i_nlink); 838 inode->i_ino, inode->i_nlink);
842 inode->i_nlink = 1; 839 set_nlink(inode, 1);
843 } 840 }
844 retval = udf_delete_entry(dir, fi, &fibh, &cfi); 841 retval = udf_delete_entry(dir, fi, &fibh, &cfi);
845 if (retval) 842 if (retval)