📄 intermezzo_fs.h
字号:
# define LENTO_FL_WRITE_KML 0x0010# define LENTO_FL_CANCEL_LML 0x0020# define LENTO_FL_WRITE_EXPECT 0x0040# define LENTO_FL_IGNORE_TIME 0x0080# define LENTO_FL_TOUCH_PARENT 0x0100# define LENTO_FL_TOUCH_NEWOBJ 0x0200# define LENTO_FL_SET_DDFILEID 0x0400struct presto_cache *presto_get_cache(struct inode *inode);int presto_sprint_mounts(char *buf, int buflen, int minor);struct presto_file_set *presto_fset(struct dentry *de);int presto_journal(struct dentry *dentry, char *buf, size_t size);int presto_fwrite(struct file *file, const char *str, int len, loff_t *off);int presto_ispresto(struct inode *);/* super.c */extern struct file_system_type presto_fs_type;extern int init_intermezzo_fs(void);/* fileset.c */extern int izo_prepare_fileset(struct dentry *root, char *fsetname);char * izo_make_path(struct presto_file_set *fset, char *name);struct file *izo_fset_open(struct presto_file_set *fset, char *name, int flags, int mode);/* psdev.c */int izo_psdev_get_free_channel(void);int presto_psdev_init(void);int izo_psdev_setpid(int minor);extern void presto_psdev_cleanup(void);inline int presto_lento_up(int minor);int izo_psdev_setchannel(struct file *file, int fd);/* inode.c */extern struct super_operations presto_super_ops;void presto_set_ops(struct inode *inode, struct filter_fs *filter);/* dcache.c */void presto_frob_dop(struct dentry *de);char *presto_path(struct dentry *dentry, struct dentry *root, char *buffer, int buflen);inline struct presto_dentry_data *izo_alloc_ddata(void);int presto_set_dd(struct dentry *);int presto_init_ddata_cache(void);void presto_cleanup_ddata_cache(void);extern struct dentry_operations presto_dentry_ops;/* dir.c */extern struct inode_operations presto_dir_iops;extern struct inode_operations presto_file_iops;extern struct inode_operations presto_sym_iops;extern struct file_operations presto_dir_fops;extern struct file_operations presto_file_fops;extern struct file_operations presto_sym_fops;int presto_setattr(struct dentry *de, struct iattr *iattr);int presto_settime(struct presto_file_set *fset, struct dentry *newobj, struct dentry *parent, struct dentry *target, struct lento_vfs_context *ctx, int valid);int presto_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);extern int presto_ilookup_uid;# define PRESTO_ILOOKUP_MAGIC "...ino:"# define PRESTO_ILOOKUP_SEP ':'int izo_dentry_is_ilookup(struct dentry *, ino_t *id, unsigned int *generation);struct dentry *presto_lookup(struct inode * dir, struct dentry *dentry);struct presto_dentry_data { int dd_count; /* how mnay dentries are using this dentry */ struct presto_file_set *dd_fset; struct dentry *dd_inodentry; loff_t dd_kml_offset; int dd_flags; __u64 remote_ino; __u64 remote_generation;};struct presto_file_data { int fd_do_lml; loff_t fd_lml_offset; size_t fd_bytes_written; /* authorization related data of file at open time */ uid_t fd_uid; gid_t fd_gid; mode_t fd_mode; /* identification data of calling process */ uid_t fd_fsuid; gid_t fd_fsgid; int fd_ngroups; gid_t fd_groups[NGROUPS_MAX]; /* information how to complete the close operation */ struct lento_vfs_context fd_info; struct presto_version fd_version;};/* presto.c and Lento::Downcall */int presto_walk(const char *name, struct nameidata *nd);int izo_clear_fsetroot(struct dentry *dentry);int izo_clear_all_fsetroots(struct presto_cache *cache);int presto_get_kmlsize(char *path, __u64 *size);int presto_get_lastrecno(char *path, off_t *size);int presto_set_fsetroot(struct dentry *dentry, char *fsetname, unsigned int flags);int presto_set_fsetroot_from_ioc(struct dentry *dentry, char *fsetname, unsigned int flags);inline int presto_is_read_only(struct presto_file_set *);int presto_truncate_lml(struct presto_file_set *fset);int lento_write_lml(char *path, __u64 remote_ino, __u32 remote_generation, __u32 remote_version, struct presto_version *remote_file_version);int lento_complete_closes(char *path);inline int presto_f2m(struct presto_file_set *fset);int presto_prep(struct dentry *, struct presto_cache **, struct presto_file_set **);/* cache.c */extern struct presto_cache *presto_cache_init(void);extern inline void presto_cache_add(struct presto_cache *cache, kdev_t dev);extern inline void presto_cache_init_hash(void);struct presto_cache *presto_cache_find(kdev_t dev);#define PRESTO_REQLOW (3 * 4096)#define PRESTO_REQHIGH (6 * 4096)void presto_release_space(struct presto_cache *cache, loff_t req);int presto_reserve_space(struct presto_cache *cache, loff_t req);#define PRESTO_DATA 0x00000002 /* cached data is valid */#define PRESTO_ATTR 0x00000004 /* attributes cached */#define PRESTO_DONT_JOURNAL 0x00000008 /* things like .intermezzo/ */struct presto_file_set *presto_path2fileset(const char *name);int izo_revoke_permit(struct dentry *, uuid_t uuid);int presto_chk(struct dentry *dentry, int flag);void presto_set(struct dentry *dentry, int flag);int presto_get_permit(struct inode *inode);int presto_put_permit(struct inode *inode);int presto_set_max_kml_size(const char *path, unsigned long max_size);int izo_mark_dentry(struct dentry *dentry, int and, int or, int *res);int izo_mark_cache(struct dentry *dentry, int and_bits, int or_bits, int *);int izo_mark_fset(struct dentry *dentry, int and_bits, int or_bits, int *);void presto_getversion(struct presto_version *pv, struct inode *inode);int presto_i2m(struct inode *inode);int presto_c2m(struct presto_cache *cache);/* file.c */int izo_purge_file(struct presto_file_set *fset, char *file);int presto_adjust_lml(struct file *file, struct lento_vfs_context *info);/* journal.c */struct rec_info { loff_t offset; int size; int recno; int is_kml;};void presto_trans_commit(struct presto_file_set *fset, void *handle);void *presto_trans_start(struct presto_file_set *fset, struct inode *inode, int op);int presto_fread(struct file *file, char *str, int len, loff_t *off);int presto_clear_lml_close(struct presto_file_set *fset, loff_t lml_offset);int presto_complete_lml(struct presto_file_set *fset);int presto_read_kml_logical_offset(struct rec_info *recinfo, struct presto_file_set *fset);int presto_write_kml_logical_offset(struct presto_file_set *fset);struct file *presto_copy_kml_tail(struct presto_file_set *fset, unsigned long int start);int presto_finish_kml_truncate(struct presto_file_set *fset, unsigned long int offset);int izo_lookup_file(struct presto_file_set *fset, char *path, struct nameidata *nd);int izo_do_truncate(struct presto_file_set *fset, struct dentry *dentry, loff_t length, loff_t size_check);int izo_log_close(struct presto_log_fd *logfd);struct file *izo_log_open(struct presto_file_set *fset, char *name, int flags);int izo_init_kml_file(struct presto_file_set *, struct presto_log_fd *);int izo_init_lml_file(struct presto_file_set *, struct presto_log_fd *);int izo_init_last_rcvd_file(struct presto_file_set *, struct presto_log_fd *);/* vfs.c *//* Extra data needed in the KML for rollback operations; this structure is * passed around during the KML-writing process. */struct izo_rollback_data { __u32 rb_mode; __u32 rb_rdev; __u64 rb_uid; __u64 rb_gid;};int presto_write_last_rcvd(struct rec_info *recinfo, struct presto_file_set *fset, struct lento_vfs_context *info);void izo_get_rollback_data(struct inode *inode, struct izo_rollback_data *rb);int presto_do_close(struct presto_file_set *fset, struct file *file);int presto_do_setattr(struct presto_file_set *fset, struct dentry *dentry, struct iattr *iattr, struct lento_vfs_context *info);int presto_do_create(struct presto_file_set *fset, struct dentry *dir, struct dentry *dentry, int mode, struct lento_vfs_context *info);int presto_do_link(struct presto_file_set *fset, struct dentry *dir, struct dentry *old_dentry, struct dentry *new_dentry, struct lento_vfs_context *info);int presto_do_unlink(struct presto_file_set *fset, struct dentry *dir, struct dentry *dentry, struct lento_vfs_context *info);int presto_do_symlink(struct presto_file_set *fset, struct dentry *dir, struct dentry *dentry, const char *name, struct lento_vfs_context *info);int presto_do_mkdir(struct presto_file_set *fset, struct dentry *dir, struct dentry *dentry, int mode, struct lento_vfs_context *info);int presto_do_rmdir(struct presto_file_set *fset, struct dentry *dir, struct dentry *dentry, struct lento_vfs_context *info);int presto_do_mknod(struct presto_file_set *fset, struct dentry *dir, struct dentry *dentry, int mode, dev_t dev, struct lento_vfs_context *info);int do_rename(struct presto_file_set *fset, struct dentry *old_dir, struct dentry *old_dentry, struct dentry *new_dir, struct dentry *new_dentry, struct lento_vfs_context *info);int presto_do_statfs (struct presto_file_set *fset, struct statfs * buf);int lento_setattr(const char *name, struct iattr *iattr, struct lento_vfs_context *info);int lento_create(const char *name, int mode, struct lento_vfs_context *info);int lento_link(const char *oldname, const char *newname, struct lento_vfs_context *info);int lento_unlink(const char *name, struct lento_vfs_context *info);int lento_symlink(const char *oldname,const char *newname, struct lento_vfs_context *info);int lento_mkdir(const char *name, int mode, struct lento_vfs_context *info);int lento_rmdir(const char *name, struct lento_vfs_context *info);int lento_mknod(const char *name, int mode, dev_t dev, struct lento_vfs_context *info);int lento_rename(const char *oldname, const char *newname, struct lento_vfs_context *info);int lento_iopen(const char *name, ino_t ino, unsigned int generation,int flags);/* journal.c */#define JOURNAL_PAGE_SZ PAGE_SIZE__inline__ int presto_no_journal(struct presto_file_set *fset);int journal_fetch(int minor);int presto_log(struct presto_file_set *fset, struct rec_info *rec, const char *buf, size_t size, const char *string1, int len1, const char *string2, int len2, const char *string3, int len3);int presto_get_fileid(int minor, struct presto_file_set *fset, struct dentry *dentry);int presto_journal_setattr(struct rec_info *rec, struct presto_file_set *fset, struct dentry *dentry, struct presto_version *old_ver, struct izo_rollback_data *, struct iattr *iattr);int presto_journal_create(struct rec_info *rec, struct presto_file_set *fset, struct dentry *dentry, struct presto_version *tgt_dir_ver, struct presto_version *new_file_ver, int mode);int presto_journal_link(struct rec_info *rec, struct presto_file_set *fset, struct dentry *src, struct dentry *tgt, struct presto_version *tgt_dir_ver, struct presto_version *new_link_ver);int presto_journal_unlink(struct rec_info *rec, struct presto_file_set *fset, struct dentry *dir, struct presto_version *tgt_dir_ver, struct presto_version *old_file_ver, struct izo_rollback_data *, struct dentry *dentry, char *old_target, int old_targetlen);int presto_journal_symlink(struct rec_info *rec, struct presto_file_set *fset, struct dentry *dentry, const char *target, struct presto_version *tgt_dir_ver, struct presto_version *new_link_ver);int presto_journal_mkdir(struct rec_info *rec, struct presto_file_set *fset, struct dentry *dentry, struct presto_version *tgt_dir_ver, struct presto_version *new_dir_ver, int mode);int presto_journal_rmdir(struct rec_info *rec, struct presto_file_set *fset, struct dentry *dentry, struct presto_version *tgt_dir_ver, struct presto_version *old_dir_ver, struct izo_rollback_data *, int len, const char *name);int presto_journal_mknod(struct rec_info *rec, struct presto_file_set *fset, struct dentry *dentry, struct presto_version *tgt_dir_ver, struct presto_version *new_node_ver, int mode, int dmajor, int dminor);int presto_journal_rename(struct rec_info *rec, struct presto_file_set *fset, struct dentry *src, struct dentry *tgt, struct presto_version *src_dir_ver, struct presto_version *tgt_dir_ver);int presto_journal_open(struct rec_info *, struct presto_file_set *, struct dentry *, struct presto_version *old_ver);int presto_journal_close(struct rec_info *rec, struct presto_file_set *, struct file *, struct dentry *, struct presto_version *old_file_ver, struct presto_version *new_file_ver);int presto_write_lml_close(struct rec_info *rec, struct presto_file_set *fset, struct file *file, __u64 remote_ino, __u64 remote_generation, struct presto_version *remote_version, struct presto_version *new_file_ver);void presto_log_op(void *data, int len);loff_t presto_kml_offset(struct presto_file_set *fset);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -