mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
statx: add mount ID
Systemd is hacking around to get it and it's trivial to add to statx, so... Cc: linux-api@vger.kernel.org Cc: linux-man@vger.kernel.org Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <asm/unistd.h>
|
||||
|
||||
#include "internal.h"
|
||||
#include "mount.h"
|
||||
|
||||
/**
|
||||
* generic_fillattr - Fill in the basic attributes from the inode struct
|
||||
@@ -199,6 +200,8 @@ retry:
|
||||
goto out;
|
||||
|
||||
error = vfs_getattr(&path, stat, request_mask, flags);
|
||||
stat->mnt_id = real_mount(path.mnt)->mnt_id;
|
||||
stat->result_mask |= STATX_MNT_ID;
|
||||
path_put(&path);
|
||||
if (retry_estale(error, lookup_flags)) {
|
||||
lookup_flags |= LOOKUP_REVAL;
|
||||
@@ -563,6 +566,7 @@ cp_statx(const struct kstat *stat, struct statx __user *buffer)
|
||||
tmp.stx_rdev_minor = MINOR(stat->rdev);
|
||||
tmp.stx_dev_major = MAJOR(stat->dev);
|
||||
tmp.stx_dev_minor = MINOR(stat->dev);
|
||||
tmp.stx_mnt_id = stat->mnt_id;
|
||||
|
||||
return copy_to_user(buffer, &tmp, sizeof(tmp)) ? -EFAULT : 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user