aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2004-05-18 08:45:28 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2004-05-18 08:45:28 +0000
commite2e4ac2c990a9b09740e4be6ae2de811154cc5b3 (patch)
tree8648e21445e9c3a905b64e7acb6f58500b03249d /include
parent43a20ad720402cf852fc8a6cdd20b98c74dcd816 (diff)
added flush() call
Diffstat (limited to 'include')
-rw-r--r--include/fuse.h25
-rw-r--r--include/linux/fuse.h1
2 files changed, 19 insertions, 7 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 1cb7bbf..3babaf6 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -86,15 +86,25 @@ typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type);
* - release() is called when an open file has:
* 1) all file descriptors closed
* 2) all memory mappings unmapped
- * For every open() call there will be exactly one release() call
- * with the same flags. It is possible to have a file opened more
- * than once, in which case only the last release will mean, that
- * no more reads/writes will happen on the file. This call need
- * only be implemented if this information is required, otherwise
- * set this function to NULL.
+ * For every open() call there will be exactly one release() call
+ * with the same flags. It is possible to have a file opened more
+ * than once, in which case only the last release will mean, that no
+ * more reads/writes will happen on the file. The return value of
+ * release is ignored. This call need only be implemented if this
+ * information is required, otherwise set this function to NULL.
+ *
+ * - flush() is called when close() has been called on an open file.
+ * NOTE: this does not mean that the file is released (e.g. after
+ * fork() an open file will have two references which both must be
+ * closed before the file is released). The flush() method can be
+ * called more than once for each open(). The return value of
+ * flush() is passed on to the close() system call. Implementing
+ * this call is optional. If it is not needed by the filesystem,
+ * then set the callback pointer to NULL.
*
* - fsync() has a boolean 'datasync' parameter which if TRUE then do
- * an fdatasync() operation. */
+ * an fdatasync() operation.
+ */
struct fuse_operations {
int (*getattr) (const char *, struct stat *);
int (*readlink) (const char *, char *, size_t);
@@ -114,6 +124,7 @@ struct fuse_operations {
int (*read) (const char *, char *, size_t, off_t);
int (*write) (const char *, const char *, size_t, off_t);
int (*statfs) (const char *, struct statfs *);
+ int (*flush) (const char *);
int (*release) (const char *, int);
int (*fsync) (const char *, int);
int (*setxattr) (const char *, const char *, const char *, size_t, int);
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 63cf167..027cb5e 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -82,6 +82,7 @@ enum fuse_opcode {
FUSE_GETXATTR = 22,
FUSE_LISTXATTR = 23,
FUSE_REMOVEXATTR = 24,
+ FUSE_FLUSH = 25,
};
/* Conservative buffer size for the client */