mirror of https://github.com/trapexit/mergerfs.git
Antonio SJ Musumeci
3 years ago
11 changed files with 1441 additions and 22 deletions
-
1libfuse/Makefile
-
4libfuse/include/fuse.h
-
1278libfuse/lib/debug.c
-
51libfuse/lib/debug.h
-
14libfuse/lib/fuse.c
-
9libfuse/lib/fuse_lowlevel.c
-
2src/config.cpp
-
2src/config.hpp
-
53src/config_log_metrics.cpp
-
31src/config_log_metrics.hpp
-
14src/fuse_ioctl.cpp
1278
libfuse/lib/debug.c
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,51 @@ |
|||
/* |
|||
ISC License |
|||
|
|||
Copyright (c) 2021, Antonio SJ Musumeci <trapexit@spawn.link> |
|||
|
|||
Permission to use, copy, modify, and/or distribute this software for any |
|||
purpose with or without fee is hereby granted, provided that the above |
|||
copyright notice and this permission notice appear in all copies. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|||
*/ |
|||
|
|||
#pragma once |
|||
|
|||
#include "fuse_kernel.h" |
|||
|
|||
void debug_fuse_open_out(const uint64_t unique, |
|||
const struct fuse_open_out *arg, |
|||
const uint64_t argsize); |
|||
void debug_fuse_init_in(const struct fuse_init_in *arg); |
|||
void debug_fuse_init_out(const uint64_t unique, |
|||
const struct fuse_init_out *arg, |
|||
const uint64_t argsize); |
|||
void debug_fuse_entry_out(const uint64_t unique, |
|||
const struct fuse_entry_out *arg, |
|||
const uint64_t argsize); |
|||
void debug_fuse_attr_out(const uint64_t unique, |
|||
const struct fuse_attr_out *arg, |
|||
const uint64_t argsize); |
|||
void debug_fuse_entry_open_out(const uint64_t unique, |
|||
const struct fuse_entry_out *earg, |
|||
const struct fuse_open_out *oarg); |
|||
void debug_fuse_readlink(const uint64_t unique, |
|||
const char *linkname); |
|||
void debug_fuse_write_out(const uint64_t unique, |
|||
const struct fuse_write_out *arg); |
|||
void debug_fuse_statfs_out(const uint64_t unique, |
|||
const struct fuse_statfs_out *arg); |
|||
void debug_fuse_getxattr_out(const uint64_t unique, |
|||
const struct fuse_getxattr_out *arg); |
|||
void debug_fuse_lk_out(const uint64_t unique, |
|||
const struct fuse_lk_out *arg); |
|||
void debug_fuse_bmap_out(const uint64_t unique, |
|||
const struct fuse_bmap_out *arg); |
|||
void debug_fuse_in_header(const struct fuse_in_header *hdr); |
@ -0,0 +1,53 @@ |
|||
/*
|
|||
ISC License |
|||
|
|||
Copyright (c) 2021, Antonio SJ Musumeci <trapexit@spawn.link> |
|||
|
|||
Permission to use, copy, modify, and/or distribute this software for any |
|||
purpose with or without fee is hereby granted, provided that the above |
|||
copyright notice and this permission notice appear in all copies. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|||
*/ |
|||
|
|||
#include "config_log_metrics.hpp"
|
|||
#include "from_string.hpp"
|
|||
#include "to_string.hpp"
|
|||
|
|||
#include "fuse.h"
|
|||
|
|||
LogMetrics::LogMetrics(const bool val_) |
|||
{ |
|||
fuse_log_metrics_set(val_); |
|||
} |
|||
|
|||
std::string |
|||
LogMetrics::to_string(void) const |
|||
{ |
|||
bool val; |
|||
|
|||
val = fuse_log_metrics_get(); |
|||
|
|||
return str::to(val); |
|||
} |
|||
|
|||
int |
|||
LogMetrics::from_string(const std::string &s_) |
|||
{ |
|||
int rv; |
|||
bool val; |
|||
|
|||
rv = str::from(s_,&val); |
|||
if(rv < 0) |
|||
return rv; |
|||
|
|||
fuse_log_metrics_set(val); |
|||
|
|||
return 0; |
|||
} |
@ -0,0 +1,31 @@ |
|||
/*
|
|||
ISC License |
|||
|
|||
Copyright (c) 2021, Antonio SJ Musumeci <trapexit@spawn.link> |
|||
|
|||
Permission to use, copy, modify, and/or distribute this software for any |
|||
purpose with or without fee is hereby granted, provided that the above |
|||
copyright notice and this permission notice appear in all copies. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|||
*/ |
|||
|
|||
#pragma once
|
|||
|
|||
#include "tofrom_string.hpp"
|
|||
|
|||
class LogMetrics : public ToFromString |
|||
{ |
|||
public: |
|||
LogMetrics(const bool); |
|||
|
|||
public: |
|||
std::string to_string(void) const final; |
|||
int from_string(const std::string &) final; |
|||
}; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue