Browse Source

Merge pull request #624 from trapexit/parallel_dirops

ensure parallel dirops is enabled if capable
pull/627/head
trapexit 6 years ago
committed by GitHub
parent
commit
cc9381f578
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      libfuse/include/fuse_common.h
  2. 4
      libfuse/lib/fuse_lowlevel.c
  3. 1
      src/fuse_init.cpp

1
libfuse/include/fuse_common.h

@ -113,6 +113,7 @@ struct fuse_file_info {
#define FUSE_CAP_FLOCK_LOCKS (1 << 10)
#define FUSE_CAP_IOCTL_DIR (1 << 11)
#define FUSE_CAP_ASYNC_DIO (1 << 15)
#define FUSE_CAP_PARALLEL_DIROPS (1 << 18)
#define FUSE_CAP_POSIX_ACL (1 << 19)

4
libfuse/lib/fuse_lowlevel.c

@ -1799,6 +1799,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
f->conn.capable |= FUSE_CAP_POSIX_ACL;
if (arg->flags & FUSE_ASYNC_DIO)
f->conn.capable |= FUSE_CAP_ASYNC_DIO;
if (arg->flags & FUSE_PARALLEL_DIROPS)
f->conn.capable |= FUSE_CAP_PARALLEL_DIROPS;
} else {
f->conn.async_read = 0;
f->conn.max_readahead = 0;
@ -1869,6 +1871,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
outarg.flags |= FUSE_POSIX_ACL;
if (f->conn.want & FUSE_CAP_ASYNC_DIO)
outarg.flags |= FUSE_ASYNC_DIO;
if (f->conn.want & FUSE_CAP_PARALLEL_DIROPS)
outarg.flags |= FUSE_PARALLEL_DIROPS;
outarg.max_readahead = f->conn.max_readahead;
outarg.max_write = f->conn.max_write;
if (f->conn.proto_minor >= 13) {

1
src/fuse_init.cpp

@ -43,6 +43,7 @@ namespace FUSE
l::want_if_capable(conn_,FUSE_CAP_DONT_MASK);
l::want_if_capable(conn_,FUSE_CAP_IOCTL_DIR);
l::want_if_capable(conn_,FUSE_CAP_ASYNC_DIO);
l::want_if_capable(conn_,FUSE_CAP_PARALLEL_DIROPS);
if(Config::get().posix_acl)
l::want_if_capable(conn_,FUSE_CAP_POSIX_ACL);

Loading…
Cancel
Save