aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-10-15 15:34:02 -0400
committerSteve French <sfrench@us.ibm.com>2010-10-17 21:07:31 -0400
commit15ecb436c00fcb13b6dc32bdcbb9f75fc9b7613e (patch)
tree983bd08a195f701b3bffdb495fcf4e6f0e3b42cc /fs/cifs/dir.c
parent2e396b83f6087b78dac5a18d6d0cf9f8426a00b3 (diff)
cifs: move cifs_new_fileinfo to file.c
It's currently in dir.c which makes little sense... Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de> Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 600eac18cb21..3840eddbfb7a 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -130,54 +130,6 @@ cifs_bp_rename_retry:
130 return full_path; 130 return full_path;
131} 131}
132 132
133struct cifsFileInfo *
134cifs_new_fileinfo(__u16 fileHandle, struct file *file,
135 struct tcon_link *tlink, __u32 oplock)
136{
137 struct dentry *dentry = file->f_path.dentry;
138 struct inode *inode = dentry->d_inode;
139 struct cifsInodeInfo *pCifsInode = CIFS_I(inode);
140 struct cifsFileInfo *pCifsFile;
141
142 pCifsFile = kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL);
143 if (pCifsFile == NULL)
144 return pCifsFile;
145
146 pCifsFile->netfid = fileHandle;
147 pCifsFile->pid = current->tgid;
148 pCifsFile->uid = current_fsuid();
149 pCifsFile->dentry = dget(dentry);
150 pCifsFile->f_flags = file->f_flags;
151 pCifsFile->invalidHandle = false;
152 pCifsFile->closePend = false;
153 pCifsFile->tlink = cifs_get_tlink(tlink);
154 mutex_init(&pCifsFile->fh_mutex);
155 mutex_init(&pCifsFile->lock_mutex);
156 INIT_LIST_HEAD(&pCifsFile->llist);
157 atomic_set(&pCifsFile->count, 1);
158 INIT_WORK(&pCifsFile->oplock_break, cifs_oplock_break);
159
160 write_lock(&GlobalSMBSeslock);
161 list_add(&pCifsFile->tlist, &(tlink_tcon(tlink)->openFileList));
162 /* if readable file instance put first in list*/
163 if (file->f_mode & FMODE_READ)
164 list_add(&pCifsFile->flist, &pCifsInode->openFileList);
165 else
166 list_add_tail(&pCifsFile->flist, &pCifsInode->openFileList);
167 write_unlock(&GlobalSMBSeslock);
168
169 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
170 pCifsInode->clientCanCacheAll = true;
171 pCifsInode->clientCanCacheRead = true;
172 cFYI(1, "Exclusive Oplock inode %p", inode);
173 } else if ((oplock & 0xF) == OPLOCK_READ)
174 pCifsInode->clientCanCacheRead = true;
175
176 file->private_data = pCifsFile;
177
178 return pCifsFile;
179}
180
181static void setup_cifs_dentry(struct cifsTconInfo *tcon, 133static void setup_cifs_dentry(struct cifsTconInfo *tcon,
182 struct dentry *direntry, 134 struct dentry *direntry,
183 struct inode *newinode) 135 struct inode *newinode)