mirror of https://github.com/trapexit/mergerfs.git
Browse Source
Major cleanup of libfuse to remove unneeded features
Major cleanup of libfuse to remove unneeded features
* Remove request interrupt code. Required tracking of all requests unnecesssarily. * Remove all debugging printing. Have plans to do full replacement. * Remove deprecated functions. * Remove unneeded error checking. * Remove "userdata" which was unused. * Remove allow_root feature.pull/954/head
Antonio SJ Musumeci
3 years ago
21 changed files with 477 additions and 1649 deletions
-
64libfuse/include/fuse.h
-
30libfuse/include/fuse_lowlevel.h
-
787libfuse/lib/fuse.c
-
22libfuse/lib/fuse_i.h
-
836libfuse/lib/fuse_lowlevel.c
-
22libfuse/lib/helper.c
-
15libfuse/lib/mount_bsd.c
-
15libfuse/lib/mount_generic.c
-
4libfuse/util/fusermount.c
-
39src/fuse_bmap.cpp
-
29src/fuse_bmap.hpp
-
2src/fuse_destroy.cpp
-
2src/fuse_destroy.hpp
-
33src/fuse_lock.cpp
-
29src/fuse_lock.hpp
-
37src/fuse_poll.cpp
-
17src/fuse_poll.hpp
-
88src/fuse_read.cpp
-
28src/fuse_read_buf.cpp
-
6src/fuse_read_buf.hpp
-
21src/mergerfs.cpp
787
libfuse/lib/fuse.c
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
836
libfuse/lib/fuse_lowlevel.c
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,39 @@ |
|||
/*
|
|||
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 "errno.hpp"
|
|||
|
|||
#include <cstdint>
|
|||
|
|||
#include <stddef.h>
|
|||
|
|||
|
|||
namespace FUSE |
|||
{ |
|||
int |
|||
bmap(const char *fusepath_, |
|||
size_t blocksize_, |
|||
uint64_t *idx_) |
|||
{ |
|||
(void)fusepath_; |
|||
(void)blocksize_; |
|||
(void)idx_; |
|||
|
|||
return -ENOSYS; |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
/*
|
|||
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.h"
|
|||
|
|||
namespace FUSE |
|||
{ |
|||
int |
|||
bmap(const char *fusepath, |
|||
size_t blocksize, |
|||
uint64_t *idx); |
|||
} |
@ -0,0 +1,33 @@ |
|||
/*
|
|||
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 "errno.hpp"
|
|||
|
|||
#include "fuse.h"
|
|||
|
|||
|
|||
namespace FUSE |
|||
{ |
|||
int |
|||
lock(const fuse_file_info_t *ffi, |
|||
int cmd, |
|||
struct flock *flock) |
|||
{ |
|||
return -ENOSYS; |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
/*
|
|||
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.h"
|
|||
|
|||
namespace FUSE |
|||
{ |
|||
int |
|||
lock(const fuse_file_info_t *ffi, |
|||
int cmd, |
|||
struct flock *flock); |
|||
} |
@ -0,0 +1,37 @@ |
|||
/*
|
|||
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 "errno.hpp"
|
|||
|
|||
#include "fuse.h"
|
|||
|
|||
|
|||
namespace FUSE |
|||
{ |
|||
int |
|||
poll(const fuse_file_info_t *ffi_, |
|||
fuse_pollhandle_t *ph_, |
|||
unsigned *reventsp_) |
|||
{ |
|||
(void)ffi_; |
|||
(void)ph_; |
|||
(void)reventsp_; |
|||
|
|||
return -ENOSYS; |
|||
} |
|||
} |
@ -1,88 +0,0 @@ |
|||
/*
|
|||
Copyright (c) 2016, 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 "errno.hpp"
|
|||
#include "fileinfo.hpp"
|
|||
#include "fs_read.hpp"
|
|||
|
|||
#include "fuse.h"
|
|||
|
|||
|
|||
namespace l |
|||
{ |
|||
static |
|||
inline |
|||
int |
|||
read_regular(const int fd_, |
|||
void *buf_, |
|||
const size_t count_, |
|||
const off_t offset_) |
|||
{ |
|||
int rv; |
|||
|
|||
rv = fs::pread(fd_,buf_,count_,offset_); |
|||
if(rv == -1) |
|||
return -errno; |
|||
if(rv == 0) |
|||
return 0; |
|||
|
|||
return count_; |
|||
} |
|||
|
|||
static |
|||
inline |
|||
int |
|||
read_direct_io(const int fd_, |
|||
void *buf_, |
|||
const size_t count_, |
|||
const off_t offset_) |
|||
{ |
|||
int rv; |
|||
|
|||
rv = fs::pread(fd_,buf_,count_,offset_); |
|||
if(rv == -1) |
|||
return -errno; |
|||
|
|||
return rv; |
|||
} |
|||
} |
|||
|
|||
namespace FUSE |
|||
{ |
|||
int |
|||
read(const fuse_file_info_t *ffi_, |
|||
char *buf_, |
|||
size_t count_, |
|||
off_t offset_) |
|||
{ |
|||
FileInfo *fi; |
|||
|
|||
fi = reinterpret_cast<FileInfo*>(ffi_->fh); |
|||
|
|||
if(ffi_->direct_io) |
|||
return l::read_direct_io(fi->fd,buf_,count_,offset_); |
|||
return l::read_regular(fi->fd,buf_,count_,offset_); |
|||
} |
|||
|
|||
int |
|||
read_null(const fuse_file_info_t *ffi_, |
|||
char *buf_, |
|||
size_t count_, |
|||
off_t offset_) |
|||
{ |
|||
return count_; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue