Lines Matching +full:auto +full:- +full:poll
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
43 #include <poll.h>
103 "POLL", in opcode2opname()
121 return([=](auto in, auto &out) { in ReturnErrno()
123 out0->header.unique = in.header.unique; in ReturnErrno()
124 out0->header.error = -error; in ReturnErrno()
125 out0->header.len = sizeof(out0->header); in ReturnErrno()
134 return([=](auto in, auto &out) { in ReturnNegativeCache()
137 out0->body.entry.nodeid = 0; in ReturnNegativeCache()
138 out0->header.unique = in.header.unique; in ReturnNegativeCache()
139 out0->header.error = 0; in ReturnNegativeCache()
140 out0->body.entry.entry_valid = entry_valid->tv_sec; in ReturnNegativeCache()
141 out0->body.entry.entry_valid_nsec = entry_valid->tv_nsec; in ReturnNegativeCache()
151 return([=](auto& in, auto &out) { in ReturnImmediate()
153 out0->header.unique = in.header.unique; in ReturnImmediate()
165 printf("%-11s ino=%2" PRIu64, opcode2opname(in.header.opcode), in debug_request()
396 printf("<- INVAL_ENTRY parent=%" PRIu64 " %s\n", in debug_response()
400 printf("<- INVAL_INODE ino=%" PRIu64 " off=%" PRIi64 in debug_response()
407 printf("<- STORE ino=%" PRIu64 " off=%" PRIu64 in debug_response()
426 m_kq(pm == KQ ? kqueue() : -1), in MockFS()
433 m_child_pid(-1), in MockFS()
435 m_nready(-1), in MockFS()
445 * Kyua sets pwd to a testcase-unique tempdir; no need to use in MockFS()
468 build_iovec(&iov, &iovlen, "fstype", __DECONST(void *, "fusefs"), -1); in MockFS()
470 __DECONST(void *, "mountpoint"), -1); in MockFS()
471 build_iovec(&iov, &iovlen, "from", __DECONST(void *, "/dev/fuse"), -1); in MockFS()
473 build_iovec(&iov, &iovlen, "fd", fdstr, -1); in MockFS()
478 build_iovec(&iov, &iovlen, "max_read=", &val, -1); in MockFS()
517 __DECONST(void*, fsname), -1); in MockFS()
521 __DECONST(void*, subtype), -1); in MockFS()
631 // I suppose a 0-byte write should be allowed in audit_request()
743 if (m_uniques->find(in.header.unique) != m_uniques->end()) in audit_request()
744 FAIL() << "Non-unique \"unique\" value"; in audit_request()
745 m_uniques->insert(in.header.unique); in audit_request()
758 ASSERT_EQ(FUSE_INIT, in->header.opcode); in init()
760 out->header.unique = in->header.unique; in init()
761 out->header.error = 0; in init()
762 out->body.init.major = FUSE_KERNEL_VERSION; in init()
763 out->body.init.minor = m_kernel_minor_version;; in init()
764 out->body.init.flags = in->body.init.flags & flags; in init()
765 out->body.init.max_write = m_maxwrite; in init()
766 out->body.init.max_readahead = m_maxreadahead; in init()
771 out->body.init.time_gran = m_time_gran; in init()
775 write(m_fuse_fd, out.get(), out->header.len); in init()
786 m_fuse_fd = -1; in kill_daemon()
811 if (pid_ok((pid_t)in->header.pid)) { in loop()
821 in->header.pid); in loop()
824 for (auto &it: out) in loop()
834 out->header.unique = 0; /* 0 means asynchronous notification */ in notify_inval_entry()
835 out->header.error = FUSE_NOTIFY_INVAL_ENTRY; in notify_inval_entry()
836 out->body.inval_entry.parent = parent; in notify_inval_entry()
837 out->body.inval_entry.namelen = namelen; in notify_inval_entry()
838 strlcpy((char*)&out->body.bytes + sizeof(out->body.inval_entry), in notify_inval_entry()
839 name, sizeof(out->body.bytes) - sizeof(out->body.inval_entry)); in notify_inval_entry()
840 out->header.len = sizeof(out->header) + sizeof(out->body.inval_entry) + in notify_inval_entry()
851 out->header.unique = 0; /* 0 means asynchronous notification */ in notify_inval_inode()
852 out->header.error = FUSE_NOTIFY_INVAL_INODE; in notify_inval_inode()
853 out->body.inval_inode.ino = ino; in notify_inval_inode()
854 out->body.inval_inode.off = off; in notify_inval_inode()
855 out->body.inval_inode.len = len; in notify_inval_inode()
856 out->header.len = sizeof(out->header) + sizeof(out->body.inval_inode); in notify_inval_inode()
866 out->header.unique = 0; /* 0 means asynchronous notification */ in notify_store()
867 out->header.error = FUSE_NOTIFY_STORE; in notify_store()
868 out->body.store.nodeid = ino; in notify_store()
869 out->body.store.offset = off; in notify_store()
870 out->body.store.size = size; in notify_store()
871 bcopy(data, (char*)&out->body.bytes + sizeof(out->body.store), size); in notify_store()
872 out->header.len = sizeof(out->header) + sizeof(out->body.store) + size; in notify_store()
894 if (0 == strncmp("aiod", ki->ki_comm, 4)) in pid_ok()
905 out0->header.unique = in.header.unique; in process_default()
906 out0->header.error = -EOPNOTSUPP; in process_default()
907 out0->header.len = sizeof(out0->header); in process_default()
945 case POLL: in read_request()
950 nready = poll(fds, 1, timeout_int); in read_request()
1017 case POLL: in write_response()
1020 nready = poll(fds, 1, INFTIM); in write_response()
1039 ASSERT_EQ(-1, r); in write_response()
1053 mock_fs->loop(); in service()