aboutsummaryrefslogtreecommitdiff
path: root/include/fuse.h
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2005-10-26 16:04:04 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2005-10-26 16:04:04 +0000
commit11509ce3fc6a36b6e3c094bf8aa11820f17d0ede (patch)
tree7b7584927fab4174852d5c650834326e3f7a8a37 /include/fuse.h
parentd9079a75b14b73e7953adf4958709b1e5ab3804c (diff)
add ftruncate() method
Diffstat (limited to 'include/fuse.h')
-rw-r--r--include/fuse.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 290e9d3..6d7e54b 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -63,9 +63,9 @@ typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type,
*
* All methods are optional, but some are essential for a useful
* filesystem (e.g. getattr). Open, flush, release, fsync, opendir,
- * releasedir, fsyncdir, access, create, init and destroy are special
- * purpose methods, without which a full featured filesystem can still
- * be implemented.
+ * releasedir, fsyncdir, access, create, ftruncate, init and destroy
+ * are special purpose methods, without which a full featured
+ * filesystem can still be implemented.
*/
struct fuse_operations {
/** Get file attributes.
@@ -324,6 +324,20 @@ struct fuse_operations {
* Introduced in version 2.5
*/
int (*create) (const char *, mode_t, struct fuse_file_info *);
+
+ /**
+ * Change the size of an open file
+ *
+ * This method is called instead of the truncate() method if the
+ * truncation was invoked from an ftruncate() system call.
+ *
+ * If this method is not implemented or under Linux kernel
+ * versions earlier than 2.6.15, the truncate() method will be
+ * called instead.
+ *
+ * Introduced in version 2.5
+ */
+ int (*ftruncate) (const char *, off_t, struct fuse_file_info *);
};
/** Extra context that may be needed by some filesystems