1 #ifndef __WVFUSECMDHELPER_H
2 #define __WVFUSECMDHELPER_H
5 #include <sys/statfs.h>
7 #ifndef FUSE_KERNEL_VERSION
8 #include <linux/fuse.h>
11 inline void convert_stat(struct stat
*stbuf
, fuse_attr
*attr
)
13 attr
->mode
= stbuf
->st_mode
;
14 attr
->nlink
= stbuf
->st_nlink
;
15 attr
->uid
= stbuf
->st_uid
;
16 attr
->gid
= stbuf
->st_gid
;
17 attr
->rdev
= stbuf
->st_rdev
;
18 attr
->size
= stbuf
->st_size
;
19 attr
->blocks
= stbuf
->st_blocks
;
20 attr
->atime
= stbuf
->st_atime
;
21 attr
->mtime
= stbuf
->st_mtime
;
22 attr
->ctime
= stbuf
->st_ctime
;
25 inline void convert_statfs(struct statfs
*st
, fuse_kstatfs
*fst
)
27 fst
->block_size
= st
->f_bsize
;
28 fst
->blocks
= st
->f_blocks
;
29 fst
->blocks_free
= st
->f_bavail
;
30 fst
->files
= st
->f_files
;
31 fst
->files_free
= st
->f_ffree
;
32 fst
->namelen
= st
->f_namelen
;