Skip to content

Commit

Permalink
Merge pull request #361 from trapexit/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
trapexit authored Jan 19, 2017
2 parents 078e4ba + a60d815 commit 011febc
Show file tree
Hide file tree
Showing 108 changed files with 525 additions and 103 deletions.
5 changes: 5 additions & 0 deletions src/access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __ACCESS_HPP__
#define __ACCESS_HPP__

namespace mergerfs
{
namespace fuse
Expand All @@ -23,3 +26,5 @@ namespace mergerfs
int mask);
}
}

#endif
5 changes: 5 additions & 0 deletions src/assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __ASSERT_HPP__
#define __ASSERT_HPP__

#define STATIC_ASSERT(cond) assert::StaticAssert< (cond) >()
#define STATIC_ARRAYLENGTH_ASSERT(array,size) STATIC_ASSERT(((sizeof(array)/sizeof(array[0]))==(size)))

Expand All @@ -26,3 +29,5 @@ namespace assert
struct StaticAssert<true>
{};
}

#endif
5 changes: 5 additions & 0 deletions src/buildmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __BUILDMAP_HPP__
#define __BUILDMAP_HPP__

#include <algorithm>

template<typename K,typename V>
Expand Down Expand Up @@ -41,3 +44,5 @@ class buildmap
private:
std::map<K,V> _map;
};

#endif
5 changes: 5 additions & 0 deletions src/buildvector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __BUILDVECTOR_HPP__
#define __BUILDVECTOR_HPP__

#include <algorithm>

template<typename V, bool SORT = false>
Expand Down Expand Up @@ -41,3 +44,5 @@ class buildvector
private:
std::vector<V> _vector;
};

#endif
2 changes: 1 addition & 1 deletion src/chmod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _chmod_loop_core(const string *basepath,

rv = fs::chmod(fullpath,mode);

return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}

static
Expand Down
5 changes: 5 additions & 0 deletions src/chmod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __CHMOD_HPP__
#define __CHMOD_HPP__

namespace mergerfs
{
namespace fuse
Expand All @@ -23,3 +26,5 @@ namespace mergerfs
mode_t mode);
}
}

#endif
2 changes: 1 addition & 1 deletion src/chown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ _chown_loop_core(const string *basepath,

rv = fs::lchown(fullpath,uid,gid);

return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}

static
Expand Down
5 changes: 5 additions & 0 deletions src/chown.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __CHOWN_HPP__
#define __CHOWN_HPP__

namespace mergerfs
{
namespace fuse
Expand All @@ -24,3 +27,5 @@ namespace mergerfs
gid_t gid);
}
}

#endif
5 changes: 5 additions & 0 deletions src/create.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __CREATE_HPP__
#define __CREATE_HPP__

#include <fuse.h>

#include <sys/types.h>
Expand All @@ -28,3 +31,5 @@ namespace mergerfs
fuse_file_info *ffi);
}
}

#endif
5 changes: 5 additions & 0 deletions src/destroy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __DESTROY_HPP__
#define __DESTROY_HPP__

namespace mergerfs
{
namespace fuse
Expand All @@ -22,3 +25,5 @@ namespace mergerfs
destroy(void *);
}
}

#endif
5 changes: 5 additions & 0 deletions src/errno.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __ERRNO_HPP__
#define __ERRNO_HPP__

#include <errno.h>

#if defined(ENODATA) && !defined(ENOATTR)
Expand All @@ -27,3 +30,5 @@
#if !defined(ENOATTR) && !defined(ENODATA)
#error "Neither ENOATTR or ENODATA defined: please contact mergerfs author with platform information"
#endif

#endif
5 changes: 5 additions & 0 deletions src/fallocate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FALLOCATE_HPP__
#define __FALLOCATE_HPP__

namespace mergerfs
{
namespace fuse
Expand All @@ -26,3 +29,5 @@ namespace mergerfs
fuse_file_info *fi);
}
}

#endif
5 changes: 5 additions & 0 deletions src/fgetattr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FGETATTR_HPP__
#define __FGETATTR_HPP__

