⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fuse_lowlevel.h

📁 UNIX/LINUX下面的用户文件系统
💻 H
📖 第 1 页 / 共 3 页
字号:
     * @param buf data to write     * @param size number of bytes to write     * @param off offset to write to     * @param fi file information     */    void (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf,                   size_t size, off_t off, struct fuse_file_info *fi);    /**     * Flush method     *     * This is called on each close() of the opened file.     *     * Since file descriptors can be duplicated (dup, dup2, fork), for     * one open call there may be many flush calls.     *     * Filesystems shouldn't assume that flush will always be called     * after some writes, or that if will be called at all.     *     * fi->fh will contain the value set by the open method, or will     * be undefined if the open method didn't set any value.     *     * NOTE: the name of the method is misleading, since (unlike     * fsync) the filesystem is not forced to flush pending writes.     * One reason to flush data, is if the filesystem wants to return     * write errors.     *     * Valid replies:     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param fi file information     */    void (*flush) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);    /**     * Release an open file     *     * Release is called when there are no more references to an open     * file: all file descriptors are closed and all memory mappings     * are unmapped.     *     * For every open call there will be exactly one release call.     *     * The filesystem may reply with an error, but error values are     * not returned to close() or munmap() which triggered the     * release.     *     * fi->fh will contain the value set by the open method, or will     * be undefined if the open method didn't set any value.     * fi->flags will contain the same flags as for open.     *     * Valid replies:     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param fi file information     */    void (*release) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);    /**     * Synchronize file contents     *     * If the datasync parameter is non-zero, then only the user data     * should be flushed, not the meta data.     *     * Valid replies:     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param datasync flag indicating if only data should be flushed     * @param fi file information     */    void (*fsync) (fuse_req_t req, fuse_ino_t ino, int datasync,                   struct fuse_file_info *fi);    /**     * Open a directory     *     * Filesystem may store an arbitrary file handle (pointer, index,     * etc) in fi->fh, and use this in other all other directory     * stream operations (readdir, releasedir, fsyncdir).     *     * Filesystem may also implement stateless directory I/O and not     * store anything in fi->fh, though that makes it impossible to     * implement standard conforming directory stream operations in     * case the contents of the directory can change between opendir     * and releasedir.     *     * Valid replies:     *   fuse_reply_open     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param fi file information     */    void (*opendir) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);    /**     * Read directory     *     * Send a buffer filled using fuse_add_dirent(), with size not     * exceeding the requested size.  Send an empty buffer on end of     * stream.     *     * fi->fh will contain the value set by the opendir method, or     * will be undefined if the opendir method didn't set any value.     *     * Valid replies:     *   fuse_reply_buf     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param size maximum number of bytes to send     * @param off offset to continue reading the directory stream     * @param fi file information     */    void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,                     struct fuse_file_info *fi);    /**     * Release an open directory     *     * For every opendir call there will be exactly one releasedir     * call.     *     * Any errors sent by releasedir will be ignored.     *     * fi->fh will contain the value set by the opendir method, or     * will be undefined if the opendir method didn't set any value.     *     * Valid replies:     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param fi file information     */    void (*releasedir) (fuse_req_t req, fuse_ino_t ino,                        struct fuse_file_info *fi);    /**     * Synchronize directory contents     *     * If the datasync parameter is non-zero, then only the directory     * contents should be flushed, not the meta data.     *     * fi->fh will contain the value set by the opendir method, or     * will be undefined if the opendir method didn't set any value.     *     * Valid replies:     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param datasync flag indicating if only data should be flushed     * @param fi file information     */    void (*fsyncdir) (fuse_req_t req, fuse_ino_t ino, int datasync,                      struct fuse_file_info *fi);    /**     * Get file system statistics     *     * Valid replies:     *   fuse_reply_statfs     *   fuse_reply_err     *     * @param req request handle     */    void (*statfs) (fuse_req_t req);    /**     * Set an extended attribute     *     * Valid replies:     *   fuse_reply_err     */    void (*setxattr) (fuse_req_t req, fuse_ino_t ino, const char *name,                      const char *value, size_t size, int flags);    /**     * Get an extended attribute     *     * If size is zero, the size of the value should be sent with     * fuse_reply_xattr.     *     * If the size is non-zero, and the value fits in the buffer, the     * value should be sent with fuse_reply_buf.     *     * If the size is too small for the value, the ERANGE error should     * be sent.     *     * Valid replies:     *   fuse_reply_buf     *   fuse_reply_xattr     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param name of the extended attribute     * @param size maximum size of the value to send     */    void (*getxattr) (fuse_req_t req, fuse_ino_t ino, const char *name,                      size_t size);    /**     * List extended attribute names     *     * If size is zero, the total size of the attribute list should be     * sent with fuse_reply_xattr.     *     * If the size is non-zero, and the null character separated     * attribute list fits in the buffer, the list should be sent with     * fuse_reply_buf.     *     * If the size is too small for the list, the ERANGE error should     * be sent.     *     * Valid replies:     *   fuse_reply_buf     *   fuse_reply_xattr     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param size maximum size of the list to send     */    void (*listxattr) (fuse_req_t req, fuse_ino_t ino, size_t size);    /**     * Remove an extended attribute     *     * Valid replies:     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param name of the extended attribute     */    void (*removexattr) (fuse_req_t req, fuse_ino_t ino, const char *name);    /**     * Check file access permissions     *     * This will be called for the access() system call.  If the     * 'default_permissions' mount option is given, this method is not     * called.     *     * This method is not called under Linux kernel versions 2.4.x     *     * Introduced in version 2.5     *     * Valid replies:     *   fuse_reply_err     *     * @param req request handle     * @param ino the inode number     * @param mask requested access mode     */    void (*access) (fuse_req_t req, fuse_ino_t ino, int mask);    /**     * Create and open a file     *     * If the file does not exist, first create it with the specified     * mode, and then open it.     *     * Open flags (with the exception of O_NOCTTY) are available in     * fi->flags.     *     * Filesystem may store an arbitrary file handle (pointer, index,     * etc) in fi->fh, and use this in other all other file operations     * (read, write, flush, release, fsync).     *     * There are also some flags (direct_io, keep_cache) which the     * filesystem may set in fi, to change the way the file is opened.     * See fuse_file_info structure in <fuse_common.h> for more details.     *     * If this method is not implemented or under Linux kernel     * versions earlier than 2.6.15, the mknod() and open() methods     * will be called instead.     *     * Introduced in version 2.5     *     * Valid replies:     *   fuse_reply_create     *   fuse_reply_err     *     * @param req request handle     * @param parent inode number of the parent directory     * @param name to create     * @param mode file type and mode with which to create the new file     * @param fi file information     */    void (*create) (fuse_req_t req, fuse_ino_t parent, const char *name,                    mode_t mode, struct fuse_file_info *fi);};/** * Reply with an error code or success * * Possible requests: *   all except forget * * unlink, rmdir, rename, flush, release, fsync, fsyncdir, setxattr * and removexattr may send a zero code * * @param req request handle * @param err the positive error value, or zero for success * @return zero for success, -errno for failure to send reply */int fuse_reply_err(fuse_req_t req, int err);/** * Don't send reply * * Possible requests: *   forget * * @param req request handle */void fuse_reply_none(fuse_req_t req);/** * Reply with a directory entry * * Possible requests: *   lookup, mknod, mkdir, symlink, link * * @param req request handle * @param e the entry parameters * @return zero for success, -errno for failure to send reply */int fuse_reply_entry(fuse_req_t req, const struct fuse_entry_param *e);/** * Reply with a directory entry and open parameters * * currently the following members of 'fi' are used: *   fh, direct_io, keep_cache * * Possible requests: *   create * * @param req request handle * @param e the entry parameters * @param fi file information * @return zero for success, -errno for failure to send reply */int fuse_reply_create(fuse_req_t req, const struct fuse_entry_param *e,                      const struct fuse_file_info *fi);/** * Reply with attributes * * Possible requests: *   getattr, setattr * * @param req request handle * @param the attributes * @param attr_timeout  validity timeout (in seconds) for the attributes * @return zero for success, -errno for failure to send reply */int fuse_reply_attr(fuse_req_t req, const struct stat *attr,                    double attr_timeout);/** * Reply with the contents of a symbolic link * * Possible requests: *   readlink * * @param req request handle * @param link symbolic link contents * @return zero for success, -errno for failure to send reply */int fuse_reply_readlink(fuse_req_t req, const char *link);/** * Reply with open parameters * * currently the following members of 'fi' are used: *   fh, direct_io, keep_cache * * Possible requests: *   open, opendir * * @param req request handle * @param fi file information * @return zero for success, -errno for failure to send reply */int fuse_reply_open(fuse_req_t req, const struct fuse_file_info *fi);/** * Reply with number of bytes written * * Possible requests: *   write * * @param req request handle * @param count the number of bytes written * @return zero for success, -errno for failure to send reply */int fuse_reply_write(fuse_req_t req, size_t count);/** * Reply with data * * Possible requests: *   read, readdir, getxattr, listxattr * * @param req request handle * @param buf buffer containing data * @param size the size of data in bytes * @return zero for success, -errno for failure to send reply */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -