fuse: rename FUSE_WRITE_KILL_PRIV to FUSE_WRITE_KILL_SUIDGID
[linux-2.6-microblaze.git] / include / uapi / linux / fuse.h
index 373cada..2623c75 100644 (file)
  *  - add FUSE_WRITE_KILL_PRIV flag
  *  - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
  *  - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag
+ *
+ *  7.32
+ *  - add flags to fuse_attr, add FUSE_ATTR_SUBMOUNT, add FUSE_SUBMOUNTS
+ *
+ *  7.33
+ *  - add FUSE_HANDLE_KILLPRIV_V2, FUSE_WRITE_KILL_SUIDGID
  */
 
 #ifndef _LINUX_FUSE_H
 #define FUSE_KERNEL_VERSION 7
 
 /** Minor version number of this interface */
-#define FUSE_KERNEL_MINOR_VERSION 31
+#define FUSE_KERNEL_MINOR_VERSION 33
 
 /** The node ID of the root inode */
 #define FUSE_ROOT_ID 1
@@ -231,7 +237,7 @@ struct fuse_attr {
        uint32_t        gid;
        uint32_t        rdev;
        uint32_t        blksize;
-       uint32_t        padding;
+       uint32_t        flags;
 };
 
 struct fuse_kstatfs {
@@ -313,7 +319,15 @@ struct fuse_file_lock {
  * FUSE_CACHE_SYMLINKS: cache READLINK responses
  * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
  * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
- * FUSE_MAP_ALIGNMENT: map_alignment field is valid
+ * FUSE_MAP_ALIGNMENT: init_out.map_alignment contains log2(byte alignment) for
+ *                    foffset and moffset fields in struct
+ *                    fuse_setupmapping_out and fuse_removemapping_one.
+ * FUSE_SUBMOUNTS: kernel supports auto-mounting directory submounts
+ * FUSE_HANDLE_KILLPRIV_V2: fs kills suid/sgid/cap on write/chown/trunc.
+ *                     Upon write/truncate suid/sgid is only killed if caller
+ *                     does not have CAP_FSETID. Additionally upon
+ *                     write/truncate sgid is killed only if file has group
+ *                     execute permission. (Same as Linux VFS behavior).
  */
 #define FUSE_ASYNC_READ                (1 << 0)
 #define FUSE_POSIX_LOCKS       (1 << 1)
@@ -342,6 +356,8 @@ struct fuse_file_lock {
 #define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
 #define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
 #define FUSE_MAP_ALIGNMENT     (1 << 26)
+#define FUSE_SUBMOUNTS         (1 << 27)
+#define FUSE_HANDLE_KILLPRIV_V2        (1 << 28)
 
 /**
  * CUSE INIT request/reply flags
@@ -371,11 +387,14 @@ struct fuse_file_lock {
  *
  * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
  * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
- * FUSE_WRITE_KILL_PRIV: kill suid and sgid bits
+ * FUSE_WRITE_KILL_SUIDGID: kill suid and sgid bits
  */
 #define FUSE_WRITE_CACHE       (1 << 0)
 #define FUSE_WRITE_LOCKOWNER   (1 << 1)
-#define FUSE_WRITE_KILL_PRIV   (1 << 2)
+#define FUSE_WRITE_KILL_SUIDGID (1 << 2)
+
+/* Obsolete alias; this flag implies killing suid/sgid only. */
+#define FUSE_WRITE_KILL_PRIV   FUSE_WRITE_KILL_SUIDGID
 
 /**
  * Read flags
@@ -417,6 +436,13 @@ struct fuse_file_lock {
  */
 #define FUSE_FSYNC_FDATASYNC   (1 << 0)
 
+/**
+ * fuse_attr flags
+ *
+ * FUSE_ATTR_SUBMOUNT: Object is a submount root
+ */
+#define FUSE_ATTR_SUBMOUNT      (1 << 0)
+
 enum fuse_opcode {
        FUSE_LOOKUP             = 1,
        FUSE_FORGET             = 2,  /* no reply */
@@ -892,4 +918,34 @@ struct fuse_copy_file_range_in {
        uint64_t        flags;
 };
 
+#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
+#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
+struct fuse_setupmapping_in {
+       /* An already open handle */
+       uint64_t        fh;
+       /* Offset into the file to start the mapping */
+       uint64_t        foffset;
+       /* Length of mapping required */
+       uint64_t        len;
+       /* Flags, FUSE_SETUPMAPPING_FLAG_* */
+       uint64_t        flags;
+       /* Offset in Memory Window */
+       uint64_t        moffset;
+};
+
+struct fuse_removemapping_in {
+       /* number of fuse_removemapping_one follows */
+       uint32_t        count;
+};
+
+struct fuse_removemapping_one {
+       /* Offset into the dax window start the unmapping */
+       uint64_t        moffset;
+       /* Length of mapping required */
+       uint64_t        len;
+};
+
+#define FUSE_REMOVEMAPPING_MAX_ENTRY   \
+               (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
+
 #endif /* _LINUX_FUSE_H */