diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-07-09 20:02:50 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-07-09 17:15:10 -0400 |
commit | 3bbeeb3c93a961bd01b969dd4395ecac0c09db8d (patch) | |
tree | 57f003be4cb7a78094a3806df463844371329a85 /fs/cifs/inode.c | |
parent | 654cf14ac0a71c56c1f0032140c3403382ca076b (diff) |
cifs: add and use CIFSSMBUnixSetFileInfo for setattr calls
cifs: add and use CIFSSMBUnixSetFileInfo for setattr calls
When there's an open filehandle, SET_FILE_INFO is apparently preferred
over SET_PATH_INFO. Add a new variant that sets a FILE_UNIX_INFO_BASIC
infolevel via SET_FILE_INFO and switch cifs_setattr_unix to use the
new call when there's an open filehandle available.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ad19007ea05f..55b616bb381e 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1790,6 +1790,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) | |||
1790 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 1790 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
1791 | struct cifsTconInfo *pTcon = cifs_sb->tcon; | 1791 | struct cifsTconInfo *pTcon = cifs_sb->tcon; |
1792 | struct cifs_unix_set_info_args *args = NULL; | 1792 | struct cifs_unix_set_info_args *args = NULL; |
1793 | struct cifsFileInfo *open_file; | ||
1793 | 1794 | ||
1794 | cFYI(1, ("setattr_unix on file %s attrs->ia_valid=0x%x", | 1795 | cFYI(1, ("setattr_unix on file %s attrs->ia_valid=0x%x", |
1795 | direntry->d_name.name, attrs->ia_valid)); | 1796 | direntry->d_name.name, attrs->ia_valid)); |
@@ -1876,10 +1877,18 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) | |||
1876 | args->ctime = NO_CHANGE_64; | 1877 | args->ctime = NO_CHANGE_64; |
1877 | 1878 | ||
1878 | args->device = 0; | 1879 | args->device = 0; |
1879 | rc = CIFSSMBUnixSetPathInfo(xid, pTcon, full_path, args, | 1880 | open_file = find_writable_file(cifsInode); |
1881 | if (open_file) { | ||
1882 | u16 nfid = open_file->netfid; | ||
1883 | u32 npid = open_file->pid; | ||
1884 | rc = CIFSSMBUnixSetFileInfo(xid, pTcon, args, nfid, npid); | ||
1885 | atomic_dec(&open_file->wrtPending); | ||
1886 | } else { | ||
1887 | rc = CIFSSMBUnixSetPathInfo(xid, pTcon, full_path, args, | ||
1880 | cifs_sb->local_nls, | 1888 | cifs_sb->local_nls, |
1881 | cifs_sb->mnt_cifs_flags & | 1889 | cifs_sb->mnt_cifs_flags & |
1882 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 1890 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
1891 | } | ||
1883 | 1892 | ||
1884 | if (!rc) | 1893 | if (!rc) |
1885 | rc = inode_setattr(inode, attrs); | 1894 | rc = inode_setattr(inode, attrs); |