diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 123 |
1 files changed, 70 insertions, 53 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 29b9ea244c81..62b324f26a56 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fs/cifs/inode.c | 2 | * fs/cifs/inode.c |
3 | * | 3 | * |
4 | * Copyright (C) International Business Machines Corp., 2002,2008 | 4 | * Copyright (C) International Business Machines Corp., 2002,2010 |
5 | * Author(s): Steve French (sfrench@us.ibm.com) | 5 | * Author(s): Steve French (sfrench@us.ibm.com) |
6 | * | 6 | * |
7 | * This library is free software; you can redistribute it and/or modify | 7 | * This library is free software; you can redistribute it and/or modify |
@@ -86,30 +86,30 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) | |||
86 | { | 86 | { |
87 | struct cifsInodeInfo *cifs_i = CIFS_I(inode); | 87 | struct cifsInodeInfo *cifs_i = CIFS_I(inode); |
88 | 88 | ||
89 | cFYI(1, ("%s: revalidating inode %llu", __func__, cifs_i->uniqueid)); | 89 | cFYI(1, "%s: revalidating inode %llu", __func__, cifs_i->uniqueid); |
90 | 90 | ||
91 | if (inode->i_state & I_NEW) { | 91 | if (inode->i_state & I_NEW) { |
92 | cFYI(1, ("%s: inode %llu is new", __func__, cifs_i->uniqueid)); | 92 | cFYI(1, "%s: inode %llu is new", __func__, cifs_i->uniqueid); |
93 | return; | 93 | return; |
94 | } | 94 | } |
95 | 95 | ||
96 | /* don't bother with revalidation if we have an oplock */ | 96 | /* don't bother with revalidation if we have an oplock */ |
97 | if (cifs_i->clientCanCacheRead) { | 97 | if (cifs_i->clientCanCacheRead) { |
98 | cFYI(1, ("%s: inode %llu is oplocked", __func__, | 98 | cFYI(1, "%s: inode %llu is oplocked", __func__, |
99 | cifs_i->uniqueid)); | 99 | cifs_i->uniqueid); |
100 | return; | 100 | return; |
101 | } | 101 | } |
102 | 102 | ||
103 | /* revalidate if mtime or size have changed */ | 103 | /* revalidate if mtime or size have changed */ |
104 | if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) && | 104 | if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) && |
105 | cifs_i->server_eof == fattr->cf_eof) { | 105 | cifs_i->server_eof == fattr->cf_eof) { |
106 | cFYI(1, ("%s: inode %llu is unchanged", __func__, | 106 | cFYI(1, "%s: inode %llu is unchanged", __func__, |
107 | cifs_i->uniqueid)); | 107 | cifs_i->uniqueid); |
108 | return; | 108 | return; |
109 | } | 109 | } |
110 | 110 | ||
111 | cFYI(1, ("%s: invalidating inode %llu mapping", __func__, | 111 | cFYI(1, "%s: invalidating inode %llu mapping", __func__, |
112 | cifs_i->uniqueid)); | 112 | cifs_i->uniqueid); |
113 | cifs_i->invalid_mapping = true; | 113 | cifs_i->invalid_mapping = true; |
114 | } | 114 | } |
115 | 115 | ||
@@ -137,15 +137,14 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) | |||
137 | inode->i_mode = fattr->cf_mode; | 137 | inode->i_mode = fattr->cf_mode; |
138 | 138 | ||
139 | cifs_i->cifsAttrs = fattr->cf_cifsattrs; | 139 | cifs_i->cifsAttrs = fattr->cf_cifsattrs; |
140 | cifs_i->uniqueid = fattr->cf_uniqueid; | ||
141 | 140 | ||
142 | if (fattr->cf_flags & CIFS_FATTR_NEED_REVAL) | 141 | if (fattr->cf_flags & CIFS_FATTR_NEED_REVAL) |
143 | cifs_i->time = 0; | 142 | cifs_i->time = 0; |
144 | else | 143 | else |
145 | cifs_i->time = jiffies; | 144 | cifs_i->time = jiffies; |
146 | 145 | ||
147 | cFYI(1, ("inode 0x%p old_time=%ld new_time=%ld", inode, | 146 | cFYI(1, "inode 0x%p old_time=%ld new_time=%ld", inode, |
148 | oldtime, cifs_i->time)); | 147 | oldtime, cifs_i->time); |
149 | 148 | ||
150 | cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING; | 149 | cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING; |
151 | 150 | ||
@@ -170,6 +169,17 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) | |||
170 | cifs_set_ops(inode, fattr->cf_flags & CIFS_FATTR_DFS_REFERRAL); | 169 | cifs_set_ops(inode, fattr->cf_flags & CIFS_FATTR_DFS_REFERRAL); |
171 | } | 170 | } |
172 | 171 | ||
172 | void | ||
173 | cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr) | ||
174 | { | ||
175 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | ||
176 | |||
177 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) | ||
178 | return; | ||
179 | |||
180 | fattr->cf_uniqueid = iunique(sb, ROOT_I); | ||
181 | } | ||
182 | |||
173 | /* Fill a cifs_fattr struct with info from FILE_UNIX_BASIC_INFO. */ | 183 | /* Fill a cifs_fattr struct with info from FILE_UNIX_BASIC_INFO. */ |
174 | void | 184 | void |
175 | cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info, | 185 | cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info, |
@@ -227,7 +237,7 @@ cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info, | |||
227 | /* safest to call it a file if we do not know */ | 237 | /* safest to call it a file if we do not know */ |
228 | fattr->cf_mode |= S_IFREG; | 238 | fattr->cf_mode |= S_IFREG; |
229 | fattr->cf_dtype = DT_REG; | 239 | fattr->cf_dtype = DT_REG; |
230 | cFYI(1, ("unknown type %d", le32_to_cpu(info->Type))); | 240 | cFYI(1, "unknown type %d", le32_to_cpu(info->Type)); |
231 | break; | 241 | break; |
232 | } | 242 | } |
233 | 243 | ||
@@ -256,7 +266,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb) | |||
256 | { | 266 | { |
257 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | 267 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); |
258 | 268 | ||
259 | cFYI(1, ("creating fake fattr for DFS referral")); | 269 | cFYI(1, "creating fake fattr for DFS referral"); |
260 | 270 | ||
261 | memset(fattr, 0, sizeof(*fattr)); | 271 | memset(fattr, 0, sizeof(*fattr)); |
262 | fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU; | 272 | fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU; |
@@ -305,7 +315,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
305 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | 315 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); |
306 | 316 | ||
307 | tcon = cifs_sb->tcon; | 317 | tcon = cifs_sb->tcon; |
308 | cFYI(1, ("Getting info on %s", full_path)); | 318 | cFYI(1, "Getting info on %s", full_path); |
309 | 319 | ||
310 | /* could have done a find first instead but this returns more info */ | 320 | /* could have done a find first instead but this returns more info */ |
311 | rc = CIFSSMBUnixQPathInfo(xid, tcon, full_path, &find_data, | 321 | rc = CIFSSMBUnixQPathInfo(xid, tcon, full_path, &find_data, |
@@ -323,6 +333,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
323 | 333 | ||
324 | if (*pinode == NULL) { | 334 | if (*pinode == NULL) { |
325 | /* get new inode */ | 335 | /* get new inode */ |
336 | cifs_fill_uniqueid(sb, &fattr); | ||
326 | *pinode = cifs_iget(sb, &fattr); | 337 | *pinode = cifs_iget(sb, &fattr); |
327 | if (!*pinode) | 338 | if (!*pinode) |
328 | rc = -ENOMEM; | 339 | rc = -ENOMEM; |
@@ -373,7 +384,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, | |||
373 | &bytes_read, &pbuf, &buf_type); | 384 | &bytes_read, &pbuf, &buf_type); |
374 | if ((rc == 0) && (bytes_read >= 8)) { | 385 | if ((rc == 0) && (bytes_read >= 8)) { |
375 | if (memcmp("IntxBLK", pbuf, 8) == 0) { | 386 | if (memcmp("IntxBLK", pbuf, 8) == 0) { |
376 | cFYI(1, ("Block device")); | 387 | cFYI(1, "Block device"); |
377 | fattr->cf_mode |= S_IFBLK; | 388 | fattr->cf_mode |= S_IFBLK; |
378 | fattr->cf_dtype = DT_BLK; | 389 | fattr->cf_dtype = DT_BLK; |
379 | if (bytes_read == 24) { | 390 | if (bytes_read == 24) { |
@@ -385,7 +396,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, | |||
385 | fattr->cf_rdev = MKDEV(mjr, mnr); | 396 | fattr->cf_rdev = MKDEV(mjr, mnr); |
386 | } | 397 | } |
387 | } else if (memcmp("IntxCHR", pbuf, 8) == 0) { | 398 | } else if (memcmp("IntxCHR", pbuf, 8) == 0) { |
388 | cFYI(1, ("Char device")); | 399 | cFYI(1, "Char device"); |
389 | fattr->cf_mode |= S_IFCHR; | 400 | fattr->cf_mode |= S_IFCHR; |
390 | fattr->cf_dtype = DT_CHR; | 401 | fattr->cf_dtype = DT_CHR; |
391 | if (bytes_read == 24) { | 402 | if (bytes_read == 24) { |
@@ -397,7 +408,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, | |||
397 | fattr->cf_rdev = MKDEV(mjr, mnr); | 408 | fattr->cf_rdev = MKDEV(mjr, mnr); |
398 | } | 409 | } |
399 | } else if (memcmp("IntxLNK", pbuf, 7) == 0) { | 410 | } else if (memcmp("IntxLNK", pbuf, 7) == 0) { |
400 | cFYI(1, ("Symlink")); | 411 | cFYI(1, "Symlink"); |
401 | fattr->cf_mode |= S_IFLNK; | 412 | fattr->cf_mode |= S_IFLNK; |
402 | fattr->cf_dtype = DT_LNK; | 413 | fattr->cf_dtype = DT_LNK; |
403 | } else { | 414 | } else { |
@@ -439,10 +450,10 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path, | |||
439 | else if (rc > 3) { | 450 | else if (rc > 3) { |
440 | mode = le32_to_cpu(*((__le32 *)ea_value)); | 451 | mode = le32_to_cpu(*((__le32 *)ea_value)); |
441 | fattr->cf_mode &= ~SFBITS_MASK; | 452 | fattr->cf_mode &= ~SFBITS_MASK; |
442 | cFYI(1, ("special bits 0%o org mode 0%o", mode, | 453 | cFYI(1, "special bits 0%o org mode 0%o", mode, |
443 | fattr->cf_mode)); | 454 | fattr->cf_mode); |
444 | fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode; | 455 | fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode; |
445 | cFYI(1, ("special mode bits 0%o", mode)); | 456 | cFYI(1, "special mode bits 0%o", mode); |
446 | } | 457 | } |
447 | 458 | ||
448 | return 0; | 459 | return 0; |
@@ -548,11 +559,11 @@ int cifs_get_inode_info(struct inode **pinode, | |||
548 | struct cifs_fattr fattr; | 559 | struct cifs_fattr fattr; |
549 | 560 | ||
550 | pTcon = cifs_sb->tcon; | 561 | pTcon = cifs_sb->tcon; |
551 | cFYI(1, ("Getting info on %s", full_path)); | 562 | cFYI(1, "Getting info on %s", full_path); |
552 | 563 | ||
553 | if ((pfindData == NULL) && (*pinode != NULL)) { | 564 | if ((pfindData == NULL) && (*pinode != NULL)) { |
554 | if (CIFS_I(*pinode)->clientCanCacheRead) { | 565 | if (CIFS_I(*pinode)->clientCanCacheRead) { |
555 | cFYI(1, ("No need to revalidate cached inode sizes")); | 566 | cFYI(1, "No need to revalidate cached inode sizes"); |
556 | return rc; | 567 | return rc; |
557 | } | 568 | } |
558 | } | 569 | } |
@@ -618,7 +629,7 @@ int cifs_get_inode_info(struct inode **pinode, | |||
618 | cifs_sb->mnt_cifs_flags & | 629 | cifs_sb->mnt_cifs_flags & |
619 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 630 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
620 | if (rc1 || !fattr.cf_uniqueid) { | 631 | if (rc1 || !fattr.cf_uniqueid) { |
621 | cFYI(1, ("GetSrvInodeNum rc %d", rc1)); | 632 | cFYI(1, "GetSrvInodeNum rc %d", rc1); |
622 | fattr.cf_uniqueid = iunique(sb, ROOT_I); | 633 | fattr.cf_uniqueid = iunique(sb, ROOT_I); |
623 | cifs_autodisable_serverino(cifs_sb); | 634 | cifs_autodisable_serverino(cifs_sb); |
624 | } | 635 | } |
@@ -634,13 +645,13 @@ int cifs_get_inode_info(struct inode **pinode, | |||
634 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { | 645 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { |
635 | tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid); | 646 | tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid); |
636 | if (tmprc) | 647 | if (tmprc) |
637 | cFYI(1, ("cifs_sfu_type failed: %d", tmprc)); | 648 | cFYI(1, "cifs_sfu_type failed: %d", tmprc); |
638 | } | 649 | } |
639 | 650 | ||
640 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 651 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
641 | /* fill in 0777 bits from ACL */ | 652 | /* fill in 0777 bits from ACL */ |
642 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | 653 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { |
643 | cFYI(1, ("Getting mode bits from ACL")); | 654 | cFYI(1, "Getting mode bits from ACL"); |
644 | cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid); | 655 | cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid); |
645 | } | 656 | } |
646 | #endif | 657 | #endif |
@@ -745,7 +756,7 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr) | |||
745 | struct inode *inode; | 756 | struct inode *inode; |
746 | 757 | ||
747 | retry_iget5_locked: | 758 | retry_iget5_locked: |
748 | cFYI(1, ("looking for uniqueid=%llu", fattr->cf_uniqueid)); | 759 | cFYI(1, "looking for uniqueid=%llu", fattr->cf_uniqueid); |
749 | 760 | ||
750 | /* hash down to 32-bits on 32-bit arch */ | 761 | /* hash down to 32-bits on 32-bit arch */ |
751 | hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid); | 762 | hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid); |
@@ -797,7 +808,7 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) | |||
797 | return ERR_PTR(-ENOMEM); | 808 | return ERR_PTR(-ENOMEM); |
798 | 809 | ||
799 | if (rc && cifs_sb->tcon->ipc) { | 810 | if (rc && cifs_sb->tcon->ipc) { |
800 | cFYI(1, ("ipc connection - fake read inode")); | 811 | cFYI(1, "ipc connection - fake read inode"); |
801 | inode->i_mode |= S_IFDIR; | 812 | inode->i_mode |= S_IFDIR; |
802 | inode->i_nlink = 2; | 813 | inode->i_nlink = 2; |
803 | inode->i_op = &cifs_ipc_inode_ops; | 814 | inode->i_op = &cifs_ipc_inode_ops; |
@@ -859,7 +870,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid, | |||
859 | * server times. | 870 | * server times. |
860 | */ | 871 | */ |
861 | if (set_time && (attrs->ia_valid & ATTR_CTIME)) { | 872 | if (set_time && (attrs->ia_valid & ATTR_CTIME)) { |
862 | cFYI(1, ("CIFS - CTIME changed")); | 873 | cFYI(1, "CIFS - CTIME changed"); |
863 | info_buf.ChangeTime = | 874 | info_buf.ChangeTime = |
864 | cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime)); | 875 | cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime)); |
865 | } else | 876 | } else |
@@ -894,8 +905,8 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid, | |||
894 | goto out; | 905 | goto out; |
895 | } | 906 | } |
896 | 907 | ||
897 | cFYI(1, ("calling SetFileInfo since SetPathInfo for " | 908 | cFYI(1, "calling SetFileInfo since SetPathInfo for " |
898 | "times not supported by this server")); | 909 | "times not supported by this server"); |
899 | rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, | 910 | rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, |
900 | SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, | 911 | SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, |
901 | CREATE_NOT_DIR, &netfid, &oplock, | 912 | CREATE_NOT_DIR, &netfid, &oplock, |
@@ -1053,7 +1064,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) | |||
1053 | struct iattr *attrs = NULL; | 1064 | struct iattr *attrs = NULL; |
1054 | __u32 dosattr = 0, origattr = 0; | 1065 | __u32 dosattr = 0, origattr = 0; |
1055 | 1066 | ||
1056 | cFYI(1, ("cifs_unlink, dir=0x%p, dentry=0x%p", dir, dentry)); | 1067 | cFYI(1, "cifs_unlink, dir=0x%p, dentry=0x%p", dir, dentry); |
1057 | 1068 | ||
1058 | xid = GetXid(); | 1069 | xid = GetXid(); |
1059 | 1070 | ||
@@ -1072,7 +1083,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) | |||
1072 | rc = CIFSPOSIXDelFile(xid, tcon, full_path, | 1083 | rc = CIFSPOSIXDelFile(xid, tcon, full_path, |
1073 | SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, | 1084 | SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, |
1074 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 1085 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
1075 | cFYI(1, ("posix del rc %d", rc)); | 1086 | cFYI(1, "posix del rc %d", rc); |
1076 | if ((rc == 0) || (rc == -ENOENT)) | 1087 | if ((rc == 0) || (rc == -ENOENT)) |
1077 | goto psx_del_no_retry; | 1088 | goto psx_del_no_retry; |
1078 | } | 1089 | } |
@@ -1146,7 +1157,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
1146 | struct inode *newinode = NULL; | 1157 | struct inode *newinode = NULL; |
1147 | struct cifs_fattr fattr; | 1158 | struct cifs_fattr fattr; |
1148 | 1159 | ||
1149 | cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode)); | 1160 | cFYI(1, "In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode); |
1150 | 1161 | ||
1151 | xid = GetXid(); | 1162 | xid = GetXid(); |
1152 | 1163 | ||
@@ -1181,7 +1192,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
1181 | kfree(pInfo); | 1192 | kfree(pInfo); |
1182 | goto mkdir_retry_old; | 1193 | goto mkdir_retry_old; |
1183 | } else if (rc) { | 1194 | } else if (rc) { |
1184 | cFYI(1, ("posix mkdir returned 0x%x", rc)); | 1195 | cFYI(1, "posix mkdir returned 0x%x", rc); |
1185 | d_drop(direntry); | 1196 | d_drop(direntry); |
1186 | } else { | 1197 | } else { |
1187 | if (pInfo->Type == cpu_to_le32(-1)) { | 1198 | if (pInfo->Type == cpu_to_le32(-1)) { |
@@ -1198,6 +1209,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
1198 | direntry->d_op = &cifs_dentry_ops; | 1209 | direntry->d_op = &cifs_dentry_ops; |
1199 | 1210 | ||
1200 | cifs_unix_basic_to_fattr(&fattr, pInfo, cifs_sb); | 1211 | cifs_unix_basic_to_fattr(&fattr, pInfo, cifs_sb); |
1212 | cifs_fill_uniqueid(inode->i_sb, &fattr); | ||
1201 | newinode = cifs_iget(inode->i_sb, &fattr); | 1213 | newinode = cifs_iget(inode->i_sb, &fattr); |
1202 | if (!newinode) { | 1214 | if (!newinode) { |
1203 | kfree(pInfo); | 1215 | kfree(pInfo); |
@@ -1207,12 +1219,12 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
1207 | d_instantiate(direntry, newinode); | 1219 | d_instantiate(direntry, newinode); |
1208 | 1220 | ||
1209 | #ifdef CONFIG_CIFS_DEBUG2 | 1221 | #ifdef CONFIG_CIFS_DEBUG2 |
1210 | cFYI(1, ("instantiated dentry %p %s to inode %p", | 1222 | cFYI(1, "instantiated dentry %p %s to inode %p", |
1211 | direntry, direntry->d_name.name, newinode)); | 1223 | direntry, direntry->d_name.name, newinode); |
1212 | 1224 | ||
1213 | if (newinode->i_nlink != 2) | 1225 | if (newinode->i_nlink != 2) |
1214 | cFYI(1, ("unexpected number of links %d", | 1226 | cFYI(1, "unexpected number of links %d", |
1215 | newinode->i_nlink)); | 1227 | newinode->i_nlink); |
1216 | #endif | 1228 | #endif |
1217 | } | 1229 | } |
1218 | kfree(pInfo); | 1230 | kfree(pInfo); |
@@ -1223,7 +1235,7 @@ mkdir_retry_old: | |||
1223 | rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls, | 1235 | rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls, |
1224 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 1236 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
1225 | if (rc) { | 1237 | if (rc) { |
1226 | cFYI(1, ("cifs_mkdir returned 0x%x", rc)); | 1238 | cFYI(1, "cifs_mkdir returned 0x%x", rc); |
1227 | d_drop(direntry); | 1239 | d_drop(direntry); |
1228 | } else { | 1240 | } else { |
1229 | mkdir_get_info: | 1241 | mkdir_get_info: |
@@ -1326,7 +1338,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) | |||
1326 | char *full_path = NULL; | 1338 | char *full_path = NULL; |
1327 | struct cifsInodeInfo *cifsInode; | 1339 | struct cifsInodeInfo *cifsInode; |
1328 | 1340 | ||
1329 | cFYI(1, ("cifs_rmdir, inode = 0x%p", inode)); | 1341 | cFYI(1, "cifs_rmdir, inode = 0x%p", inode); |
1330 | 1342 | ||
1331 | xid = GetXid(); | 1343 | xid = GetXid(); |
1332 | 1344 | ||
@@ -1528,6 +1540,11 @@ cifs_inode_needs_reval(struct inode *inode) | |||
1528 | if (time_after_eq(jiffies, cifs_i->time + HZ)) | 1540 | if (time_after_eq(jiffies, cifs_i->time + HZ)) |
1529 | return true; | 1541 | return true; |
1530 | 1542 | ||
1543 | /* hardlinked files w/ noserverino get "special" treatment */ | ||
1544 | if (!(CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) && | ||
1545 | S_ISREG(inode->i_mode) && inode->i_nlink != 1) | ||
1546 | return true; | ||
1547 | |||
1531 | return false; | 1548 | return false; |
1532 | } | 1549 | } |
1533 | 1550 | ||
@@ -1594,9 +1611,9 @@ int cifs_revalidate_dentry(struct dentry *dentry) | |||
1594 | goto check_inval; | 1611 | goto check_inval; |
1595 | } | 1612 | } |
1596 | 1613 | ||
1597 | cFYI(1, ("Revalidate: %s inode 0x%p count %d dentry: 0x%p d_time %ld " | 1614 | cFYI(1, "Revalidate: %s inode 0x%p count %d dentry: 0x%p d_time %ld " |
1598 | "jiffies %ld", full_path, inode, inode->i_count.counter, | 1615 | "jiffies %ld", full_path, inode, inode->i_count.counter, |
1599 | dentry, dentry->d_time, jiffies)); | 1616 | dentry, dentry->d_time, jiffies); |
1600 | 1617 | ||
1601 | if (CIFS_SB(sb)->tcon->unix_ext) | 1618 | if (CIFS_SB(sb)->tcon->unix_ext) |
1602 | rc = cifs_get_inode_info_unix(&inode, full_path, sb, xid); | 1619 | rc = cifs_get_inode_info_unix(&inode, full_path, sb, xid); |
@@ -1690,12 +1707,12 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs, | |||
1690 | rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, nfid, | 1707 | rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, nfid, |
1691 | npid, false); | 1708 | npid, false); |
1692 | cifsFileInfo_put(open_file); | 1709 | cifsFileInfo_put(open_file); |
1693 | cFYI(1, ("SetFSize for attrs rc = %d", rc)); | 1710 | cFYI(1, "SetFSize for attrs rc = %d", rc); |
1694 | if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { | 1711 | if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { |
1695 | unsigned int bytes_written; | 1712 | unsigned int bytes_written; |
1696 | rc = CIFSSMBWrite(xid, pTcon, nfid, 0, attrs->ia_size, | 1713 | rc = CIFSSMBWrite(xid, pTcon, nfid, 0, attrs->ia_size, |
1697 | &bytes_written, NULL, NULL, 1); | 1714 | &bytes_written, NULL, NULL, 1); |
1698 | cFYI(1, ("Wrt seteof rc %d", rc)); | 1715 | cFYI(1, "Wrt seteof rc %d", rc); |
1699 | } | 1716 | } |
1700 | } else | 1717 | } else |
1701 | rc = -EINVAL; | 1718 | rc = -EINVAL; |
@@ -1709,7 +1726,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs, | |||
1709 | false, cifs_sb->local_nls, | 1726 | false, cifs_sb->local_nls, |
1710 | cifs_sb->mnt_cifs_flags & | 1727 | cifs_sb->mnt_cifs_flags & |
1711 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 1728 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
1712 | cFYI(1, ("SetEOF by path (setattrs) rc = %d", rc)); | 1729 | cFYI(1, "SetEOF by path (setattrs) rc = %d", rc); |
1713 | if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { | 1730 | if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { |
1714 | __u16 netfid; | 1731 | __u16 netfid; |
1715 | int oplock = 0; | 1732 | int oplock = 0; |
@@ -1726,7 +1743,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs, | |||
1726 | attrs->ia_size, | 1743 | attrs->ia_size, |
1727 | &bytes_written, NULL, | 1744 | &bytes_written, NULL, |
1728 | NULL, 1); | 1745 | NULL, 1); |
1729 | cFYI(1, ("wrt seteof rc %d", rc)); | 1746 | cFYI(1, "wrt seteof rc %d", rc); |
1730 | CIFSSMBClose(xid, pTcon, netfid); | 1747 | CIFSSMBClose(xid, pTcon, netfid); |
1731 | } | 1748 | } |
1732 | } | 1749 | } |
@@ -1754,8 +1771,8 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) | |||
1754 | struct cifs_unix_set_info_args *args = NULL; | 1771 | struct cifs_unix_set_info_args *args = NULL; |
1755 | struct cifsFileInfo *open_file; | 1772 | struct cifsFileInfo *open_file; |
1756 | 1773 | ||
1757 | cFYI(1, ("setattr_unix on file %s attrs->ia_valid=0x%x", | 1774 | cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x", |
1758 | direntry->d_name.name, attrs->ia_valid)); | 1775 | direntry->d_name.name, attrs->ia_valid); |
1759 | 1776 | ||
1760 | xid = GetXid(); | 1777 | xid = GetXid(); |
1761 | 1778 | ||
@@ -1885,8 +1902,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) | |||
1885 | 1902 | ||
1886 | xid = GetXid(); | 1903 | xid = GetXid(); |
1887 | 1904 | ||
1888 | cFYI(1, ("setattr on file %s attrs->iavalid 0x%x", | 1905 | cFYI(1, "setattr on file %s attrs->iavalid 0x%x", |
1889 | direntry->d_name.name, attrs->ia_valid)); | 1906 | direntry->d_name.name, attrs->ia_valid); |
1890 | 1907 | ||
1891 | if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) { | 1908 | if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) { |
1892 | /* check if we have permission to change attrs */ | 1909 | /* check if we have permission to change attrs */ |
@@ -1943,7 +1960,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) | |||
1943 | attrs->ia_valid &= ~ATTR_MODE; | 1960 | attrs->ia_valid &= ~ATTR_MODE; |
1944 | 1961 | ||
1945 | if (attrs->ia_valid & ATTR_MODE) { | 1962 | if (attrs->ia_valid & ATTR_MODE) { |
1946 | cFYI(1, ("Mode changed to 0%o", attrs->ia_mode)); | 1963 | cFYI(1, "Mode changed to 0%o", attrs->ia_mode); |
1947 | mode = attrs->ia_mode; | 1964 | mode = attrs->ia_mode; |
1948 | } | 1965 | } |
1949 | 1966 | ||
@@ -2029,7 +2046,7 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
2029 | #if 0 | 2046 | #if 0 |
2030 | void cifs_delete_inode(struct inode *inode) | 2047 | void cifs_delete_inode(struct inode *inode) |
2031 | { | 2048 | { |
2032 | cFYI(1, ("In cifs_delete_inode, inode = 0x%p", inode)); | 2049 | cFYI(1, "In cifs_delete_inode, inode = 0x%p", inode); |
2033 | /* may have to add back in if and when safe distributed caching of | 2050 | /* may have to add back in if and when safe distributed caching of |
2034 | directories added e.g. via FindNotify */ | 2051 | directories added e.g. via FindNotify */ |
2035 | } | 2052 | } |