X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=fusefile.c;h=b9d3b2d68b7ee71ba0ab2080187d6f2584c3f52e;hb=ea1b1d896de3b60c0d05adbcc10cac2a7f4a38ac;hp=a0f09818da187d7958c75d6117ef5ed6bdebd06c;hpb=5e65b7ecf2c54b600c5d98f06031ecf62e5a6cec;p=rrq%2Ffusefile.git 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() {