Commit 0360d605 authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Steve French

CIFS: Remove extra indentation in cifs_sfu_type

Signed-off-by: default avatarPavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent dd120671
...@@ -404,7 +404,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, ...@@ -404,7 +404,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
} }
static int static int
cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, cifs_sfu_type(struct cifs_fattr *fattr, const char *path,
struct cifs_sb_info *cifs_sb, unsigned int xid) struct cifs_sb_info *cifs_sb, unsigned int xid)
{ {
int rc; int rc;
...@@ -416,6 +416,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, ...@@ -416,6 +416,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
char buf[24]; char buf[24];
unsigned int bytes_read; unsigned int bytes_read;
char *pbuf; char *pbuf;
int buf_type = CIFS_NO_BUFFER;
pbuf = buf; pbuf = buf;
...@@ -441,57 +442,59 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, ...@@ -441,57 +442,59 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
cifs_sb->local_nls, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc == 0) { if (rc) {
int buf_type = CIFS_NO_BUFFER; cifs_put_tlink(tlink);
/* Read header */ return rc;
io_parms.netfid = netfid; }
io_parms.pid = current->tgid;
io_parms.tcon = tcon; /* Read header */
io_parms.offset = 0; io_parms.netfid = netfid;
io_parms.length = 24; io_parms.pid = current->tgid;
rc = CIFSSMBRead(xid, &io_parms, &bytes_read, &pbuf, io_parms.tcon = tcon;
&buf_type); io_parms.offset = 0;
if ((rc == 0) && (bytes_read >= 8)) { io_parms.length = 24;
if (memcmp("IntxBLK", pbuf, 8) == 0) {
cifs_dbg(FYI, "Block device\n"); rc = CIFSSMBRead(xid, &io_parms, &bytes_read, &pbuf, &buf_type);
fattr->cf_mode |= S_IFBLK; if ((rc == 0) && (bytes_read >= 8)) {
fattr->cf_dtype = DT_BLK; if (memcmp("IntxBLK", pbuf, 8) == 0) {
if (bytes_read == 24) { cifs_dbg(FYI, "Block device\n");
/* we have enough to decode dev num */ fattr->cf_mode |= S_IFBLK;
__u64 mjr; /* major */ fattr->cf_dtype = DT_BLK;
__u64 mnr; /* minor */ if (bytes_read == 24) {
mjr = le64_to_cpu(*(__le64 *)(pbuf+8)); /* we have enough to decode dev num */
mnr = le64_to_cpu(*(__le64 *)(pbuf+16)); __u64 mjr; /* major */
fattr->cf_rdev = MKDEV(mjr, mnr); __u64 mnr; /* minor */
} mjr = le64_to_cpu(*(__le64 *)(pbuf+8));
} else if (memcmp("IntxCHR", pbuf, 8) == 0) { mnr = le64_to_cpu(*(__le64 *)(pbuf+16));
cifs_dbg(FYI, "Char device\n"); fattr->cf_rdev = MKDEV(mjr, mnr);
fattr->cf_mode |= S_IFCHR; }
fattr->cf_dtype = DT_CHR; } else if (memcmp("IntxCHR", pbuf, 8) == 0) {
if (bytes_read == 24) { cifs_dbg(FYI, "Char device\n");
/* we have enough to decode dev num */ fattr->cf_mode |= S_IFCHR;
__u64 mjr; /* major */ fattr->cf_dtype = DT_CHR;
__u64 mnr; /* minor */ if (bytes_read == 24) {
mjr = le64_to_cpu(*(__le64 *)(pbuf+8)); /* we have enough to decode dev num */
mnr = le64_to_cpu(*(__le64 *)(pbuf+16)); __u64 mjr; /* major */
fattr->cf_rdev = MKDEV(mjr, mnr); __u64 mnr; /* minor */
} mjr = le64_to_cpu(*(__le64 *)(pbuf+8));
} else if (memcmp("IntxLNK", pbuf, 7) == 0) { mnr = le64_to_cpu(*(__le64 *)(pbuf+16));
cifs_dbg(FYI, "Symlink\n"); fattr->cf_rdev = MKDEV(mjr, mnr);
fattr->cf_mode |= S_IFLNK;
fattr->cf_dtype = DT_LNK;
} else {
fattr->cf_mode |= S_IFREG; /* file? */
fattr->cf_dtype = DT_REG;
rc = -EOPNOTSUPP;
} }
} else if (memcmp("IntxLNK", pbuf, 7) == 0) {
cifs_dbg(FYI, "Symlink\n");
fattr->cf_mode |= S_IFLNK;
fattr->cf_dtype = DT_LNK;
} else { } else {
fattr->cf_mode |= S_IFREG; /* then it is a file */ fattr->cf_mode |= S_IFREG; /* file? */
fattr->cf_dtype = DT_REG; fattr->cf_dtype = DT_REG;
rc = -EOPNOTSUPP; /* or some unknown SFU type */ rc = -EOPNOTSUPP;
} }
CIFSSMBClose(xid, tcon, netfid); } else {
fattr->cf_mode |= S_IFREG; /* then it is a file */
fattr->cf_dtype = DT_REG;
rc = -EOPNOTSUPP; /* or some unknown SFU type */
} }
CIFSSMBClose(xid, tcon, netfid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment