diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index b88147c1dc27..6b90ef98e4cf 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -19,7 +19,6 @@ | |||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
22 | #include <linux/buffer_head.h> | ||
23 | #include <linux/stat.h> | 22 | #include <linux/stat.h> |
24 | #include <linux/pagemap.h> | 23 | #include <linux/pagemap.h> |
25 | #include <asm/div64.h> | 24 | #include <asm/div64.h> |
@@ -591,7 +590,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
591 | 590 | ||
592 | if (!rc) { | 591 | if (!rc) { |
593 | if (direntry->d_inode) | 592 | if (direntry->d_inode) |
594 | direntry->d_inode->i_nlink--; | 593 | drop_nlink(direntry->d_inode); |
595 | } else if (rc == -ENOENT) { | 594 | } else if (rc == -ENOENT) { |
596 | d_drop(direntry); | 595 | d_drop(direntry); |
597 | } else if (rc == -ETXTBSY) { | 596 | } else if (rc == -ETXTBSY) { |
@@ -610,7 +609,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
610 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 609 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
611 | CIFSSMBClose(xid, pTcon, netfid); | 610 | CIFSSMBClose(xid, pTcon, netfid); |
612 | if (direntry->d_inode) | 611 | if (direntry->d_inode) |
613 | direntry->d_inode->i_nlink--; | 612 | drop_nlink(direntry->d_inode); |
614 | } | 613 | } |
615 | } else if (rc == -EACCES) { | 614 | } else if (rc == -EACCES) { |
616 | /* try only if r/o attribute set in local lookup data? */ | 615 | /* try only if r/o attribute set in local lookup data? */ |
@@ -664,7 +663,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
664 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 663 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
665 | if (!rc) { | 664 | if (!rc) { |
666 | if (direntry->d_inode) | 665 | if (direntry->d_inode) |
667 | direntry->d_inode->i_nlink--; | 666 | drop_nlink(direntry->d_inode); |
668 | } else if (rc == -ETXTBSY) { | 667 | } else if (rc == -ETXTBSY) { |
669 | int oplock = FALSE; | 668 | int oplock = FALSE; |
670 | __u16 netfid; | 669 | __u16 netfid; |
@@ -685,7 +684,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
685 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 684 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
686 | CIFSSMBClose(xid, pTcon, netfid); | 685 | CIFSSMBClose(xid, pTcon, netfid); |
687 | if (direntry->d_inode) | 686 | if (direntry->d_inode) |
688 | direntry->d_inode->i_nlink--; | 687 | drop_nlink(direntry->d_inode); |
689 | } | 688 | } |
690 | /* BB if rc = -ETXTBUSY goto the rename logic BB */ | 689 | /* BB if rc = -ETXTBUSY goto the rename logic BB */ |
691 | } | 690 | } |
@@ -736,7 +735,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
736 | cFYI(1, ("cifs_mkdir returned 0x%x", rc)); | 735 | cFYI(1, ("cifs_mkdir returned 0x%x", rc)); |
737 | d_drop(direntry); | 736 | d_drop(direntry); |
738 | } else { | 737 | } else { |
739 | inode->i_nlink++; | 738 | inc_nlink(inode); |
740 | if (pTcon->ses->capabilities & CAP_UNIX) | 739 | if (pTcon->ses->capabilities & CAP_UNIX) |
741 | rc = cifs_get_inode_info_unix(&newinode, full_path, | 740 | rc = cifs_get_inode_info_unix(&newinode, full_path, |
742 | inode->i_sb,xid); | 741 | inode->i_sb,xid); |
@@ -817,9 +816,9 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) | |||
817 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 816 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
818 | 817 | ||
819 | if (!rc) { | 818 | if (!rc) { |
820 | inode->i_nlink--; | 819 | drop_nlink(inode); |
821 | i_size_write(direntry->d_inode,0); | 820 | i_size_write(direntry->d_inode,0); |
822 | direntry->d_inode->i_nlink = 0; | 821 | clear_nlink(direntry->d_inode); |
823 | } | 822 | } |
824 | 823 | ||
825 | cifsInode = CIFS_I(direntry->d_inode); | 824 | cifsInode = CIFS_I(direntry->d_inode); |