linux/include/uapi/linux/fuse.h
<<
>>
Prefs
   1/*
   2    This file defines the kernel interface of FUSE
   3    Copyright (C) 2001-2008  Miklos Szeredi <miklos@szeredi.hu>
   4
   5    This program can be distributed under the terms of the GNU GPL.
   6    See the file COPYING.
   7
   8    This -- and only this -- header file may also be distributed under
   9    the terms of the BSD Licence as follows:
  10
  11    Copyright (C) 2001-2007 Miklos Szeredi. All rights reserved.
  12
  13    Redistribution and use in source and binary forms, with or without
  14    modification, are permitted provided that the following conditions
  15    are met:
  16    1. Redistributions of source code must retain the above copyright
  17       notice, this list of conditions and the following disclaimer.
  18    2. Redistributions in binary form must reproduce the above copyright
  19       notice, this list of conditions and the following disclaimer in the
  20       documentation and/or other materials provided with the distribution.
  21
  22    THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  23    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25    ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
  26    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  28    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  29    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  31    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32    SUCH DAMAGE.
  33*/
  34
  35/*
  36 * This file defines the kernel interface of FUSE
  37 *
  38 * Protocol changelog:
  39 *
  40 * 7.9:
  41 *  - new fuse_getattr_in input argument of GETATTR
  42 *  - add lk_flags in fuse_lk_in
  43 *  - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
  44 *  - add blksize field to fuse_attr
  45 *  - add file flags field to fuse_read_in and fuse_write_in
  46 *
  47 * 7.10
  48 *  - add nonseekable open flag
  49 *
  50 * 7.11
  51 *  - add IOCTL message
  52 *  - add unsolicited notification support
  53 *  - add POLL message and NOTIFY_POLL notification
  54 *
  55 * 7.12
  56 *  - add umask flag to input argument of open, mknod and mkdir
  57 *  - add notification messages for invalidation of inodes and
  58 *    directory entries
  59 *
  60 * 7.13
  61 *  - make max number of background requests and congestion threshold
  62 *    tunables
  63 *
  64 * 7.14
  65 *  - add splice support to fuse device
  66 *
  67 * 7.15
  68 *  - add store notify
  69 *  - add retrieve notify
  70 *
  71 * 7.16
  72 *  - add BATCH_FORGET request
  73 *  - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct
  74 *    fuse_ioctl_iovec' instead of ambiguous 'struct iovec'
  75 *  - add FUSE_IOCTL_32BIT flag
  76 *
  77 * 7.17
  78 *  - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK
  79 *
  80 * 7.18
  81 *  - add FUSE_IOCTL_DIR flag
  82 *  - add FUSE_NOTIFY_DELETE
  83 *
  84 * 7.19
  85 *  - add FUSE_FALLOCATE
  86 *
  87 * 7.20
  88 *  - add FUSE_AUTO_INVAL_DATA
  89 *
  90 * 7.21
  91 *  - add FUSE_READDIRPLUS
  92 *  - send the requested events in POLL request
  93 *
  94 * 7.22
  95 *  - add FUSE_ASYNC_DIO
  96 *
  97 * 7.23
  98 *  - add FUSE_WRITEBACK_CACHE
  99 *  - add time_gran to fuse_init_out
 100 *  - add reserved space to fuse_init_out
 101 *  - add FATTR_CTIME
 102 *  - add ctime and ctimensec to fuse_setattr_in
 103 *  - add FUSE_RENAME2 request
 104 *
 105 *  7.24
 106 *  - add FUSE_LSEEK for SEEK_HOLE and SEEK_DATA support
 107 */
 108
 109#ifndef _LINUX_FUSE_H
 110#define _LINUX_FUSE_H
 111
 112#ifdef __KERNEL__
 113#include <linux/types.h>
 114#else
 115#include <stdint.h>
 116#endif
 117
 118/*
 119 * Version negotiation:
 120 *
 121 * Both the kernel and userspace send the version they support in the
 122 * INIT request and reply respectively.
 123 *
 124 * If the major versions match then both shall use the smallest
 125 * of the two minor versions for communication.
 126 *
 127 * If the kernel supports a larger major version, then userspace shall
 128 * reply with the major version it supports, ignore the rest of the
 129 * INIT message and expect a new INIT message from the kernel with a
 130 * matching major version.
 131 *
 132 * If the library supports a larger major version, then it shall fall
 133 * back to the major protocol version sent by the kernel for
 134 * communication and reply with that major version (and an arbitrary
 135 * supported minor version).
 136 */
 137
 138/** Version number of this interface */
 139#define FUSE_KERNEL_VERSION 7
 140
 141/** Minor version number of this interface */
 142#define FUSE_KERNEL_MINOR_VERSION 22
 143
 144/** The node ID of the root inode */
 145#define FUSE_ROOT_ID 1
 146
 147/* Make sure all structures are padded to 64bit boundary, so 32bit
 148   userspace works under 64bit kernels */
 149
 150struct fuse_attr {
 151        uint64_t        ino;
 152        uint64_t        size;
 153        uint64_t        blocks;
 154        uint64_t        atime;
 155        uint64_t        mtime;
 156        uint64_t        ctime;
 157        uint32_t        atimensec;
 158        uint32_t        mtimensec;
 159        uint32_t        ctimensec;
 160        uint32_t        mode;
 161        uint32_t        nlink;
 162        uint32_t        uid;
 163        uint32_t        gid;
 164        uint32_t        rdev;
 165        uint32_t        blksize;
 166        uint32_t        padding;
 167};
 168
 169struct fuse_kstatfs {
 170        uint64_t        blocks;
 171        uint64_t        bfree;
 172        uint64_t        bavail;
 173        uint64_t        files;
 174        uint64_t        ffree;
 175        uint32_t        bsize;
 176        uint32_t        namelen;
 177        uint32_t        frsize;
 178        uint32_t        padding;
 179        uint32_t        spare[6];
 180};
 181
 182struct fuse_file_lock {
 183        uint64_t        start;
 184        uint64_t        end;
 185        uint32_t        type;
 186        uint32_t        pid; /* tgid */
 187};
 188
 189/**
 190 * Bitmasks for fuse_setattr_in.valid
 191 */
 192#define FATTR_MODE      (1 << 0)
 193#define FATTR_UID       (1 << 1)
 194#define FATTR_GID       (1 << 2)
 195#define FATTR_SIZE      (1 << 3)
 196#define FATTR_ATIME     (1 << 4)
 197#define FATTR_MTIME     (1 << 5)
 198#define FATTR_FH        (1 << 6)
 199#define FATTR_ATIME_NOW (1 << 7)
 200#define FATTR_MTIME_NOW (1 << 8)
 201#define FATTR_LOCKOWNER (1 << 9)
 202
 203/**
 204 * Flags returned by the OPEN request
 205 *
 206 * FOPEN_DIRECT_IO: bypass page cache for this open file
 207 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
 208 * FOPEN_NONSEEKABLE: the file is not seekable
 209 */
 210#define FOPEN_DIRECT_IO         (1 << 0)
 211#define FOPEN_KEEP_CACHE        (1 << 1)
 212#define FOPEN_NONSEEKABLE       (1 << 2)
 213
 214/**
 215 * INIT request/reply flags
 216 *
 217 * FUSE_ASYNC_READ: asynchronous read requests
 218 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
 219 * FUSE_FILE_OPS: kernel sends file handle for fstat, etc... (not yet supported)
 220 * FUSE_ATOMIC_O_TRUNC: handles the O_TRUNC open flag in the filesystem
 221 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
 222 * FUSE_BIG_WRITES: filesystem can handle write size larger than 4kB
 223 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
 224 * FUSE_SPLICE_WRITE: kernel supports splice write on the device
 225 * FUSE_SPLICE_MOVE: kernel supports splice move on the device
 226 * FUSE_SPLICE_READ: kernel supports splice read on the device
 227 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
 228 * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories
 229 * FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages
 230 * FUSE_DO_READDIRPLUS: do READDIRPLUS (READDIR+LOOKUP in one)
 231 * FUSE_READDIRPLUS_AUTO: adaptive readdirplus
 232 * FUSE_ASYNC_DIO: asynchronous direct I/O submission
 233 */
 234#define FUSE_ASYNC_READ         (1 << 0)
 235#define FUSE_POSIX_LOCKS        (1 << 1)
 236#define FUSE_FILE_OPS           (1 << 2)
 237#define FUSE_ATOMIC_O_TRUNC     (1 << 3)
 238#define FUSE_EXPORT_SUPPORT     (1 << 4)
 239#define FUSE_BIG_WRITES         (1 << 5)
 240#define FUSE_DONT_MASK          (1 << 6)
 241#define FUSE_SPLICE_WRITE       (1 << 7)
 242#define FUSE_SPLICE_MOVE        (1 << 8)
 243#define FUSE_SPLICE_READ        (1 << 9)
 244#define FUSE_FLOCK_LOCKS        (1 << 10)
 245#define FUSE_HAS_IOCTL_DIR      (1 << 11)
 246#define FUSE_AUTO_INVAL_DATA    (1 << 12)
 247#define FUSE_DO_READDIRPLUS     (1 << 13)
 248#define FUSE_READDIRPLUS_AUTO   (1 << 14)
 249#define FUSE_ASYNC_DIO          (1 << 15)
 250
 251/**
 252 * CUSE INIT request/reply flags
 253 *
 254 * CUSE_UNRESTRICTED_IOCTL:  use unrestricted ioctl
 255 */
 256#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
 257
 258/**
 259 * Release flags
 260 */
 261#define FUSE_RELEASE_FLUSH      (1 << 0)
 262#define FUSE_RELEASE_FLOCK_UNLOCK       (1 << 1)
 263
 264/**
 265 * Getattr flags
 266 */
 267#define FUSE_GETATTR_FH         (1 << 0)
 268
 269/**
 270 * Lock flags
 271 */
 272#define FUSE_LK_FLOCK           (1 << 0)
 273
 274/**
 275 * WRITE flags
 276 *
 277 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
 278 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
 279 */
 280#define FUSE_WRITE_CACHE        (1 << 0)
 281#define FUSE_WRITE_LOCKOWNER    (1 << 1)
 282
 283/**
 284 * Read flags
 285 */
 286#define FUSE_READ_LOCKOWNER     (1 << 1)
 287
 288/**
 289 * Ioctl flags
 290 *
 291 * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
 292 * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
 293 * FUSE_IOCTL_RETRY: retry with new iovecs
 294 * FUSE_IOCTL_32BIT: 32bit ioctl
 295 * FUSE_IOCTL_DIR: is a directory
 296 *
 297 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
 298 */
 299#define FUSE_IOCTL_COMPAT       (1 << 0)
 300#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
 301#define FUSE_IOCTL_RETRY        (1 << 2)
 302#define FUSE_IOCTL_32BIT        (1 << 3)
 303#define FUSE_IOCTL_DIR          (1 << 4)
 304
 305#define FUSE_IOCTL_MAX_IOV      256
 306
 307/**
 308 * Poll flags
 309 *
 310 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
 311 */
 312#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
 313
 314enum fuse_opcode {
 315        FUSE_LOOKUP        = 1,
 316        FUSE_FORGET        = 2,  /* no reply */
 317        FUSE_GETATTR       = 3,
 318        FUSE_SETATTR       = 4,
 319        FUSE_READLINK      = 5,
 320        FUSE_SYMLINK       = 6,
 321        FUSE_MKNOD         = 8,
 322        FUSE_MKDIR         = 9,
 323        FUSE_UNLINK        = 10,
 324        FUSE_RMDIR         = 11,
 325        FUSE_RENAME        = 12,
 326        FUSE_LINK          = 13,
 327        FUSE_OPEN          = 14,
 328        FUSE_READ          = 15,
 329        FUSE_WRITE         = 16,
 330        FUSE_STATFS        = 17,
 331        FUSE_RELEASE       = 18,
 332        FUSE_FSYNC         = 20,
 333        FUSE_SETXATTR      = 21,
 334        FUSE_GETXATTR      = 22,
 335        FUSE_LISTXATTR     = 23,
 336        FUSE_REMOVEXATTR   = 24,
 337        FUSE_FLUSH         = 25,
 338        FUSE_INIT          = 26,
 339        FUSE_OPENDIR       = 27,
 340        FUSE_READDIR       = 28,
 341        FUSE_RELEASEDIR    = 29,
 342        FUSE_FSYNCDIR      = 30,
 343        FUSE_GETLK         = 31,
 344        FUSE_SETLK         = 32,
 345        FUSE_SETLKW        = 33,
 346        FUSE_ACCESS        = 34,
 347        FUSE_CREATE        = 35,
 348        FUSE_INTERRUPT     = 36,
 349        FUSE_BMAP          = 37,
 350        FUSE_DESTROY       = 38,
 351        FUSE_IOCTL         = 39,
 352        FUSE_POLL          = 40,
 353        FUSE_NOTIFY_REPLY  = 41,
 354        FUSE_BATCH_FORGET  = 42,
 355        FUSE_FALLOCATE     = 43,
 356        FUSE_READDIRPLUS   = 44,
 357        FUSE_RENAME2       = 45,
 358        FUSE_LSEEK         = 46,
 359
 360        /* CUSE specific operations */
 361        CUSE_INIT          = 4096,
 362};
 363
 364enum fuse_notify_code {
 365        FUSE_NOTIFY_POLL   = 1,
 366        FUSE_NOTIFY_INVAL_INODE = 2,
 367        FUSE_NOTIFY_INVAL_ENTRY = 3,
 368        FUSE_NOTIFY_STORE = 4,
 369        FUSE_NOTIFY_RETRIEVE = 5,
 370        FUSE_NOTIFY_DELETE = 6,
 371        FUSE_NOTIFY_CODE_MAX,
 372};
 373
 374/* The read buffer is required to be at least 8k, but may be much larger */
 375#define FUSE_MIN_READ_BUFFER 8192
 376
 377#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
 378
 379struct fuse_entry_out {
 380        uint64_t        nodeid;         /* Inode ID */
 381        uint64_t        generation;     /* Inode generation: nodeid:gen must
 382                                           be unique for the fs's lifetime */
 383        uint64_t        entry_valid;    /* Cache timeout for the name */
 384        uint64_t        attr_valid;     /* Cache timeout for the attributes */
 385        uint32_t        entry_valid_nsec;
 386        uint32_t        attr_valid_nsec;
 387        struct fuse_attr attr;
 388};
 389
 390struct fuse_forget_in {
 391        uint64_t        nlookup;
 392};
 393
 394struct fuse_forget_one {
 395        uint64_t        nodeid;
 396        uint64_t        nlookup;
 397};
 398
 399struct fuse_batch_forget_in {
 400        uint32_t        count;
 401        uint32_t        dummy;
 402};
 403
 404struct fuse_getattr_in {
 405        uint32_t        getattr_flags;
 406        uint32_t        dummy;
 407        uint64_t        fh;
 408};
 409
 410#define FUSE_COMPAT_ATTR_OUT_SIZE 96
 411
 412struct fuse_attr_out {
 413        uint64_t        attr_valid;     /* Cache timeout for the attributes */
 414        uint32_t        attr_valid_nsec;
 415        uint32_t        dummy;
 416        struct fuse_attr attr;
 417};
 418
 419#define FUSE_COMPAT_MKNOD_IN_SIZE 8
 420
 421struct fuse_mknod_in {
 422        uint32_t        mode;
 423        uint32_t        rdev;
 424        uint32_t        umask;
 425        uint32_t        padding;
 426};
 427
 428struct fuse_mkdir_in {
 429        uint32_t        mode;
 430        uint32_t        umask;
 431};
 432
 433struct fuse_rename_in {
 434        uint64_t        newdir;
 435};
 436
 437struct fuse_rename2_in {
 438        uint64_t        newdir;
 439        uint32_t        flags;
 440        uint32_t        padding;
 441};
 442
 443struct fuse_link_in {
 444        uint64_t        oldnodeid;
 445};
 446
 447struct fuse_setattr_in {
 448        uint32_t        valid;
 449        uint32_t        padding;
 450        uint64_t        fh;
 451        uint64_t        size;
 452        uint64_t        lock_owner;
 453        uint64_t        atime;
 454        uint64_t        mtime;
 455        uint64_t        unused2;
 456        uint32_t        atimensec;
 457        uint32_t        mtimensec;
 458        uint32_t        unused3;
 459        uint32_t        mode;
 460        uint32_t        unused4;
 461        uint32_t        uid;
 462        uint32_t        gid;
 463        uint32_t        unused5;
 464};
 465
 466struct fuse_open_in {
 467        uint32_t        flags;
 468        uint32_t        unused;
 469};
 470
 471struct fuse_create_in {
 472        uint32_t        flags;
 473        uint32_t        mode;
 474        uint32_t        umask;
 475        uint32_t        padding;
 476};
 477
 478struct fuse_open_out {
 479        uint64_t        fh;
 480        uint32_t        open_flags;
 481        uint32_t        padding;
 482};
 483
 484struct fuse_release_in {
 485        uint64_t        fh;
 486        uint32_t        flags;
 487        uint32_t        release_flags;
 488        uint64_t        lock_owner;
 489};
 490
 491struct fuse_flush_in {
 492        uint64_t        fh;
 493        uint32_t        unused;
 494        uint32_t        padding;
 495        uint64_t        lock_owner;
 496};
 497
 498struct fuse_read_in {
 499        uint64_t        fh;
 500        uint64_t        offset;
 501        uint32_t        size;
 502        uint32_t        read_flags;
 503        uint64_t        lock_owner;
 504        uint32_t        flags;
 505        uint32_t        padding;
 506};
 507
 508#define FUSE_COMPAT_WRITE_IN_SIZE 24
 509
 510struct fuse_write_in {
 511        uint64_t        fh;
 512        uint64_t        offset;
 513        uint32_t        size;
 514        uint32_t        write_flags;
 515        uint64_t        lock_owner;
 516        uint32_t        flags;
 517        uint32_t        padding;
 518};
 519
 520struct fuse_write_out {
 521        uint32_t        size;
 522        uint32_t        padding;
 523};
 524
 525#define FUSE_COMPAT_STATFS_SIZE 48
 526
 527struct fuse_statfs_out {
 528        struct fuse_kstatfs st;
 529};
 530
 531struct fuse_fsync_in {
 532        uint64_t        fh;
 533        uint32_t        fsync_flags;
 534        uint32_t        padding;
 535};
 536
 537struct fuse_setxattr_in {
 538        uint32_t        size;
 539        uint32_t        flags;
 540};
 541
 542struct fuse_getxattr_in {
 543        uint32_t        size;
 544        uint32_t        padding;
 545};
 546
 547struct fuse_getxattr_out {
 548        uint32_t        size;
 549        uint32_t        padding;
 550};
 551
 552struct fuse_lk_in {
 553        uint64_t        fh;
 554        uint64_t        owner;
 555        struct fuse_file_lock lk;
 556        uint32_t        lk_flags;
 557        uint32_t        padding;
 558};
 559
 560struct fuse_lk_out {
 561        struct fuse_file_lock lk;
 562};
 563
 564struct fuse_access_in {
 565        uint32_t        mask;
 566        uint32_t        padding;
 567};
 568
 569struct fuse_init_in {
 570        uint32_t        major;
 571        uint32_t        minor;
 572        uint32_t        max_readahead;
 573        uint32_t        flags;
 574};
 575
 576struct fuse_init_out {
 577        uint32_t        major;
 578        uint32_t        minor;
 579        uint32_t        max_readahead;
 580        uint32_t        flags;
 581        uint16_t        max_background;
 582        uint16_t        congestion_threshold;
 583        uint32_t        max_write;
 584};
 585
 586#define CUSE_INIT_INFO_MAX 4096
 587
 588struct cuse_init_in {
 589        uint32_t        major;
 590        uint32_t        minor;
 591        uint32_t        unused;
 592        uint32_t        flags;
 593};
 594
 595struct cuse_init_out {
 596        uint32_t        major;
 597        uint32_t        minor;
 598        uint32_t        unused;
 599        uint32_t        flags;
 600        uint32_t        max_read;
 601        uint32_t        max_write;
 602        uint32_t        dev_major;              /* chardev major */
 603        uint32_t        dev_minor;              /* chardev minor */
 604        uint32_t        spare[10];
 605};
 606
 607struct fuse_interrupt_in {
 608        uint64_t        unique;
 609};
 610
 611struct fuse_bmap_in {
 612        uint64_t        block;
 613        uint32_t        blocksize;
 614        uint32_t        padding;
 615};
 616
 617struct fuse_bmap_out {
 618        uint64_t        block;
 619};
 620
 621struct fuse_ioctl_in {
 622        uint64_t        fh;
 623        uint32_t        flags;
 624        uint32_t        cmd;
 625        uint64_t        arg;
 626        uint32_t        in_size;
 627        uint32_t        out_size;
 628};
 629
 630struct fuse_ioctl_iovec {
 631        uint64_t        base;
 632        uint64_t        len;
 633};
 634
 635struct fuse_ioctl_out {
 636        int32_t         result;
 637        uint32_t        flags;
 638        uint32_t        in_iovs;
 639        uint32_t        out_iovs;
 640};
 641
 642struct fuse_poll_in {
 643        uint64_t        fh;
 644        uint64_t        kh;
 645        uint32_t        flags;
 646        uint32_t        events;
 647};
 648
 649struct fuse_poll_out {
 650        uint32_t        revents;
 651        uint32_t        padding;
 652};
 653
 654struct fuse_notify_poll_wakeup_out {
 655        uint64_t        kh;
 656};
 657
 658struct fuse_fallocate_in {
 659        uint64_t        fh;
 660        uint64_t        offset;
 661        uint64_t        length;
 662        uint32_t        mode;
 663        uint32_t        padding;
 664};
 665
 666struct fuse_in_header {
 667        uint32_t        len;
 668        uint32_t        opcode;
 669        uint64_t        unique;
 670        uint64_t        nodeid;
 671        uint32_t        uid;
 672        uint32_t        gid;
 673        uint32_t        pid;
 674        uint32_t        padding;
 675};
 676
 677struct fuse_out_header {
 678        uint32_t        len;
 679        int32_t         error;
 680        uint64_t        unique;
 681};
 682
 683struct fuse_dirent {
 684        uint64_t        ino;
 685        uint64_t        off;
 686        uint32_t        namelen;
 687        uint32_t        type;
 688        char name[];
 689};
 690
 691#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
 692#define FUSE_DIRENT_ALIGN(x) \
 693        (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
 694#define FUSE_DIRENT_SIZE(d) \
 695        FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
 696
 697struct fuse_direntplus {
 698        struct fuse_entry_out entry_out;
 699        struct fuse_dirent dirent;
 700};
 701
 702#define FUSE_NAME_OFFSET_DIRENTPLUS \
 703        offsetof(struct fuse_direntplus, dirent.name)
 704#define FUSE_DIRENTPLUS_SIZE(d) \
 705        FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
 706
 707struct fuse_notify_inval_inode_out {
 708        uint64_t        ino;
 709        int64_t         off;
 710        int64_t         len;
 711};
 712
 713struct fuse_notify_inval_entry_out {
 714        uint64_t        parent;
 715        uint32_t        namelen;
 716        uint32_t        padding;
 717};
 718
 719struct fuse_notify_delete_out {
 720        uint64_t        parent;
 721        uint64_t        child;
 722        uint32_t        namelen;
 723        uint32_t        padding;
 724};
 725
 726struct fuse_notify_store_out {
 727        uint64_t        nodeid;
 728        uint64_t        offset;
 729        uint32_t        size;
 730        uint32_t        padding;
 731};
 732
 733struct fuse_notify_retrieve_out {
 734        uint64_t        notify_unique;
 735        uint64_t        nodeid;
 736        uint64_t        offset;
 737        uint32_t        size;
 738        uint32_t        padding;
 739};
 740
 741/* Matches the size of fuse_write_in */
 742struct fuse_notify_retrieve_in {
 743        uint64_t        dummy1;
 744        uint64_t        offset;
 745        uint32_t        size;
 746        uint32_t        dummy2;
 747        uint64_t        dummy3;
 748        uint64_t        dummy4;
 749};
 750
 751struct fuse_lseek_in {
 752        uint64_t        fh;
 753        uint64_t        offset;
 754        uint32_t        whence;
 755        uint32_t        padding;
 756};
 757
 758struct fuse_lseek_out {
 759        uint64_t        offset;
 760};
 761
 762#endif /* _LINUX_FUSE_H */
 763