mirror of https://github.com/trapexit/mergerfs.git
Browse Source
Merge pull request #402 from trapexit/nopath
Merge pull request #402 from trapexit/nopath
enable nopath and nullpath_okpull/403/head
Antonio SJ Musumeci
8 years ago
committed by
GitHub
21 changed files with 208 additions and 55 deletions
-
10src/config.hpp
-
2src/create.cpp
-
34src/dirinfo.hpp
-
2src/fgetattr.cpp
-
9src/fileinfo.hpp
-
2src/flush.cpp
-
4src/fs_base_fsync.hpp
-
6src/fs_base_ioctl.hpp
-
7src/fsync.cpp
-
53src/fsyncdir.cpp
-
33src/fsyncdir.hpp
-
3src/ftruncate.cpp
-
38src/ioctl.cpp
-
7src/mergerfs.cpp
-
2src/open.cpp
-
4src/opendir.cpp
-
4src/read.cpp
-
13src/readdir.cpp
-
5src/release.cpp
-
15src/releasedir.cpp
-
10src/write.cpp
@ -0,0 +1,34 @@ |
|||
/*
|
|||
Copyright (c) 2017, 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. |
|||
*/ |
|||
|
|||
#ifndef __DIRINFO_HPP__
|
|||
#define __DIRINFO_HPP__
|
|||
|
|||
#include <string>
|
|||
|
|||
class DirInfo |
|||
{ |
|||
public: |
|||
DirInfo(const char *fusepath_) |
|||
: fusepath(fusepath_) |
|||
{ |
|||
} |
|||
|
|||
public: |
|||
std::string fusepath; |
|||
}; |
|||
|
|||
#endif
|
@ -0,0 +1,53 @@ |
|||
/*
|
|||
Copyright (c) 2017, 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 <fuse.h>
|
|||
|
|||
#include <string>
|
|||
#include <vector>
|
|||
|
|||
#include "errno.hpp"
|
|||
#include "dirinfo.hpp"
|
|||
#include "fs_base_fsync.hpp"
|
|||
|
|||
static |
|||
int |
|||
_fsyncdir(const DirInfo *di, |
|||
const int isdatasync) |
|||
{ |
|||
int rv; |
|||
|
|||
rv = -1; |
|||
errno = ENOSYS; |
|||
|
|||
return ((rv == -1) ? -errno : 0); |
|||
} |
|||
|
|||
namespace mergerfs |
|||
{ |
|||
namespace fuse |
|||
{ |
|||
int |
|||
fsyncdir(const char *fusepath, |
|||
int isdatasync, |
|||
fuse_file_info *ffi) |
|||
{ |
|||
DirInfo *di = reinterpret_cast<DirInfo*>(ffi->fh); |
|||
|
|||
return ::_fsyncdir(di,isdatasync); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
/*
|
|||
Copyright (c) 2017, 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. |
|||
*/ |
|||
|
|||
#ifndef __FSYNCDIR_HPP__
|
|||
#define __FSYNCDIR_HPP__
|
|||
|
|||
#include <fuse.h>
|
|||
|
|||
namespace mergerfs |
|||
{ |
|||
namespace fuse |
|||
{ |
|||
int |
|||
fsyncdir(const char *fusepath, |
|||
int isdatasync, |
|||
fuse_file_info *ffi); |
|||
} |
|||
} |
|||
|
|||
#endif
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue