Commit 8616e0fc authored by Jeff Layton's avatar Jeff Layton Committed by Steve French

cifs: remove unneeded NULL checks from cifs_show_options

show_options is always called with the namespace_sem held. Therefore we
don't need to worry about the vfsmount being NULL, or it vanishing while
the function is running. By the same token, there's no need to worry
about the superblock, tcon, smb or tcp sessions being NULL on entry.
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent f3ad1165
...@@ -346,80 +346,68 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) ...@@ -346,80 +346,68 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
cifs_sb = CIFS_SB(m->mnt_sb); cifs_sb = CIFS_SB(m->mnt_sb);
tcon = cifs_sb->tcon;
if (cifs_sb) { seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName);
tcon = cifs_sb->tcon; if (tcon->ses->userName)
if (tcon) { seq_printf(s, ",username=%s", tcon->ses->userName);
seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); if (tcon->ses->domainName)
if (tcon->ses) { seq_printf(s, ",domain=%s", tcon->ses->domainName);
if (tcon->ses->userName)
seq_printf(s, ",username=%s", cifs_show_address(s, tcon->ses->server);
tcon->ses->userName);
if (tcon->ses->domainName) seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
seq_printf(s, ",domain=%s", seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
tcon->ses->domainName);
server = tcon->ses->server; server = tcon->ses->server;
if (server) { seq_printf(s, ",addr=");
seq_printf(s, ",addr="); switch (server->addr.sockAddr6.sin6_family) {
switch (server->addr.sockAddr6. case AF_INET6:
sin6_family) { seq_printf(s, "%pI6", &server->addr.sockAddr6.sin6_addr);
case AF_INET6: break;
seq_printf(s, "%pI6", case AF_INET:
&server->addr.sockAddr6.sin6_addr); seq_printf(s, "%pI4", &server->addr.sockAddr.sin_addr.s_addr);
break; break;
case AF_INET: }
seq_printf(s, "%pI4",
&server->addr.sockAddr.sin_addr.s_addr); if (!tcon->unix_ext)
break; seq_printf(s, ",file_mode=0%o,dir_mode=0%o",
}
}
}
if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) ||
!(tcon->unix_ext))
seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) ||
!(tcon->unix_ext))
seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
if (!tcon->unix_ext) {
seq_printf(s, ",file_mode=0%o,dir_mode=0%o",
cifs_sb->mnt_file_mode, cifs_sb->mnt_file_mode,
cifs_sb->mnt_dir_mode); cifs_sb->mnt_dir_mode);
} if (tcon->seal)
if (tcon->seal) seq_printf(s, ",seal");
seq_printf(s, ",seal"); if (tcon->nocase)
if (tcon->nocase) seq_printf(s, ",nocase");
seq_printf(s, ",nocase"); if (tcon->retry)
if (tcon->retry) seq_printf(s, ",hard");
seq_printf(s, ",hard"); if (cifs_sb->prepath)
} seq_printf(s, ",prepath=%s", cifs_sb->prepath);
if (cifs_sb->prepath) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
seq_printf(s, ",prepath=%s", cifs_sb->prepath); seq_printf(s, ",posixpaths");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)
seq_printf(s, ",posixpaths"); seq_printf(s, ",setuids");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
seq_printf(s, ",setuids"); seq_printf(s, ",serverino");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
seq_printf(s, ",serverino"); seq_printf(s, ",directio");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
seq_printf(s, ",directio"); seq_printf(s, ",nouser_xattr");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)
seq_printf(s, ",nouser_xattr"); seq_printf(s, ",mapchars");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
seq_printf(s, ",mapchars"); seq_printf(s, ",sfu");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
seq_printf(s, ",sfu"); seq_printf(s, ",nobrl");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
seq_printf(s, ",nobrl"); seq_printf(s, ",cifsacl");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
seq_printf(s, ",cifsacl"); seq_printf(s, ",dynperm");
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) if (m->mnt_sb->s_flags & MS_POSIXACL)
seq_printf(s, ",dynperm"); seq_printf(s, ",acl");
if (m->mnt_sb->s_flags & MS_POSIXACL)
seq_printf(s, ",acl"); seq_printf(s, ",rsize=%d", cifs_sb->rsize);
seq_printf(s, ",wsize=%d", cifs_sb->wsize);
seq_printf(s, ",rsize=%d", cifs_sb->rsize);
seq_printf(s, ",wsize=%d", cifs_sb->wsize);
}
return 0; return 0;
} }
......
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