572
572
int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
573
573
size_t op_size, void *user_data);
580
* Fuse filesystem object
582
* This is opaque object represents a filesystem layer
587
* These functions call the relevant filesystem operation, and return
590
* If the operation is not defined, they return -ENOSYS, with the
591
* exception of fuse_fs_open, fuse_fs_release, fuse_fs_opendir,
592
* fuse_fs_releasedir and fuse_fs_statfs, which return 0.
595
int fuse_fs_getattr(struct fuse_fs *fs, const char *path, struct stat *buf);
596
int fuse_fs_fgetattr(struct fuse_fs *fs, const char *path, struct stat *buf,
597
struct fuse_file_info *fi);
598
int fuse_fs_rename(struct fuse_fs *fs, const char *oldpath,
599
const char *newpath);
600
int fuse_fs_unlink(struct fuse_fs *fs, const char *path);
601
int fuse_fs_rmdir(struct fuse_fs *fs, const char *path);
602
int fuse_fs_symlink(struct fuse_fs *fs, const char *linkname,
604
int fuse_fs_link(struct fuse_fs *fs, const char *oldpath, const char *newpath);
605
int fuse_fs_release(struct fuse_fs *fs, const char *path,
606
struct fuse_file_info *fi);
607
int fuse_fs_open(struct fuse_fs *fs, const char *path,
608
struct fuse_file_info *fi);
609
int fuse_fs_read(struct fuse_fs *fs, const char *path, char *buf, size_t size,
610
off_t off, struct fuse_file_info *fi);
611
int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *buf,
612
size_t size, off_t off, struct fuse_file_info *fi);
613
int fuse_fs_fsync(struct fuse_fs *fs, const char *path, int datasync,
614
struct fuse_file_info *fi);
615
int fuse_fs_flush(struct fuse_fs *fs, const char *path,
616
struct fuse_file_info *fi);
617
int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *buf);
618
int fuse_fs_opendir(struct fuse_fs *fs, const char *path,
619
struct fuse_file_info *fi);
620
int fuse_fs_readdir(struct fuse_fs *fs, const char *path, void *buf,
621
fuse_fill_dir_t filler, off_t off,
622
struct fuse_file_info *fi);
623
int fuse_fs_fsyncdir(struct fuse_fs *fs, const char *path, int datasync,
624
struct fuse_file_info *fi);
625
int fuse_fs_releasedir(struct fuse_fs *fs, const char *path,
626
struct fuse_file_info *fi);
627
int fuse_fs_create(struct fuse_fs *fs, const char *path, mode_t mode,
628
struct fuse_file_info *fi);
629
int fuse_fs_lock(struct fuse_fs *fs, const char *path,
630
struct fuse_file_info *fi, int cmd, struct flock *lock);
631
int fuse_fs_chmod(struct fuse_fs *fs, const char *path, mode_t mode);
632
int fuse_fs_chown(struct fuse_fs *fs, const char *path, uid_t uid, gid_t gid);
633
int fuse_fs_truncate(struct fuse_fs *fs, const char *path, off_t size);
634
int fuse_fs_ftruncate(struct fuse_fs *fs, const char *path, off_t size,
635
struct fuse_file_info *fi);
636
int fuse_fs_utimens(struct fuse_fs *fs, const char *path,
637
const struct timespec tv[2]);
638
int fuse_fs_access(struct fuse_fs *fs, const char *path, int mask);
639
int fuse_fs_readlink(struct fuse_fs *fs, const char *path, char *buf,
641
int fuse_fs_mknod(struct fuse_fs *fs, const char *path, mode_t mode,
643
int fuse_fs_mkdir(struct fuse_fs *fs, const char *path, mode_t mode);
644
int fuse_fs_setxattr(struct fuse_fs *fs, const char *path, const char *name,
645
const char *value, size_t size, int flags);
646
int fuse_fs_getxattr(struct fuse_fs *fs, const char *path, const char *name,
647
char *value, size_t size);
648
int fuse_fs_listxattr(struct fuse_fs *fs, const char *path, char *list,
650
int fuse_fs_removexattr(struct fuse_fs *fs, const char *path,
652
int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize,
654
void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn);
655
void fuse_fs_destroy(struct fuse_fs *fs);
658
* Create a new fuse filesystem object
660
* This is usually called from the factory of a fuse module to create
661
* a new instance of a filesystem.
663
* @param op the filesystem operations
664
* @param op_size the size of the fuse_operations structure
665
* @param user_data user data supplied in the context during the init() method
666
* @return a new filesystem object
668
struct fuse_fs *fuse_fs_new(const struct fuse_operations *op, size_t op_size,
674
* Filesystem modules are registered with the FUSE_REGISTER_MODULE()
677
* If the "-omodules=modname:..." option is present, filesystem
678
* objects are created and pushed onto the stack with the 'factory'
688
* Factory for creating filesystem objects
690
* The function may use and remove options from 'args' that belong
693
* For now the 'fs' vector always contains exactly one filesystem.
694
* This is the filesystem which will be below the newly created
695
* filesystem in the stack.
697
* @param args the command line arguments
698
* @param fs NULL terminated filesystem object vector
699
* @return the new filesystem object
701
struct fuse_fs *(*factory)(struct fuse_args *args, struct fuse_fs *fs[]);
703
struct fuse_module *next;
704
struct fusemod_so *so;
709
* Register a filesystem module
711
* This function is used by FUSE_REGISTER_MODULE and there's usually
712
* no need to call it directly
714
void fuse_register_module(struct fuse_module *mod);
717
* Register filesystem module
719
* For the parameters, see description of the fields in 'struct
722
#define FUSE_REGISTER_MODULE(name_, factory_) \
723
static __attribute__((constructor)) void name_ ## _register(void) \
725
static struct fuse_module mod = { #name_, factory_, NULL, NULL, 0 }; \
726
fuse_register_module(&mod); \
575
730
/* ----------------------------------------------------------- *
576
731
* Advanced API for event handling, don't worry about this... *
577
732
* ----------------------------------------------------------- */