aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/link.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-05-01 01:27:32 -0400
committerSteve French <sfrench@us.ibm.com>2009-05-01 01:27:32 -0400
commit0e0d2cf32743c660aab20e40aeb2155c06a256db (patch)
tree94dfb57ad091f283172628a3bba754e1562ded7d /fs/cifs/link.c
parente14b2fe1e64d3e4bd2f328ff9d1969f318f55954 (diff)
[CIFS] Remove sparse endian warnings
Removes two sparse CHECK_ENDIAN warnings from Jeffs earlier patch, and removes the dead readlink code (after noting where in findfirst we will need to add something like that in the future to handle the newly discovered unexpected error on FindFirst of NTFS symlinks. Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/link.c')
-rw-r--r--fs/cifs/link.c87
1 files changed, 0 insertions, 87 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index eb2fbbe865d2..ea9d11e3dcbb 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -212,93 +212,6 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
212 return rc; 212 return rc;
213} 213}
214 214
215int
216cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
217{
218 struct inode *inode = direntry->d_inode;
219 int rc = -EACCES;
220 int xid;
221 int oplock = 0;
222 struct cifs_sb_info *cifs_sb;
223 struct cifsTconInfo *pTcon;
224 char *full_path = NULL;
225 char *tmpbuffer;
226 int len;
227 __u16 fid;
228
229 xid = GetXid();
230 cifs_sb = CIFS_SB(inode->i_sb);
231 pTcon = cifs_sb->tcon;
232
233/* BB would it be safe against deadlock to grab this sem
234 even though rename itself grabs the sem and calls lookup? */
235/* mutex_lock(&inode->i_sb->s_vfs_rename_mutex);*/
236 full_path = build_path_from_dentry(direntry);
237/* mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);*/
238
239 if (full_path == NULL) {
240 FreeXid(xid);
241 return -ENOMEM;
242 }
243
244 cFYI(1,
245 ("Full path: %s inode = 0x%p pBuffer = 0x%p buflen = %d",
246 full_path, inode, pBuffer, buflen));
247 if (buflen > PATH_MAX)
248 len = PATH_MAX;
249 else
250 len = buflen;
251 tmpbuffer = kmalloc(len, GFP_KERNEL);
252 if (tmpbuffer == NULL) {
253 kfree(full_path);
254 FreeXid(xid);
255 return -ENOMEM;
256 }
257
258/* BB add read reparse point symlink code and
259 Unix extensions symlink code here BB */
260
261 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
262 cERROR(1, ("SFU style symlinks not implemented yet"));
263 /* add open and read as in fs/cifs/inode.c */
264 } else {
265 rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, GENERIC_READ,
266 OPEN_REPARSE_POINT, &fid, &oplock, NULL,
267 cifs_sb->local_nls,
268 cifs_sb->mnt_cifs_flags &
269 CIFS_MOUNT_MAP_SPECIAL_CHR);
270 if (!rc) {
271 rc = CIFSSMBQueryReparseLinkInfo(xid, pTcon, full_path,
272 tmpbuffer,
273 len - 1,
274 fid,
275 cifs_sb->local_nls);
276 if (CIFSSMBClose(xid, pTcon, fid)) {
277 cFYI(1, ("Error closing junction point "
278 "(open for ioctl)"));
279 }
280 /* If it is a DFS junction earlier we would have gotten
281 PATH_NOT_COVERED returned from server so we do
282 not need to request the DFS info here */
283 }
284 }
285 /* BB Anything else to do to handle recursive links? */
286 /* BB Should we be using page ops here? */
287
288 /* BB null terminate returned string in pBuffer? BB */
289 if (rc == 0) {
290 rc = vfs_readlink(direntry, pBuffer, len, tmpbuffer);
291 cFYI(1,
292 ("vfs_readlink called from cifs_readlink returned %d",
293 rc));
294 }
295
296 kfree(tmpbuffer);
297 kfree(full_path);
298 FreeXid(xid);
299 return rc;
300}
301
302void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie) 215void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie)
303{ 216{
304 char *p = nd_get_link(nd); 217 char *p = nd_get_link(nd);