aboutsummaryrefslogtreecommitdiffstats
path: root/include/fuse.h
diff options
context:
space:
mode:
authorAnatol Pomozov <anatol.pomozov@gmail.com>2012-04-22 18:49:35 -0700
committerMiklos Szeredi <mszeredi@suse.cz>2012-06-18 13:32:43 +0200
commit96ac0e5d76db3714b7c8d37956f6e6b1d804a01a (patch)
tree4cd918bccb54e30edca0dadbe2b44a43b7ef1c91 /include/fuse.h
parent46b9c3326d50aebe52c33d63885b83a47a2e74ea (diff)
downloadlibfuse-96ac0e5d76db3714b7c8d37956f6e6b1d804a01a.tar.gz
Add FALLOCATE operation
fallocate filesystem operation preallocates media space for the given file. If fallocate returns success then any subsequent write to the given range never fails with 'not enough space' error.
Diffstat (limited to 'include/fuse.h')
-rw-r--r--include/fuse.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 36b168c..c657e67 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -575,6 +575,19 @@ struct fuse_operations {
* Introduced in version 2.9
*/
int (*flock) (const char *, struct fuse_file_info *, int op);
+
+ /**
+ * Allocates space for an open file
+ *
+ * This function ensures that required space is allocated for specified
+ * file. If this function returns success then any subsequent write
+ * request to specified range is guaranteed not to fail because of lack
+ * of space on the file system media.
+ *
+ * Introduced in version 2.9.1
+ */
+ int (*fallocate) (const char *, int, off_t, off_t,
+ struct fuse_file_info *);
};
/** Extra context that may be needed by some filesystems
@@ -870,6 +883,8 @@ int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, int cmd, void *arg,
int fuse_fs_poll(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi, struct fuse_pollhandle *ph,
unsigned *reventsp);
+int fuse_fs_fallocate(struct fuse_fs *fs, const char *path, int mode,
+ off_t offset, off_t length, struct fuse_file_info *fi);
void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn);
void fuse_fs_destroy(struct fuse_fs *fs);