Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Amir Goldstein and committed by
Jan Kara
ec86ff56 77115225

+17
+14
fs/statfs.c
··· 67 67 return retval; 68 68 } 69 69 70 + int vfs_get_fsid(struct dentry *dentry, __kernel_fsid_t *fsid) 71 + { 72 + struct kstatfs st; 73 + int error; 74 + 75 + error = statfs_by_dentry(dentry, &st); 76 + if (error) 77 + return error; 78 + 79 + *fsid = st.f_fsid; 80 + return 0; 81 + } 82 + EXPORT_SYMBOL(vfs_get_fsid); 83 + 70 84 int vfs_statfs(const struct path *path, struct kstatfs *buf) 71 85 { 72 86 int error;
+3
include/linux/statfs.h
··· 41 41 #define ST_NODIRATIME 0x0800 /* do not update directory access times */ 42 42 #define ST_RELATIME 0x1000 /* update atime relative to mtime/ctime */ 43 43 44 + struct dentry; 45 + extern int vfs_get_fsid(struct dentry *dentry, __kernel_fsid_t *fsid); 46 + 44 47 #endif