{"action":"created","issue":{"url":"https://api.github.com/repos/zargony/rust-fuse/issues/39","labels_url":"https://api.github.com/repos/zargony/rust-fuse/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/zargony/rust-fuse/issues/39/comments","events_url":"https://api.github.com/repos/zargony/rust-fuse/issues/39/events","html_url":"https://github.com/zargony/rust-fuse/issues/39","id":55431821,"number":39,"title":"read op can't reply with fuse_reply_iov","user":{"login":"akiradeveloper","id":785824,"avatar_url":"https://avatars.githubusercontent.com/u/785824?v=3","gravatar_id":"","url":"https://api.github.com/users/akiradeveloper","html_url":"https://github.com/akiradeveloper","followers_url":"https://api.github.com/users/akiradeveloper/followers","following_url":"https://api.github.com/users/akiradeveloper/following{/other_user}","gists_url":"https://api.github.com/users/akiradeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/akiradeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akiradeveloper/subscriptions","organizations_url":"https://api.github.com/users/akiradeveloper/orgs","repos_url":"https://api.github.com/users/akiradeveloper/repos","events_url":"https://api.github.com/users/akiradeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/akiradeveloper/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zargony/rust-fuse/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-25T21:51:21Z","updated_at":"2015-01-28T04:11:49Z","closed_at":null,"body":"rust-fuse forces the read op implementation to use ReplyData type as the reply object which is equivalent to fuse_reply_data or fuse_reply_buf because it returns a single buffer.\r\n\r\nBut, returning by scatter-gather is better for performance. If I understand correctly, that's because read op allows the user to reply with fuse_reply_iov.\r\n\r\nThis isn't a bug but I think rust-fuse has a reason to rethink its design.\r\n\r\n```c\r\n        /**\r\n         * Read data\r\n         *\r\n         * Read should send exactly the number of bytes requested except\r\n         * on EOF or error, otherwise the rest of the data will be\r\n         * substituted with zeroes.  An exception to this is when the file\r\n         * has been opened in 'direct_io' mode, in which case the return\r\n         * value of the read system call will reflect the return value of\r\n         * this operation.\r\n         *\r\n         * fi->fh will contain the value set by the open method, or will\r\n         * be undefined if the open method didn't set any value.\r\n         *\r\n         * Valid replies:\r\n         *   fuse_reply_buf\r\n         *   fuse_reply_iov\r\n         *   fuse_reply_data\r\n         *   fuse_reply_err\r\n         *\r\n         * @param req request handle\r\n         * @param ino the inode number\r\n         * @param size number of bytes to read\r\n         * @param off offset to read from\r\n         * @param fi file information\r\n         */\r\n        void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,\r\n                      struct fuse_file_info *fi);\r\n```"},"comment":{"url":"https://api.github.com/repos/zargony/rust-fuse/issues/comments/71778282","html_url":"https://github.com/zargony/rust-fuse/issues/39#issuecomment-71778282","issue_url":"https://api.github.com/repos/zargony/rust-fuse/issues/39","id":71778282,"user":{"login":"akiradeveloper","id":785824,"avatar_url":"https://avatars.githubusercontent.com/u/785824?v=3","gravatar_id":"","url":"https://api.github.com/users/akiradeveloper","html_url":"https://github.com/akiradeveloper","followers_url":"https://api.github.com/users/akiradeveloper/followers","following_url":"https://api.github.com/users/akiradeveloper/following{/other_user}","gists_url":"https://api.github.com/users/akiradeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/akiradeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akiradeveloper/subscriptions","organizations_url":"https://api.github.com/users/akiradeveloper/orgs","repos_url":"https://api.github.com/users/akiradeveloper/repos","events_url":"https://api.github.com/users/akiradeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/akiradeveloper/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T04:11:49Z","updated_at":"2015-01-28T04:11:49Z","body":"Sorry to start from my misunderstanding of the protocol. fuse 2.9.3 (protocol 7.19) has reply four methods for read but fuse 2.7.2 (protocol 7.8) has only two. So rust-fuse's implementation is conformant to protocol 7.8.\r\n\r\n```c\r\n        /**\r\n         * Read data\r\n         *\r\n         * Read should send exactly the number of bytes requested except\r\n         * on EOF or error, otherwise the rest of the data will be\r\n         * substituted with zeroes.  An exception to this is when the file\r\n         * has been opened in 'direct_io' mode, in which case the return\r\n         * value of the read system call will reflect the return value of\r\n         * this operation.\r\n         *\r\n         * fi->fh will contain the value set by the open method, or will\r\n         * be undefined if the open method didn't set any value.\r\n         *\r\n         * Valid replies:\r\n         *   fuse_reply_buf\r\n         *   fuse_reply_err\r\n         *\r\n         * @param req request handle\r\n         * @param ino the inode number\r\n         * @param size number of bytes to read\r\n         * @param off offset to read from\r\n         * @param fi file information\r\n         */\r\n        void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,\r\n                      struct fuse_file_info *fi);\r\n```\r\n\r\nSo, extending the design so that read op can reply with iov is kind of back-porting.\r\n\r\nBy the way, do you know what version fuse started to support iov reply for read op? And, why fuse_reply_iov isn't used at all in fuse 2.7.2 (this is really weird)?"}}