ea19bfdfc2205af178a70915054c809ed2b8709eTimo Sirainenextern struct fs_api_module_register fs_api_module_register;
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen enum fs_properties (*get_properties)(struct fs *fs);
86ad48a2e740bd63a9b7299d7f3e229831d9b303Timo Sirainen void (*file_init)(struct fs_file *file, const char *path,
86ad48a2e740bd63a9b7299d7f3e229831d9b303Timo Sirainen enum fs_open_mode mode, enum fs_open_flags flags);
3dcb9fd82c1edd40bea1ad572ed39f024686e463Timo Sirainen const char *(*get_path)(struct fs_file *file);
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen void (*set_async_callback)(struct fs_file *file,
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen void (*set_metadata)(struct fs_file *file, const char *key,
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen const char *value);
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen bool (*prefetch)(struct fs_file *file, uoff_t length);
c33d3f93abf8392fdc60e12bea41ffd12cc85a8dTimo Sirainen ssize_t (*read)(struct fs_file *file, void *buf, size_t size);
c33d3f93abf8392fdc60e12bea41ffd12cc85a8dTimo Sirainen struct istream *(*read_stream)(struct fs_file *file,
c33d3f93abf8392fdc60e12bea41ffd12cc85a8dTimo Sirainen int (*write)(struct fs_file *file, const void *data, size_t size);
a0cf7d3924dec409e6eadaf3237fcecd4194ec75Timo Sirainen /* After write_stream_finish() is called once, all the following
a0cf7d3924dec409e6eadaf3237fcecd4194ec75Timo Sirainen (async) calls will have success==TRUE. */
c33d3f93abf8392fdc60e12bea41ffd12cc85a8dTimo Sirainen int (*write_stream_finish)(struct fs_file *file, bool success);
c33d3f93abf8392fdc60e12bea41ffd12cc85a8dTimo Sirainen int (*lock)(struct fs_file *file, unsigned int secs,
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen int (*stat)(struct fs_file *file, struct stat *st_r);
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen int (*copy)(struct fs_file *src, struct fs_file *dest);
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen int (*rename)(struct fs_file *src, struct fs_file *dest);
4d71d712b42285afbd2a997f3408142ef0d5f899Timo Sirainen void (*iter_init)(struct fs_iter *iter, const char *path,
c59b9c273b41f7bcf51f6803110b67813879ff05Timo Sirainen const char *(*iter_next)(struct fs_iter *iter);
a63cd84128875485e40ed804dbf0b0945526989cTimo Sirainen int (*get_nlinks)(struct fs_file *file, nlink_t *nlinks_r);
c4e3c997c04eb6f93f782c5fa53354390ed07a02Timo Sirainen struct fs *parent; /* for wrapper filesystems */
5804ddddad82319839785885fdacbba60e0c9581Timo Sirainen /* may be used by fs_wait_async() to do the waiting */
ea19bfdfc2205af178a70915054c809ed2b8709eTimo Sirainen ARRAY(union fs_api_module_context *) module_contexts;
e13e798694ba1b0d0a5cf471600168eeaa8d2af4Timo Sirainen /* linked list of all files */
edfd009103881de283e146609f691281aba150aeTimo Sirainen struct fs_file *parent; /* for wrapper filesystems */
67a163f3a07593446fab1cbbb8f92a89d4c6cb57Timo Sirainen const struct hash_method *write_digest_method;
e13e798694ba1b0d0a5cf471600168eeaa8d2af4Timo Sirainen /* linked list of all iters */
60eda49183dbec5f3d5ec18b38433581e28e2ebaTimo Sirainenvoid fs_class_register(const struct fs *fs_class);
c33d3f93abf8392fdc60e12bea41ffd12cc85a8dTimo Sirainenvoid fs_set_error(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3);
c33d3f93abf8392fdc60e12bea41ffd12cc85a8dTimo Sirainenvoid fs_set_critical(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3);
84669c712403b742cc07ae70229725c486ef1235Timo Sirainenssize_t fs_read_via_stream(struct fs_file *file, void *buf, size_t size);
84669c712403b742cc07ae70229725c486ef1235Timo Sirainenint fs_write_via_stream(struct fs_file *file, const void *data, size_t size);
185f63aeffefe857e823bc4eeaea53898f574d57Timo Sirainenvoid fs_metadata_init_or_clear(struct fs_file *file);
84669c712403b742cc07ae70229725c486ef1235Timo Sirainenvoid fs_default_set_metadata(struct fs_file *file,
5b302b077a61204beb6852b89927952840458ccbTimo Sirainenconst char *fs_metadata_find(const ARRAY_TYPE(fs_metadata) *metadata,
84669c712403b742cc07ae70229725c486ef1235Timo Sirainenint fs_default_copy(struct fs_file *src, struct fs_file *dest);
1c244f6fdbb509cca857982368f5d426e999f2d1Timo Sirainenvoid fs_file_timing_end(struct fs_file *file, enum fs_op op);
6d1218e68ce883735ffde9d7907e626ab81b9fb5Timo Sirainenfs_file_init_parent(struct fs_file *parent, const char *path, int mode_flags);
bd7ae8952d41fc1e847098439690355b09920618Timo Sirainen/* Same as fs_write_stream_abort_error(), except it closes the *parent* file
bd7ae8952d41fc1e847098439690355b09920618Timo Sirainen and error is left untouched */
bd7ae8952d41fc1e847098439690355b09920618Timo Sirainenvoid fs_write_stream_abort_parent(struct fs_file *file, struct ostream **output);