diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 8fd4ee8e07ff..4ff36ea8c693 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -412,7 +412,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path, | |||
412 | struct cifs_sb_info *cifs_sb, unsigned int xid) | 412 | struct cifs_sb_info *cifs_sb, unsigned int xid) |
413 | { | 413 | { |
414 | int rc; | 414 | int rc; |
415 | int oplock = 0; | 415 | __u32 oplock; |
416 | struct tcon_link *tlink; | 416 | struct tcon_link *tlink; |
417 | struct cifs_tcon *tcon; | 417 | struct cifs_tcon *tcon; |
418 | struct cifs_fid fid; | 418 | struct cifs_fid fid; |
@@ -451,8 +451,13 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path, | |||
451 | oparms.fid = &fid; | 451 | oparms.fid = &fid; |
452 | oparms.reconnect = false; | 452 | oparms.reconnect = false; |
453 | 453 | ||
454 | rc = CIFS_open(xid, &oparms, &oplock, NULL); | 454 | if (tcon->ses->server->oplocks) |
455 | oplock = REQ_OPLOCK; | ||
456 | else | ||
457 | oplock = 0; | ||
458 | rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, NULL); | ||
455 | if (rc) { | 459 | if (rc) { |
460 | cifs_dbg(FYI, "check sfu type of %s, open rc = %d\n", path, rc); | ||
456 | cifs_put_tlink(tlink); | 461 | cifs_put_tlink(tlink); |
457 | return rc; | 462 | return rc; |
458 | } | 463 | } |
@@ -464,7 +469,8 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path, | |||
464 | io_parms.offset = 0; | 469 | io_parms.offset = 0; |
465 | io_parms.length = 24; | 470 | io_parms.length = 24; |
466 | 471 | ||
467 | rc = CIFSSMBRead(xid, &io_parms, &bytes_read, &pbuf, &buf_type); | 472 | rc = tcon->ses->server->ops->sync_read(xid, &fid, &io_parms, |
473 | &bytes_read, &pbuf, &buf_type); | ||
468 | if ((rc == 0) && (bytes_read >= 8)) { | 474 | if ((rc == 0) && (bytes_read >= 8)) { |
469 | if (memcmp("IntxBLK", pbuf, 8) == 0) { | 475 | if (memcmp("IntxBLK", pbuf, 8) == 0) { |
470 | cifs_dbg(FYI, "Block device\n"); | 476 | cifs_dbg(FYI, "Block device\n"); |
@@ -504,7 +510,8 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path, | |||
504 | fattr->cf_dtype = DT_REG; | 510 | fattr->cf_dtype = DT_REG; |
505 | rc = -EOPNOTSUPP; /* or some unknown SFU type */ | 511 | rc = -EOPNOTSUPP; /* or some unknown SFU type */ |
506 | } | 512 | } |
507 | CIFSSMBClose(xid, tcon, fid.netfid); | 513 | |
514 | tcon->ses->server->ops->close(xid, tcon, &fid); | ||
508 | cifs_put_tlink(tlink); | 515 | cifs_put_tlink(tlink); |
509 | return rc; | 516 | return rc; |
510 | } | 517 | } |