diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-06-11 10:27:28 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-06-13 04:17:30 -0400 |
commit | 8616e0fc1e27295316f9821a883f0e9fa6f8200f (patch) | |
tree | 99b3b5c887cb8d4ba244c51fdc9d5ba95102f6b3 /fs/cifs | |
parent | f3ad116588151b3371ae4e092290e4f48e62b8bb (diff) |
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: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 130 |
1 files changed, 59 insertions, 71 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 0d92114195ab..3f121fbd6c56 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -346,80 +346,68 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) | |||
346 | struct TCP_Server_Info *server; | 346 | struct TCP_Server_Info *server; |
347 | 347 | ||
348 | cifs_sb = CIFS_SB(m->mnt_sb); | 348 | cifs_sb = CIFS_SB(m->mnt_sb); |
349 | tcon = cifs_sb->tcon; | ||
349 | 350 | ||
350 | if (cifs_sb) { | 351 | seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); |
351 | tcon = cifs_sb->tcon; | 352 | if (tcon->ses->userName) |
352 | if (tcon) { | 353 | seq_printf(s, ",username=%s", tcon->ses->userName); |
353 | seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); | 354 | if (tcon->ses->domainName) |
354 | if (tcon->ses) { | 355 | seq_printf(s, ",domain=%s", tcon->ses->domainName); |
355 | if (tcon->ses->userName) | 356 | |
356 | seq_printf(s, ",username=%s", | 357 | cifs_show_address(s, tcon->ses->server); |
357 | tcon->ses->userName); | 358 | |
358 | if (tcon->ses->domainName) | 359 | seq_printf(s, ",uid=%d", cifs_sb->mnt_uid); |
359 | seq_printf(s, ",domain=%s", | 360 | seq_printf(s, ",gid=%d", cifs_sb->mnt_gid); |
360 | tcon->ses->domainName); | 361 | |
361 | server = tcon->ses->server; | 362 | server = tcon->ses->server; |
362 | if (server) { | 363 | seq_printf(s, ",addr="); |
363 | seq_printf(s, ",addr="); | 364 | switch (server->addr.sockAddr6.sin6_family) { |
364 | switch (server->addr.sockAddr6. | 365 | case AF_INET6: |
365 | sin6_family) { | 366 | seq_printf(s, "%pI6", &server->addr.sockAddr6.sin6_addr); |
366 | case AF_INET6: | 367 | break; |
367 | seq_printf(s, "%pI6", | 368 | case AF_INET: |
368 | &server->addr.sockAddr6.sin6_addr); | 369 | seq_printf(s, "%pI4", &server->addr.sockAddr.sin_addr.s_addr); |
369 | break; | 370 | break; |
370 | case AF_INET: | 371 | } |
371 | seq_printf(s, "%pI4", | 372 | |
372 | &server->addr.sockAddr.sin_addr.s_addr); | 373 | if (!tcon->unix_ext) |
373 | break; | 374 | seq_printf(s, ",file_mode=0%o,dir_mode=0%o", |
374 | } | ||
375 | } | ||
376 | } | ||
377 | if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) || | ||
378 | !(tcon->unix_ext)) | ||
379 | seq_printf(s, ",uid=%d", cifs_sb->mnt_uid); | ||
380 | if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) || | ||
381 | !(tcon->unix_ext)) | ||
382 | seq_printf(s, ",gid=%d", cifs_sb->mnt_gid); | ||
383 | if (!tcon->unix_ext) { | ||
384 | seq_printf(s, ",file_mode=0%o,dir_mode=0%o", | ||
385 | cifs_sb->mnt_file_mode, | 375 | cifs_sb->mnt_file_mode, |
386 | cifs_sb->mnt_dir_mode); | 376 | cifs_sb->mnt_dir_mode); |
387 | } | 377 | if (tcon->seal) |
388 | if (tcon->seal) | 378 | seq_printf(s, ",seal"); |
389 | seq_printf(s, ",seal"); | 379 | if (tcon->nocase) |
390 | if (tcon->nocase) | 380 | seq_printf(s, ",nocase"); |
391 | seq_printf(s, ",nocase"); | 381 | if (tcon->retry) |
392 | if (tcon->retry) | 382 | seq_printf(s, ",hard"); |
393 | seq_printf(s, ",hard"); | 383 | if (cifs_sb->prepath) |
394 | } | 384 | seq_printf(s, ",prepath=%s", cifs_sb->prepath); |
395 | if (cifs_sb->prepath) | 385 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) |
396 | seq_printf(s, ",prepath=%s", cifs_sb->prepath); | 386 | seq_printf(s, ",posixpaths"); |
397 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) | 387 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) |
398 | seq_printf(s, ",posixpaths"); | 388 | seq_printf(s, ",setuids"); |
399 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) | 389 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) |
400 | seq_printf(s, ",setuids"); | 390 | seq_printf(s, ",serverino"); |
401 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) | 391 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) |
402 | seq_printf(s, ",serverino"); | 392 | seq_printf(s, ",directio"); |
403 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) | 393 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) |
404 | seq_printf(s, ",directio"); | 394 | seq_printf(s, ",nouser_xattr"); |
405 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) | 395 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR) |
406 | seq_printf(s, ",nouser_xattr"); | 396 | seq_printf(s, ",mapchars"); |
407 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR) | 397 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) |
408 | seq_printf(s, ",mapchars"); | 398 | seq_printf(s, ",sfu"); |
409 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) | 399 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) |
410 | seq_printf(s, ",sfu"); | 400 | seq_printf(s, ",nobrl"); |
411 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) | 401 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) |
412 | seq_printf(s, ",nobrl"); | 402 | seq_printf(s, ",cifsacl"); |
413 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) | 403 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) |
414 | seq_printf(s, ",cifsacl"); | 404 | seq_printf(s, ",dynperm"); |
415 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) | 405 | if (m->mnt_sb->s_flags & MS_POSIXACL) |
416 | seq_printf(s, ",dynperm"); | 406 | seq_printf(s, ",acl"); |
417 | if (m->mnt_sb->s_flags & MS_POSIXACL) | 407 | |
418 | seq_printf(s, ",acl"); | 408 | seq_printf(s, ",rsize=%d", cifs_sb->rsize); |
419 | 409 | seq_printf(s, ",wsize=%d", cifs_sb->wsize); | |
420 | seq_printf(s, ",rsize=%d", cifs_sb->rsize); | 410 | |
421 | seq_printf(s, ",wsize=%d", cifs_sb->wsize); | ||
422 | } | ||
423 | return 0; | 411 | return 0; |
424 | } | 412 | } |
425 | 413 | ||