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,52 +346,40 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
struct TCP_Server_Info *server;
cifs_sb = CIFS_SB(m->mnt_sb);
if (cifs_sb) {
tcon = cifs_sb->tcon;
if (tcon) {
seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName);
if (tcon->ses) {
if (tcon->ses->userName)
seq_printf(s, ",username=%s",
tcon->ses->userName);
seq_printf(s, ",username=%s", tcon->ses->userName);
if (tcon->ses->domainName)
seq_printf(s, ",domain=%s",
tcon->ses->domainName);
seq_printf(s, ",domain=%s", tcon->ses->domainName);
cifs_show_address(s, tcon->ses->server);
seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
server = tcon->ses->server;
if (server) {
seq_printf(s, ",addr=");
switch (server->addr.sockAddr6.
sin6_family) {
switch (server->addr.sockAddr6.sin6_family) {
case AF_INET6:
seq_printf(s, "%pI6",
&server->addr.sockAddr6.sin6_addr);
seq_printf(s, "%pI6", &server->addr.sockAddr6.sin6_addr);
break;
case AF_INET:
seq_printf(s, "%pI4",
&server->addr.sockAddr.sin_addr.s_addr);
seq_printf(s, "%pI4", &server->addr.sockAddr.sin_addr.s_addr);
break;
}
}
}
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) {
if (!tcon->unix_ext)
seq_printf(s, ",file_mode=0%o,dir_mode=0%o",
cifs_sb->mnt_file_mode,
cifs_sb->mnt_dir_mode);
}
if (tcon->seal)
seq_printf(s, ",seal");
if (tcon->nocase)
seq_printf(s, ",nocase");
if (tcon->retry)
seq_printf(s, ",hard");
}
if (cifs_sb->prepath)
seq_printf(s, ",prepath=%s", cifs_sb->prepath);
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
......@@ -419,7 +407,7 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
seq_printf(s, ",rsize=%d", cifs_sb->rsize);
seq_printf(s, ",wsize=%d", cifs_sb->wsize);
}
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