From 11509ce3fc6a36b6e3c094bf8aa11820f17d0ede Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 26 Oct 2005 16:04:04 +0000 Subject: add ftruncate() method --- include/fuse.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'include/fuse.h') 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 -- cgit v1.2.3