From: Ralph Ronnquist Date: Sat, 16 Jul 2022 11:14:20 +0000 (+1000) Subject: disable asynchronous reading/writing X-Git-Tag: 0.4~6 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=ea1b1d896de3b60c0d05adbcc10cac2a7f4a38ac;p=rrq%2Ffusefile.git disable asynchronous reading/writing --- diff --git a/fusefile.c b/fusefile.c index a0f0981..b9d3b2d 100644 --- a/fusefile.c +++ b/fusefile.c @@ -225,6 +225,7 @@ static int fusefile_read(const char *path, char *buf, size_t size, #if DEBUG print_source( &sources.array[i] ); #endif + times.atime = time( 0 ); size_t b = off - sources.array[i].start + sources.array[i].from; size_t n = sources.array[i].to - b; if ( n > size ) { @@ -252,7 +253,6 @@ static int fusefile_read(const char *path, char *buf, size_t size, off += r; size -= r; } - times.atime = time( 0 ); return rr; } @@ -411,6 +411,19 @@ static int fusefile_truncate(const char *path, off_t len) { return -EIO; } +void *fusefile_init(struct fuse_conn_info *fci) { +#if DEBUG + fprintf( stderr, "fusefile_init( %d, %d )\n", fci->async_read, fci->want ); +#endif + // Disable asynchronous reading + fci->async_read = 0; + fci->want &= ~FUSE_CAP_ASYNC_READ; +#if DEBUG + fprintf( stderr, "fusefile_init( %d, %d )\n", fci->async_read, fci->want ); +#endif + return 0; +} + static struct fuse_operations fusefile_oper = { .getattr = fusefile_getattr, .chmod = fusefile_chmod, @@ -426,7 +439,7 @@ static struct fuse_operations fusefile_oper = { .truncate = fusefile_truncate, //.truncate = fusefile_truncate, //.release = fusefile_release, - //void *(*init) (struct fuse_conn_info *conn); + .init = fusefile_init, }; static void usage() {