From 061d60b82f85e47fd1395a2d5f89b91a20de8be0 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 2 Jan 2017 11:58:49 +0300 Subject: [PATCH] Modify VFS APIs. * vfs_s_stat: make public. * vfs_s_lstat: likewise. * vfs_s_fstat: likewise. Signed-off-by: Andrew Borodin --- lib/vfs/direntry.c | 50 +++++++++++++++++++++++----------------------- lib/vfs/vfs.h | 3 +++ 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c index 0515b377e..69fa3fbf6 100644 --- a/lib/vfs/direntry.c +++ b/lib/vfs/direntry.c @@ -496,31 +496,6 @@ vfs_s_internal_stat (const vfs_path_t * vpath, struct stat *buf, int flag) /* --------------------------------------------------------------------------------------------- */ -static int -vfs_s_stat (const vfs_path_t * vpath, struct stat *buf) -{ - return vfs_s_internal_stat (vpath, buf, FL_FOLLOW); -} - -/* --------------------------------------------------------------------------------------------- */ - -static int -vfs_s_lstat (const vfs_path_t * vpath, struct stat *buf) -{ - return vfs_s_internal_stat (vpath, buf, FL_NONE); -} - -/* --------------------------------------------------------------------------------------------- */ - -static int -vfs_s_fstat (void *fh, struct stat *buf) -{ - *buf = FH->ino->st; - return 0; -} - -/* --------------------------------------------------------------------------------------------- */ - static int vfs_s_readlink (const vfs_path_t * vpath, char *buf, size_t size) { @@ -1327,6 +1302,31 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) /* --------------------------------------------------------------------------------------------- */ +int +vfs_s_stat (const vfs_path_t * vpath, struct stat *buf) +{ + return vfs_s_internal_stat (vpath, buf, FL_FOLLOW); +} + +/* --------------------------------------------------------------------------------------------- */ + +int +vfs_s_lstat (const vfs_path_t * vpath, struct stat *buf) +{ + return vfs_s_internal_stat (vpath, buf, FL_NONE); +} + +/* --------------------------------------------------------------------------------------------- */ + +int +vfs_s_fstat (void *fh, struct stat *buf) +{ + *buf = FH->ino->st; + return 0; +} + +/* --------------------------------------------------------------------------------------------- */ + int vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino) { diff --git a/lib/vfs/vfs.h b/lib/vfs/vfs.h index a4d4c8dd1..5cfb6ec8f 100644 --- a/lib/vfs/vfs.h +++ b/lib/vfs/vfs.h @@ -226,6 +226,9 @@ extern int use_netrc; /* lib/vfs/direntry.c: */ void *vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode); +int vfs_s_stat (const vfs_path_t * vpath, struct stat *buf); +int vfs_s_lstat (const vfs_path_t * vpath, struct stat *buf); +int vfs_s_fstat (void *fh, struct stat *buf); vfsid vfs_getid (const vfs_path_t * vpath);