2011-11-14 12:53:05 +01:00
|
|
|
#ifndef PUFFS_PROTO_H
|
|
|
|
#define PUFFS_PROTO_H
|
|
|
|
|
2012-02-01 12:44:26 +01:00
|
|
|
struct puffs_usermount;
|
|
|
|
struct puffs_node;
|
|
|
|
|
2011-11-14 12:53:05 +01:00
|
|
|
/* Function prototypes. */
|
|
|
|
|
|
|
|
/* inode.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_putnode(ino_t ino_nr, unsigned int count);
|
2012-03-24 16:16:34 +01:00
|
|
|
void release_node(struct puffs_usermount *pu, struct puffs_node *pn );
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* link.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_trunc(ino_t ino_nr, off_t start, off_t end);
|
|
|
|
int fs_link(ino_t dir_nr, char *name, ino_t ino_nr);
|
|
|
|
ssize_t fs_rdlink(ino_t ino_nr, struct fsdriver_data *data, size_t bytes);
|
|
|
|
int fs_rename(ino_t old_dir_nr, char *old_name, ino_t new_dir_nr,
|
|
|
|
char *new_name);
|
|
|
|
int fs_unlink(ino_t dir_nr, char *name, int call);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* misc.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
void fs_sync(void);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* mount.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_mount(dev_t dev, unsigned int flags, struct fsdriver_node *root_node,
|
|
|
|
unsigned int *res_flags);
|
|
|
|
void fs_unmount(void);
|
|
|
|
int fs_mountpt(ino_t ino_nr);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* open.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_create(ino_t dir_nr, char *name, mode_t mode, uid_t uid, gid_t gid,
|
|
|
|
struct fsdriver_node *node);
|
|
|
|
int fs_mkdir(ino_t dir_nr, char *name, mode_t mode, uid_t uid, gid_t gid);
|
|
|
|
int fs_mknod(ino_t dir_nr, char *name, mode_t mode, uid_t uid, gid_t gid,
|
|
|
|
dev_t dev);
|
|
|
|
int fs_slink(ino_t dir_nr, char *name, uid_t uid, gid_t gid,
|
|
|
|
struct fsdriver_data *data, size_t bytes);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* path.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_lookup(ino_t dir_nr, char *name, struct fsdriver_node *node,
|
|
|
|
int *is_mountpt);
|
|
|
|
struct puffs_node *advance(struct puffs_node *dirp, char string[NAME_MAX + 1]);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* protect.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_chmod(ino_t ino_nr, mode_t *mode);
|
|
|
|
int fs_chown(ino_t ino_nr, uid_t uid, gid_t gid, mode_t *mode);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* read.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
ssize_t fs_read(ino_t ino_nr, struct fsdriver_data *data, size_t bytes,
|
|
|
|
off_t pos, int call);
|
|
|
|
ssize_t fs_write(ino_t ino_nr, struct fsdriver_data *data, size_t bytes,
|
|
|
|
off_t pos, int call);
|
|
|
|
ssize_t fs_getdents(ino_t ino_nr, struct fsdriver_data *data, size_t bytes,
|
|
|
|
off_t *pos);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* stadir.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_stat(ino_t ino, struct stat *statbuf);
|
|
|
|
int fs_statvfs(struct statvfs *st);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* time.c */
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_utime(ino_t ino_nr, struct timespec *atime, struct timespec *mtime);
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
/* utility.c */
|
2013-04-07 10:42:26 +02:00
|
|
|
int update_timens(struct puffs_node *pn, int fl, struct timespec *);
|
2014-08-24 11:51:35 +02:00
|
|
|
void lpuffs_debug(const char *format, ...)
|
|
|
|
__attribute__((__format__(__printf__, 1, 2)));
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
#endif /* PUFFS_PROTO_H */
|