mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
a51571ccb8
commit
93f1c20bc8
2 changed files with 17 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue