aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorSuresh Jayaraman <sjayaraman@suse.de>2010-05-10 10:30:05 -0400
committerSteve French <sfrench@us.ibm.com>2010-05-10 13:59:51 -0400
commitfae683f764f91f31ab45512e70cc8cc81d4d157b (patch)
treebde4506a973f82996f807716b2adb9ec0d9c968a /fs/cifs/dir.c
parent51c8176472de1551a301b676e36a61884e0e8494 (diff)
cifs: add comments explaining cifs_new_fileinfo behavior
The comments make it clear the otherwise subtle behavior of cifs_new_fileinfo(). Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Reviewed-by: Shirish Pargaonkar <shirishp@us.ibm.com> -- fs/cifs/dir.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index d791d0763a9c..bd363df19b3f 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -129,6 +129,12 @@ cifs_bp_rename_retry:
129 return full_path; 129 return full_path;
130} 130}
131 131
132/*
133 * When called with struct file pointer set to NULL, there is no way we could
134 * update file->private_data, but getting it stuck on openFileList provides a
135 * way to access it from cifs_fill_filedata and thereby set file->private_data
136 * from cifs_open.
137 */
132struct cifsFileInfo * 138struct cifsFileInfo *
133cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, 139cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle,
134 struct file *file, struct vfsmount *mnt, unsigned int oflags) 140 struct file *file, struct vfsmount *mnt, unsigned int oflags)
@@ -251,6 +257,10 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
251 cifs_fattr_to_inode(*pinode, &fattr); 257 cifs_fattr_to_inode(*pinode, &fattr);
252 } 258 }
253 259
260 /*
261 * cifs_fill_filedata() takes care of setting cifsFileInfo pointer to
262 * file->private_data.
263 */
254 if (mnt) 264 if (mnt)
255 cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags); 265 cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags);
256 266
@@ -466,8 +476,12 @@ cifs_create_set_dentry:
466 /* mknod case - do not leave file open */ 476 /* mknod case - do not leave file open */
467 CIFSSMBClose(xid, tcon, fileHandle); 477 CIFSSMBClose(xid, tcon, fileHandle);
468 } else if (!(posix_create) && (newinode)) { 478 } else if (!(posix_create) && (newinode)) {
469 cifs_new_fileinfo(newinode, fileHandle, NULL, 479 /*
470 nd->path.mnt, oflags); 480 * cifs_fill_filedata() takes care of setting cifsFileInfo
481 * pointer to file->private_data.
482 */
483 cifs_new_fileinfo(newinode, fileHandle, NULL, nd->path.mnt,
484 oflags);
471 } 485 }
472cifs_create_out: 486cifs_create_out:
473 kfree(buf); 487 kfree(buf);