Inlined fuse_chan_fd
authorNikolaus Rath <Nikolaus@rath.org>
Mon, 28 Mar 2016 20:48:15 +0000 (13:48 -0700)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 29 Mar 2016 20:18:16 +0000 (13:18 -0700)
include/fuse_lowlevel.h
lib/fuse.c
lib/fuse_loop_mt.c
lib/fuse_lowlevel.c
lib/fuse_session.c

index 32908cb7677d028eeb35146ed131b22026241c39..9bdd655c42f4027559cdd5b0626027611164ea97 100644 (file)
@@ -1701,14 +1701,6 @@ int fuse_session_loop_mt(struct fuse_session *se);
  * Channel interface                                          *
  * ----------------------------------------------------------- */
 
-/**
- * Query the file descriptor of the channel
- *
- * @param ch the channel
- * @return the file descriptor passed to fuse_chan_new()
- */
-int fuse_chan_fd(struct fuse_chan *ch);
-
 /**
  * Obtain counted reference to the channel
  *
index 2f1c85ed6239da58916efcd7bed23c37699b9b68..781efb28466c054d295e76c6bd2b65ec1cd7a229 100644 (file)
@@ -4320,7 +4320,7 @@ static int fuse_session_loop_remember(struct fuse *f)
        time_t next_clean;
        struct fuse_chan *ch = fuse_session_chan(se);
        struct pollfd fds = {
-               .fd = fuse_chan_fd(ch),
+               .fd = ch->fd,
                .events = POLLIN
        };
        struct fuse_buf fbuf = {
index 6d7f051aa174ac0e010f992386a2ff8d5ea1d937..036f75c876dee19b47b5c76e717e8159417bef77 100755 (executable)
@@ -193,7 +193,7 @@ static struct fuse_chan *fuse_clone_chan(struct fuse_mt *mt)
        }
        fcntl(clonefd, F_SETFD, FD_CLOEXEC);
 
-       masterfd = fuse_chan_fd(mt->prevch);
+       masterfd = mt->prevch->fd;
        res = ioctl(clonefd, FUSE_DEV_IOC_CLONE, &masterfd);
        if (res == -1) {
                fprintf(stderr, "fuse: failed to clone device fd: %s\n",
index 3acb6638d0cb562e70a97046c9e37a295847455b..4fe3678d6839af2de4fd2973bacbdef1e0d1026c 100755 (executable)
@@ -160,9 +160,9 @@ static struct fuse_req *fuse_ll_alloc_req(struct fuse_ll *f)
 
 void fuse_chan_close(struct fuse_chan *ch)
 {
-       int fd = fuse_chan_fd(ch);
+       int fd = ch->fd;
        if (fd != -1)
-               close(fd);
+           close(fd);
 }
 
 
@@ -188,7 +188,7 @@ static int fuse_send_msg(struct fuse_ll *f, struct fuse_chan *ch,
                }
        }
 
-       ssize_t res = writev(fuse_chan_fd(ch), iov, count);
+       ssize_t res = writev(ch->fd, iov, count);
        int err = errno;
 
        if (res == -1) {
@@ -777,7 +777,7 @@ static int fuse_send_data_iov(struct fuse_ll *f, struct fuse_chan *ch,
                splice_flags |= SPLICE_F_MOVE;
 
        res = splice(llp->pipe[0], NULL,
-                    fuse_chan_fd(ch), NULL, out->len, splice_flags);
+                    ch->fd, NULL, out->len, splice_flags);
        if (res == -1) {
                res = -errno;
                perror("fuse: splice from pipe");
@@ -2728,7 +2728,7 @@ int fuse_session_receive_buf(struct fuse_session *se, struct fuse_buf *buf,
                        goto fallback;
        }
 
-       res = splice(fuse_chan_fd(ch), NULL, llp->pipe[1], NULL, bufsize, 0);
+       res = splice(ch->fd, NULL, llp->pipe[1], NULL, bufsize, 0);
        err = errno;
 
        if (fuse_session_exited(se))
@@ -2812,7 +2812,7 @@ fallback:
        }
 
 restart:
-       res = read(fuse_chan_fd(ch), buf->mem, f->bufsize);
+       res = read(ch->fd, buf->mem, f->bufsize);
        err = errno;
 
        if (fuse_session_exited(se))
index 42fe5c3233b515059807cb31515448964d46f3eb..6b54e43983526ce4f43e39464791046abdeacdbc 100644 (file)
@@ -90,11 +90,6 @@ struct fuse_chan *fuse_chan_new(int fd)
        return ch;
 }
 
-int fuse_chan_fd(struct fuse_chan *ch)
-{
-       return ch->fd;
-}
-
 struct fuse_session *fuse_chan_session(struct fuse_chan *ch)
 {
        return ch->se;