diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index d8ae20f1a47a..a1ca55650505 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -92,7 +92,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
92 | } /* note ino incremented to unique num in new_inode */ | 92 | } /* note ino incremented to unique num in new_inode */ |
93 | if (sb->s_flags & MS_NOATIME) | 93 | if (sb->s_flags & MS_NOATIME) |
94 | (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME; | 94 | (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME; |
95 | 95 | ||
96 | insert_inode_hash(*pinode); | 96 | insert_inode_hash(*pinode); |
97 | } | 97 | } |
98 | 98 | ||
@@ -139,7 +139,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
139 | inode->i_mode |= S_IFREG; | 139 | inode->i_mode |= S_IFREG; |
140 | cFYI(1, ("unknown type %d", type)); | 140 | cFYI(1, ("unknown type %d", type)); |
141 | } | 141 | } |
142 | 142 | ||
143 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) | 143 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) |
144 | inode->i_uid = cifs_sb->mnt_uid; | 144 | inode->i_uid = cifs_sb->mnt_uid; |
145 | else | 145 | else |
@@ -149,7 +149,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
149 | inode->i_gid = cifs_sb->mnt_gid; | 149 | inode->i_gid = cifs_sb->mnt_gid; |
150 | else | 150 | else |
151 | inode->i_gid = le64_to_cpu(findData.Gid); | 151 | inode->i_gid = le64_to_cpu(findData.Gid); |
152 | 152 | ||
153 | inode->i_nlink = le64_to_cpu(findData.Nlinks); | 153 | inode->i_nlink = le64_to_cpu(findData.Nlinks); |
154 | 154 | ||
155 | spin_lock(&inode->i_lock); | 155 | spin_lock(&inode->i_lock); |
@@ -235,7 +235,7 @@ static int decode_sfu_inode(struct inode *inode, __u64 size, | |||
235 | } else if (size < 8) { | 235 | } else if (size < 8) { |
236 | return -EINVAL; /* EOPNOTSUPP? */ | 236 | return -EINVAL; /* EOPNOTSUPP? */ |
237 | } | 237 | } |
238 | 238 | ||
239 | rc = CIFSSMBOpen(xid, pTcon, path, FILE_OPEN, GENERIC_READ, | 239 | rc = CIFSSMBOpen(xid, pTcon, path, FILE_OPEN, GENERIC_READ, |
240 | CREATE_NOT_DIR, &netfid, &oplock, NULL, | 240 | CREATE_NOT_DIR, &netfid, &oplock, NULL, |
241 | cifs_sb->local_nls, | 241 | cifs_sb->local_nls, |
@@ -285,7 +285,6 @@ static int decode_sfu_inode(struct inode *inode, __u64 size, | |||
285 | CIFSSMBClose(xid, pTcon, netfid); | 285 | CIFSSMBClose(xid, pTcon, netfid); |
286 | } | 286 | } |
287 | return rc; | 287 | return rc; |
288 | |||
289 | } | 288 | } |
290 | 289 | ||
291 | #define SFBITS_MASK (S_ISVTX | S_ISGID | S_ISUID) /* SETFILEBITS valid bits */ | 290 | #define SFBITS_MASK (S_ISVTX | S_ISGID | S_ISUID) /* SETFILEBITS valid bits */ |
@@ -317,8 +316,6 @@ static int get_sfu_uid_mode(struct inode *inode, | |||
317 | #else | 316 | #else |
318 | return -EOPNOTSUPP; | 317 | return -EOPNOTSUPP; |
319 | #endif | 318 | #endif |
320 | |||
321 | |||
322 | } | 319 | } |
323 | 320 | ||
324 | int cifs_get_inode_info(struct inode **pinode, | 321 | int cifs_get_inode_info(struct inode **pinode, |
@@ -364,7 +361,6 @@ int cifs_get_inode_info(struct inode **pinode, | |||
364 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 361 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
365 | adjustTZ = TRUE; | 362 | adjustTZ = TRUE; |
366 | } | 363 | } |
367 | |||
368 | } | 364 | } |
369 | /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */ | 365 | /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */ |
370 | if (rc) { | 366 | if (rc) { |
@@ -513,7 +509,7 @@ int cifs_get_inode_info(struct inode **pinode, | |||
513 | /* BB add code here - | 509 | /* BB add code here - |
514 | validate if device or weird share or device type? */ | 510 | validate if device or weird share or device type? */ |
515 | } | 511 | } |
516 | 512 | ||
517 | spin_lock(&inode->i_lock); | 513 | spin_lock(&inode->i_lock); |
518 | if (is_size_safe_to_change(cifsInfo, le64_to_cpu(pfindData->EndOfFile))) { | 514 | if (is_size_safe_to_change(cifsInfo, le64_to_cpu(pfindData->EndOfFile))) { |
519 | /* can not safely shrink the file size here if the | 515 | /* can not safely shrink the file size here if the |
@@ -836,7 +832,7 @@ static void posix_fill_in_inode(struct inode *tmp_inode, | |||
836 | tmp_inode->i_fop = &cifs_file_direct_nobrl_ops; | 832 | tmp_inode->i_fop = &cifs_file_direct_nobrl_ops; |
837 | else | 833 | else |
838 | tmp_inode->i_fop = &cifs_file_direct_ops; | 834 | tmp_inode->i_fop = &cifs_file_direct_ops; |
839 | 835 | ||
840 | } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) | 836 | } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) |
841 | tmp_inode->i_fop = &cifs_file_nobrl_ops; | 837 | tmp_inode->i_fop = &cifs_file_nobrl_ops; |
842 | else | 838 | else |
@@ -898,7 +894,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
898 | FreeXid(xid); | 894 | FreeXid(xid); |
899 | return -ENOMEM; | 895 | return -ENOMEM; |
900 | } | 896 | } |
901 | 897 | ||
902 | if ((pTcon->ses->capabilities & CAP_UNIX) && | 898 | if ((pTcon->ses->capabilities & CAP_UNIX) && |
903 | (CIFS_UNIX_POSIX_PATH_OPS_CAP & | 899 | (CIFS_UNIX_POSIX_PATH_OPS_CAP & |
904 | le64_to_cpu(pTcon->fsUnixInfo.Capability))) { | 900 | le64_to_cpu(pTcon->fsUnixInfo.Capability))) { |
@@ -909,7 +905,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
909 | rc = -ENOMEM; | 905 | rc = -ENOMEM; |
910 | goto mkdir_out; | 906 | goto mkdir_out; |
911 | } | 907 | } |
912 | 908 | ||
913 | rc = CIFSPOSIXCreate(xid, pTcon, SMB_O_DIRECTORY | SMB_O_CREAT, | 909 | rc = CIFSPOSIXCreate(xid, pTcon, SMB_O_DIRECTORY | SMB_O_CREAT, |
914 | mode, NULL /* netfid */, pInfo, &oplock, | 910 | mode, NULL /* netfid */, pInfo, &oplock, |
915 | full_path, cifs_sb->local_nls, | 911 | full_path, cifs_sb->local_nls, |
@@ -963,7 +959,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
963 | kfree(pInfo); | 959 | kfree(pInfo); |
964 | goto mkdir_out; | 960 | goto mkdir_out; |
965 | } | 961 | } |
966 | 962 | ||
967 | /* BB add setting the equivalent of mode via CreateX w/ACLs */ | 963 | /* BB add setting the equivalent of mode via CreateX w/ACLs */ |
968 | rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls, | 964 | rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls, |
969 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 965 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
@@ -1316,7 +1312,7 @@ int cifs_revalidate(struct dentry *direntry) | |||
1316 | } | 1312 | } |
1317 | } | 1313 | } |
1318 | /* mutex_unlock(&direntry->d_inode->i_mutex); */ | 1314 | /* mutex_unlock(&direntry->d_inode->i_mutex); */ |
1319 | 1315 | ||
1320 | kfree(full_path); | 1316 | kfree(full_path); |
1321 | FreeXid(xid); | 1317 | FreeXid(xid); |
1322 | return rc; | 1318 | return rc; |
@@ -1433,7 +1429,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1433 | } else | 1429 | } else |
1434 | rc = 0; | 1430 | rc = 0; |
1435 | } | 1431 | } |
1436 | 1432 | ||
1437 | full_path = build_path_from_dentry(direntry); | 1433 | full_path = build_path_from_dentry(direntry); |
1438 | if (full_path == NULL) { | 1434 | if (full_path == NULL) { |
1439 | FreeXid(xid); | 1435 | FreeXid(xid); |
@@ -1588,7 +1584,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1588 | stamps are changed explicitly (i.e. by utime() | 1584 | stamps are changed explicitly (i.e. by utime() |
1589 | since we would then have a mix of client and | 1585 | since we would then have a mix of client and |
1590 | server times */ | 1586 | server times */ |
1591 | 1587 | ||
1592 | if (set_time && (attrs->ia_valid & ATTR_CTIME)) { | 1588 | if (set_time && (attrs->ia_valid & ATTR_CTIME)) { |
1593 | set_time = TRUE; | 1589 | set_time = TRUE; |
1594 | /* Although Samba throws this field away | 1590 | /* Although Samba throws this field away |