diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-06-11 10:27:32 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-06-15 09:42:30 -0400 |
commit | 61f98ffd74254a95871168bd5a6646b4f3002e31 (patch) | |
tree | c66a4df0ccc4bedc58c7b45125a99c0ac61bc4da /fs/cifs/cifsfs.c | |
parent | b70b92e41d95fd906f05f6e98f61209201495fa7 (diff) |
cifs: display scopeid in /proc/mounts
Move address display into a new function and display the scopeid as part
of the address in /proc/mounts.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 8b315708cb3f..ddef913ff3e6 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -333,6 +333,27 @@ cifs_destroy_inode(struct inode *inode) | |||
333 | kmem_cache_free(cifs_inode_cachep, CIFS_I(inode)); | 333 | kmem_cache_free(cifs_inode_cachep, CIFS_I(inode)); |
334 | } | 334 | } |
335 | 335 | ||
336 | static void | ||
337 | cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) | ||
338 | { | ||
339 | seq_printf(s, ",addr="); | ||
340 | |||
341 | switch (server->addr.sockAddr.sin_family) { | ||
342 | case AF_INET: | ||
343 | seq_printf(s, "%pI4", &server->addr.sockAddr.sin_addr.s_addr); | ||
344 | break; | ||
345 | case AF_INET6: | ||
346 | seq_printf(s, "%pI6", | ||
347 | &server->addr.sockAddr6.sin6_addr.s6_addr); | ||
348 | if (server->addr.sockAddr6.sin6_scope_id) | ||
349 | seq_printf(s, "%%%u", | ||
350 | server->addr.sockAddr6.sin6_scope_id); | ||
351 | break; | ||
352 | default: | ||
353 | seq_printf(s, "(unknown)"); | ||
354 | } | ||
355 | } | ||
356 | |||
336 | /* | 357 | /* |
337 | * cifs_show_options() is for displaying mount options in /proc/mounts. | 358 | * cifs_show_options() is for displaying mount options in /proc/mounts. |
338 | * Not all settable options are displayed but most of the important | 359 | * Not all settable options are displayed but most of the important |
@@ -343,7 +364,6 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) | |||
343 | { | 364 | { |
344 | struct cifs_sb_info *cifs_sb; | 365 | struct cifs_sb_info *cifs_sb; |
345 | struct cifsTconInfo *tcon; | 366 | struct cifsTconInfo *tcon; |
346 | struct TCP_Server_Info *server; | ||
347 | 367 | ||
348 | cifs_sb = CIFS_SB(m->mnt_sb); | 368 | cifs_sb = CIFS_SB(m->mnt_sb); |
349 | tcon = cifs_sb->tcon; | 369 | tcon = cifs_sb->tcon; |
@@ -364,16 +384,7 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) | |||
364 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) | 384 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) |
365 | seq_printf(s, ",forcegid"); | 385 | seq_printf(s, ",forcegid"); |
366 | 386 | ||
367 | server = tcon->ses->server; | 387 | cifs_show_address(s, tcon->ses->server); |
368 | seq_printf(s, ",addr="); | ||
369 | switch (server->addr.sockAddr6.sin6_family) { | ||
370 | case AF_INET6: | ||
371 | seq_printf(s, "%pI6", &server->addr.sockAddr6.sin6_addr); | ||
372 | break; | ||
373 | case AF_INET: | ||
374 | seq_printf(s, "%pI4", &server->addr.sockAddr.sin_addr.s_addr); | ||
375 | break; | ||
376 | } | ||
377 | 388 | ||
378 | if (!tcon->unix_ext) | 389 | if (!tcon->unix_ext) |
379 | seq_printf(s, ",file_mode=0%o,dir_mode=0%o", | 390 | seq_printf(s, ",file_mode=0%o,dir_mode=0%o", |