Unreleased Changes
==================
-* The `example/passthrough_ll` filesystem now supports writing
- to files.
+* The `example/passthrough_ll` filesystem now supports creating
+ and writing to files.
* `fuse_main()` / `fuse_remove_signal_handlers()`: do not reset
`SIGPIPE` handler to `SIG_DFL` it was not set by us.
* Documented the `RENAME_EXCHANGE` and `RENAME_NOREPLACE` flags that
fuse_reply_err(req, 0);
}
+static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
+ mode_t mode, struct fuse_file_info *fi)
+{
+ int fd;
+ struct fuse_entry_param e;
+ int err;
+
+ fd = openat(lo_fd(req, parent), name,
+ (fi->flags | O_CREAT) & ~O_NOFOLLOW, mode);
+ if (fd == -1)
+ return (void) fuse_reply_err(req, errno);
+
+ fi->fh = fd;
+
+ err = lo_do_lookup(req, parent, name, &e);
+ if (err)
+ fuse_reply_err(req, err);
+ else
+ fuse_reply_create(req, &e, fi);
+}
+
static void lo_open(fuse_req_t req, fuse_ino_t ino,
- struct fuse_file_info *fi)
+ struct fuse_file_info *fi)
{
int fd;
char buf[64];
.readdir = lo_readdir,
.readdirplus = lo_readdirplus,
.releasedir = lo_releasedir,
+ .create = lo_create,
.open = lo_open,
.release = lo_release,
.read = lo_read,
tst_readdir(src_dir, work_dir)
tst_open_read(src_dir, work_dir)
tst_open_write(src_dir, work_dir)
+ tst_create(work_dir)
+ tst_passthrough(src_dir, work_dir)
if not is_ll:
tst_mkdir(work_dir)
tst_rmdir(src_dir, work_dir)
- tst_create(work_dir)
tst_unlink(src_dir, work_dir)
tst_symlink(work_dir)
if os.getuid() == 0:
tst_truncate_path(work_dir)
tst_truncate_fd(work_dir)
tst_open_unlink(work_dir)
- tst_passthrough(src_dir, work_dir)
subprocess.check_call([ os.path.join(basename, 'test', 'test_syscalls'),
work_dir, ':' + src_dir ])