diff options
author | Steve French <sfrench@us.ibm.com> | 2007-07-14 21:48:57 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-07-14 21:48:57 -0400 |
commit | 2d785a50a8aa404c19f56d2c22445e48e418112b (patch) | |
tree | 260f7a1bf95126a8681d170e15337ff0ffad7e17 /fs/cifs/inode.c | |
parent | 50c2f75388727018c3c357454a247072915a9e3f (diff) |
[CIFS] Add support for new POSIX unlink
In the cleanup phase of the dbench test, we were noticing sharing
violation followed by failed directory removals when dbench
did not close the test files before the cleanup phase started.
Using the new POSIX unlink, which Samba has supported for a few
months, avoids this.
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index a1ca55650505..cfa5b360d12e 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -620,9 +620,21 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
620 | FreeXid(xid); | 620 | FreeXid(xid); |
621 | return -ENOMEM; | 621 | return -ENOMEM; |
622 | } | 622 | } |
623 | rc = CIFSSMBDelFile(xid, pTcon, full_path, cifs_sb->local_nls, | 623 | |
624 | if ((pTcon->ses->capabilities & CAP_UNIX) && | ||
625 | (CIFS_UNIX_POSIX_PATH_OPS_CAP & | ||
626 | le64_to_cpu(pTcon->fsUnixInfo.Capability))) { | ||
627 | rc = CIFSPOSIXDelFile(xid, pTcon, full_path, | ||
628 | SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, | ||
624 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 629 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
630 | cFYI(1, ("posix del rc %d", rc)); | ||
631 | if ((rc == 0) || (rc == -ENOENT)) | ||
632 | goto psx_del_no_retry; | ||
633 | } | ||
625 | 634 | ||
635 | rc = CIFSSMBDelFile(xid, pTcon, full_path, cifs_sb->local_nls, | ||
636 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
637 | psx_del_no_retry: | ||
626 | if (!rc) { | 638 | if (!rc) { |
627 | if (direntry->d_inode) | 639 | if (direntry->d_inode) |
628 | drop_nlink(direntry->d_inode); | 640 | drop_nlink(direntry->d_inode); |