diff options
author | Steve French <stfrench@microsoft.com> | 2020-12-14 20:08:10 -0600 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-12-15 15:12:51 -0600 |
commit | 653a5efb849aea1706648257c3c23ece82997f44 (patch) | |
tree | 40a3d5d7df0f85666840a8ca7769968a82987bbe /fs/cifs | |
parent | 5c4b642141eb3576213ab59d06ba12e1fa989046 (diff) | |
download | linux-653a5efb849aea1706648257c3c23ece82997f44.tar.bz2 |
cifs: update super_operations to show_devname
This is needed so that we display the correct //server/share vs
\\server\share in /proc/mounts for the device name (in the new
mount API).
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 4c385eeecc05..a19387fe8b47 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -463,6 +463,25 @@ cifs_show_cache_flavor(struct seq_file *s, struct cifs_sb_info *cifs_sb) } /* + * cifs_show_devname() is used so we show the mount device name with correct + * format (e.g. forward slashes vs. back slashes) in /proc/mounts + */ +static int cifs_show_devname(struct seq_file *m, struct dentry *root) +{ + struct cifs_sb_info *cifs_sb = CIFS_SB(root->d_sb); + char *devname = kstrdup(cifs_sb->ctx->UNC, GFP_KERNEL); + + if (devname == NULL) + seq_puts(m, "none"); + else { + convert_delimiter(devname, '/'); + seq_puts(m, devname); + kfree(devname); + } + return 0; +} + +/* * cifs_show_options() is for displaying mount options in /proc/mounts. * Not all settable options are displayed but most of the important * ones are. @@ -695,6 +714,8 @@ static const struct super_operations cifs_super_ops = { .free_inode = cifs_free_inode, .drop_inode = cifs_drop_inode, .evict_inode = cifs_evict_inode, +/* .show_path = cifs_show_path, */ /* Would we ever need show path? */ + .show_devname = cifs_show_devname, /* .delete_inode = cifs_delete_inode, */ /* Do not need above function unless later we add lazy close of inodes or unless the kernel forgets to call us with the same number of releases (closes) |