Skip to content

Commit

Permalink
Merge PR ceph#20855 into master
Browse files Browse the repository at this point in the history
* refs/pull/20855/head:
	client: add the fuse parameter max_write

Reviewed-by: Patrick Donnelly <[email protected]>
  • Loading branch information
batrick committed Apr 3, 2018
2 parents 9d8037f + 8dbc5c9 commit 8b7892f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/cephfs/client-config-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@
:Type: Boolean
:Default: ``true``

``fuse max write``

:Description: Set the maximum number of bytes in a single write operation. Because the FUSE default is 128kbytes, SO fuse_max_write default set to 0(The default does not take effect)
:Type: Integer
:Default: ``0``

Developer Options
#################

Expand Down
9 changes: 9 additions & 0 deletions src/client/fuse_ll.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,8 @@ int CephFuse::Handle::init(int argc, const char *argv[])
"fuse_atomic_o_trunc");
auto fuse_debug = client->cct->_conf->get_val<bool>(
"fuse_debug");
auto fuse_max_write = client->cct->_conf->get_val<uint64_t>(
"fuse_max_write");

if (fuse_allow_other) {
newargv[newargc++] = "-o";
Expand All @@ -1109,6 +1111,13 @@ int CephFuse::Handle::init(int argc, const char *argv[])
newargv[newargc++] = "-o";
newargv[newargc++] = "big_writes";
}
if (fuse_max_write > 0) {
char strsplice[65];
newargv[newargc++] = "-o";
newargv[newargc++] = strsplice;
sprintf(strsplice, "max_write=%" PRIu64, fuse_max_write);
newargv[newargc++] = strsplice;
}
if (fuse_atomic_o_trunc) {
newargv[newargc++] = "-o";
newargv[newargc++] = "atomic_o_trunc";
Expand Down
4 changes: 4 additions & 0 deletions src/common/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7071,6 +7071,10 @@ std::vector<Option> get_mds_client_options() {
.set_default(false)
.set_description("big_writes is deprecated in libfuse 3.0.0"),

Option("fuse_max_write", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(0)
.set_description("Set the maximum number of bytes in a single write operation. Because the FUSE default is 128kbytes, SO fuse_max_write default set to 0(The default does not take effect)"),

Option("fuse_atomic_o_trunc", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(true)
.set_description(""),
Expand Down

0 comments on commit 8b7892f

Please sign in to comment.