mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-08 23:07:28 -04:00
main: add option to disable fsync
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
241fecf92b
commit
dc36739d0f
6
main.c
6
main.c
@ -240,6 +240,7 @@ struct ovl_data
|
|||||||
char *timeout_str;
|
char *timeout_str;
|
||||||
double timeout;
|
double timeout;
|
||||||
int threaded;
|
int threaded;
|
||||||
|
int fsync;
|
||||||
};
|
};
|
||||||
|
|
||||||
static double
|
static double
|
||||||
@ -267,6 +268,8 @@ static const struct fuse_opt ovl_opts[] = {
|
|||||||
offsetof (struct ovl_data, timeout_str), 0},
|
offsetof (struct ovl_data, timeout_str), 0},
|
||||||
{"threaded=%d",
|
{"threaded=%d",
|
||||||
offsetof (struct ovl_data, threaded), 0},
|
offsetof (struct ovl_data, threaded), 0},
|
||||||
|
{"fsync=%d",
|
||||||
|
offsetof (struct ovl_data, fsync), 1},
|
||||||
FUSE_OPT_END
|
FUSE_OPT_END
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3897,7 +3900,7 @@ ovl_fsync (fuse_req_t req, fuse_ino_t ino, int datasync, struct fuse_file_info *
|
|||||||
|
|
||||||
node = do_lookup_file (lo, ino, NULL);
|
node = do_lookup_file (lo, ino, NULL);
|
||||||
|
|
||||||
do_fsync = node && node->layer == get_upper_layer (lo);
|
do_fsync = lo->fsync && node && node->layer == get_upper_layer (lo);
|
||||||
|
|
||||||
l = release_big_lock ();
|
l = release_big_lock ();
|
||||||
|
|
||||||
@ -4118,6 +4121,7 @@ main (int argc, char *argv[])
|
|||||||
.lowerdir = NULL,
|
.lowerdir = NULL,
|
||||||
.redirect_dir = NULL,
|
.redirect_dir = NULL,
|
||||||
.mountpoint = NULL,
|
.mountpoint = NULL,
|
||||||
|
.fsync = 1,
|
||||||
.timeout = 1000000000.0,
|
.timeout = 1000000000.0,
|
||||||
.timeout_str = NULL,
|
.timeout_str = NULL,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user