mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 23:16:27 -05:00
Move everything to negative errno return types (#1499)
This commit is contained in:
parent
2b500f194a
commit
e8cd74cab0
177 changed files with 5952 additions and 5843 deletions
|
|
@ -16,40 +16,33 @@
|
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "errno.hpp"
|
||||
#include "fs_copydata.hpp"
|
||||
|
||||
#include "fs_copydata_copy_file_range.hpp"
|
||||
#include "fs_copydata_readwrite.hpp"
|
||||
#include "fs_fadvise.hpp"
|
||||
#include "fs_fallocate.hpp"
|
||||
#include "fs_ficlone.hpp"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
namespace fs
|
||||
int
|
||||
fs::copydata(const int src_fd_,
|
||||
const int dst_fd_,
|
||||
const size_t count_)
|
||||
{
|
||||
int
|
||||
copydata(const int src_fd_,
|
||||
const int dst_fd_,
|
||||
const size_t count_)
|
||||
{
|
||||
int rv;
|
||||
int rv;
|
||||
|
||||
rv = fs::fallocate(dst_fd_,0,0,count_);
|
||||
if((rv == -1) && (errno == ENOSPC))
|
||||
return rv;
|
||||
rv = fs::ficlone(src_fd_,dst_fd_);
|
||||
if(rv >= 0)
|
||||
return rv;
|
||||
|
||||
rv = fs::ficlone(src_fd_,dst_fd_);
|
||||
if(rv != -1)
|
||||
return rv;
|
||||
fs::fadvise_willneed(src_fd_,0,count_);
|
||||
fs::fadvise_sequential(src_fd_,0,count_);
|
||||
|
||||
fs::fadvise_willneed(src_fd_,0,count_);
|
||||
fs::fadvise_sequential(src_fd_,0,count_);
|
||||
rv = fs::copydata_copy_file_range(src_fd_,dst_fd_,count_);
|
||||
if(rv >= 0)
|
||||
return rv;
|
||||
|
||||
rv = fs::copydata_copy_file_range(src_fd_,dst_fd_,count_);
|
||||
if(rv != -1)
|
||||
return rv;
|
||||
|
||||
return fs::copydata_readwrite(src_fd_,dst_fd_,count_);
|
||||
}
|
||||
return fs::copydata_readwrite(src_fd_,dst_fd_,count_);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue