diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsproto.h | 1 | ||||
-rw-r--r-- | fs/cifs/dir.c | 1 | ||||
-rw-r--r-- | fs/cifs/inode.c | 13 |
3 files changed, 15 insertions, 0 deletions
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 2e07da9a46fa..fb1657e0fdb8 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -110,6 +110,7 @@ extern int cifs_posix_open(char *full_path, struct inode **pinode, | |||
110 | struct super_block *sb, | 110 | struct super_block *sb, |
111 | int mode, int oflags, | 111 | int mode, int oflags, |
112 | __u32 *poplock, __u16 *pnetfid, int xid); | 112 | __u32 *poplock, __u16 *pnetfid, int xid); |
113 | void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr); | ||
113 | extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, | 114 | extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, |
114 | FILE_UNIX_BASIC_INFO *info, | 115 | FILE_UNIX_BASIC_INFO *info, |
115 | struct cifs_sb_info *cifs_sb); | 116 | struct cifs_sb_info *cifs_sb); |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 86d3c0c82f25..391816b461ca 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -248,6 +248,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode, | |||
248 | 248 | ||
249 | /* get new inode and set it up */ | 249 | /* get new inode and set it up */ |
250 | if (*pinode == NULL) { | 250 | if (*pinode == NULL) { |
251 | cifs_fill_uniqueid(sb, &fattr); | ||
251 | *pinode = cifs_iget(sb, &fattr); | 252 | *pinode = cifs_iget(sb, &fattr); |
252 | if (!*pinode) { | 253 | if (!*pinode) { |
253 | rc = -ENOMEM; | 254 | rc = -ENOMEM; |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index b0ff2529cb96..62b324f26a56 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -169,6 +169,17 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) | |||
169 | cifs_set_ops(inode, fattr->cf_flags & CIFS_FATTR_DFS_REFERRAL); | 169 | cifs_set_ops(inode, fattr->cf_flags & CIFS_FATTR_DFS_REFERRAL); |
170 | } | 170 | } |
171 | 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 | |||
172 | /* 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. */ |
173 | void | 184 | void |
174 | 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, |
@@ -322,6 +333,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
322 | 333 | ||
323 | if (*pinode == NULL) { | 334 | if (*pinode == NULL) { |
324 | /* get new inode */ | 335 | /* get new inode */ |
336 | cifs_fill_uniqueid(sb, &fattr); | ||
325 | *pinode = cifs_iget(sb, &fattr); | 337 | *pinode = cifs_iget(sb, &fattr); |
326 | if (!*pinode) | 338 | if (!*pinode) |
327 | rc = -ENOMEM; | 339 | rc = -ENOMEM; |
@@ -1197,6 +1209,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
1197 | direntry->d_op = &cifs_dentry_ops; | 1209 | direntry->d_op = &cifs_dentry_ops; |
1198 | 1210 | ||
1199 | 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); | ||
1200 | newinode = cifs_iget(inode->i_sb, &fattr); | 1213 | newinode = cifs_iget(inode->i_sb, &fattr); |
1201 | if (!newinode) { | 1214 | if (!newinode) { |
1202 | kfree(pInfo); | 1215 | kfree(pInfo); |