diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-01-29 18:43:38 +0530 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-15 02:21:45 -0400 |
commit | 93f1c20bc8cdb757be50566eff88d65c3b26881f (patch) | |
tree | 15e812c8127ddd795b8112f76832f6411953be62 /fs/namespace.c | |
parent | a51571ccb8be1b88aea502ebba8350519682c16d (diff) | |
download | kernel_samsung_smdk4412-93f1c20bc8cdb757be50566eff88d65c3b26881f.zip kernel_samsung_smdk4412-93f1c20bc8cdb757be50566eff88d65c3b26881f.tar.gz kernel_samsung_smdk4412-93f1c20bc8cdb757be50566eff88d65c3b26881f.tar.bz2 |
vfs: Export file system uuid via /proc/<pid>/mountinfo
We add a per superblock uuid field. File systems should
update the uuid in the fill_super callback
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index d1edf26..dffe6f4 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1002,6 +1002,18 @@ const struct seq_operations mounts_op = { .show = show_vfsmnt }; +static int uuid_is_nil(u8 *uuid) +{ + int i; + u8 *cp = (u8 *)uuid; + + for (i = 0; i < 16; i++) { + if (*cp++) + return 0; + } + return 1; +} + static int show_mountinfo(struct seq_file *m, void *v) { struct proc_mounts *p = m->private; @@ -1040,6 +1052,10 @@ static int show_mountinfo(struct seq_file *m, void *v) if (IS_MNT_UNBINDABLE(mnt)) seq_puts(m, " unbindable"); + if (!uuid_is_nil(mnt->mnt_sb->s_uuid)) + /* print the uuid */ + seq_printf(m, " uuid:%pU", mnt->mnt_sb->s_uuid); + /* Filesystem specific data */ seq_puts(m, " - "); show_type(m, sb); |