#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
Expand All @@ -28,3 +31,5 @@ namespace mergerfs
fuse_file_info *fileinfo);
}
}

#endif
5 changes: 5 additions & 0 deletions src/flock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FLOCK_HPP__
#define __FLOCK_HPP__

namespace mergerfs
{
namespace fuse
Expand All @@ -24,3 +27,5 @@ namespace mergerfs
int op);
}
}

#endif
5 changes: 5 additions & 0 deletions src/flush.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FLUSH_HPP__
#define __FLUSH_HPP__

namespace mergerfs
{
namespace fuse
Expand All @@ -23,3 +26,5 @@ namespace mergerfs
fuse_file_info *fi);
}
}

#endif
4 changes: 2 additions & 2 deletions src/fs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#ifndef __FS_HPP__
#define __FS_HPP__

#include <stdint.h>

#include <string>
#include <vector>

#include <stdint.h>

namespace fs
{
using std::string;
Expand Down
5 changes: 5 additions & 0 deletions src/fs_base_access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FS_BASE_ACCESS_HPP__
#define __FS_BASE_ACCESS_HPP__

#include <string>

#include <fcntl.h>
Expand Down Expand Up @@ -53,3 +56,5 @@ namespace fs
return fs::access(path,mode,AT_EACCESS);
}
}

#endif
5 changes: 5 additions & 0 deletions src/fs_base_chmod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FS_BASE_CHMOD_HPP__
#define __FS_BASE_CHMOD_HPP__

#include <sys/stat.h>

namespace fs
Expand Down Expand Up @@ -47,3 +50,5 @@ namespace fs
return ::fchmod(fd,st.st_mode);
}
}

#endif
5 changes: 5 additions & 0 deletions src/fs_base_chown.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FS_BASE_CHOWN_HPP__
#define __FS_BASE_CHOWN_HPP__

#include <string>

#include <sys/stat.h>
Expand Down Expand Up @@ -72,3 +75,5 @@ namespace fs
return fs::fchown(fd,st.st_uid,st.st_gid);
}
}

#endif
5 changes: 5 additions & 0 deletions src/fs_base_close.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FS_BASE_CLOSE_HPP__
#define __FS_BASE_CLOSE_HPP__

#include <unistd.h>

namespace fs
Expand All @@ -28,3 +31,5 @@ namespace fs
return ::close(fd);
}
}

#endif
5 changes: 5 additions & 0 deletions src/fs_base_closedir.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FS_BASE_CLOSEDIR_HPP__
#define __FS_BASE_CLOSEDIR_HPP__

#include <dirent.h>
#include <sys/types.h>

Expand All @@ -29,3 +32,5 @@ namespace fs
return ::closedir(dirp);
}
}

#endif
5 changes: 5 additions & 0 deletions src/fs_base_dup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FS_BASE_DUP_HPP__
#define __FS_BASE_DUP_HPP__

#include <unistd.h>

namespace fs
Expand All @@ -28,3 +31,5 @@ namespace fs
return ::dup(fd);
}
}

#endif
5 changes: 5 additions & 0 deletions src/fs_base_flock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FS_BASE_FLOCK_HPP__
#define __FS_BASE_FLOCK_HPP__

#include <sys/file.h>

namespace fs
Expand All @@ -29,3 +32,5 @@ namespace fs
return ::flock(fd,operation);
}
}

#endif
8 changes: 7 additions & 1 deletion src/fs_base_fsync.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include <errno.h>
#ifndef __FS_BASE_FSYNC_HPP__
#define __FS_BASE_FSYNC_HPP__

#include <unistd.h>

#include "errno.hpp"

namespace fs
{
static
Expand All @@ -41,3 +45,5 @@ namespace fs
#endif
}
}

#endif
5 changes: 5 additions & 0 deletions src/fs_base_ftruncate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef __FS_BASE_FTRUNCATE_HPP__
#define __FS_BASE_FTRUNCATE_HPP__

#include <sys/types.h>
#include <unistd.h>

Expand All @@ -30,3 +33,5 @@ namespace fs
return ::ftruncate(fd,size);
}
}

#endif
Loading

0 comments on commit 011febc

Please sign in to comment.