aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/link.c')
-rw-r--r--fs/cifs/link.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index cc0234710ddb..92aee08483a5 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -354,34 +354,30 @@ open_query_close_cifs_symlink(const unsigned char *path, char *pbuf,
354 354
355 355
356int 356int
357CIFSCheckMFSymlink(struct cifs_fattr *fattr, 357CIFSCheckMFSymlink(unsigned int xid, struct cifs_tcon *tcon,
358 const unsigned char *path, 358 struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
359 struct cifs_sb_info *cifs_sb, unsigned int xid) 359 const unsigned char *path)
360{ 360{
361 int rc = 0; 361 int rc;
362 u8 *buf = NULL; 362 u8 *buf = NULL;
363 unsigned int link_len = 0; 363 unsigned int link_len = 0;
364 unsigned int bytes_read = 0; 364 unsigned int bytes_read = 0;
365 struct cifs_tcon *ptcon;
366 365
367 if (!CIFSCouldBeMFSymlink(fattr)) 366 if (!CIFSCouldBeMFSymlink(fattr))
368 /* it's not a symlink */ 367 /* it's not a symlink */
369 return 0; 368 return 0;
370 369
371 buf = kmalloc(CIFS_MF_SYMLINK_FILE_SIZE, GFP_KERNEL); 370 buf = kmalloc(CIFS_MF_SYMLINK_FILE_SIZE, GFP_KERNEL);
372 if (!buf) { 371 if (!buf)
373 rc = -ENOMEM; 372 return -ENOMEM;
374 goto out;
375 }
376 373
377 ptcon = tlink_tcon(cifs_sb_tlink(cifs_sb)); 374 if (tcon->ses->server->ops->query_mf_symlink)
378 if ((ptcon->ses) && (ptcon->ses->server->ops->query_mf_symlink)) 375 rc = tcon->ses->server->ops->query_mf_symlink(path, buf,
379 rc = ptcon->ses->server->ops->query_mf_symlink(path, buf, 376 &bytes_read, cifs_sb, xid);
380 &bytes_read, cifs_sb, xid);
381 else 377 else
382 goto out; 378 rc = -ENOSYS;
383 379
384 if (rc != 0) 380 if (rc)
385 goto out; 381 goto out;
386 382
387 if (bytes_read == 0) /* not a symlink */ 383 if (bytes_read == 0) /* not a symlink */