summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2019-01-10 19:04:38 +0200
committerJan Kara <jack@suse.cz>2019-02-07 16:38:35 +0100
commitec86ff5689ff9605e2d57e016098764ad9a2fee5 (patch)
treef5676c9aaa576a90e51ff47ae4d9dfe64daae9f5 /fs
parent77115225acc67d9ac4b15f04dd138006b9cd1ef2 (diff)
downloadlinux-ec86ff5689ff9605e2d57e016098764ad9a2fee5.tar.gz
linux-ec86ff5689ff9605e2d57e016098764ad9a2fee5.tar.bz2
linux-ec86ff5689ff9605e2d57e016098764ad9a2fee5.zip
vfs: add vfs_get_fsid() helper
Wrapper around statfs() interface. Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/statfs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/statfs.c b/fs/statfs.c
index f0216629621d..eea7af6f2f22 100644
--- a/fs/statfs.c
+++ b/fs/statfs.c
@@ -67,6 +67,20 @@ static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf)
return retval;
}
+int vfs_get_fsid(struct dentry *dentry, __kernel_fsid_t *fsid)
+{
+ struct kstatfs st;
+ int error;
+
+ error = statfs_by_dentry(dentry, &st);
+ if (error)
+ return error;
+
+ *fsid = st.f_fsid;
+ return 0;
+}
+EXPORT_SYMBOL(vfs_get_fsid);
+
int vfs_statfs(const struct path *path, struct kstatfs *buf)
{
int error;