diff options
Diffstat (limited to 'netfs/daemon/daemonFile.cpp')
-rw-r--r-- | netfs/daemon/daemonFile.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/netfs/daemon/daemonFile.cpp b/netfs/daemon/daemonFile.cpp index ec96bc3..56adcc5 100644 --- a/netfs/daemon/daemonFile.cpp +++ b/netfs/daemon/daemonFile.cpp @@ -1,21 +1,17 @@ +#include "daemonFile.h" #include <Ice/ObjectAdapter.h> #include <cerrno> -#include <map> +#include <entCache.h> #include <fcntl.h> -#include <typeConverter.h> +#include <map> #include <sys/stat.h> -#include "daemonFile.h" -#include <entCache.h> +#include <typeConverter.h> #include <unistd.h> -FileServer::FileServer(int f, EntryTypeConverter & t) : - EntryTypeConverter(t), - fd(f) -{ -} +FileServer::FileServer(int f, EntryTypeConverter & t) : EntryTypeConverter(t), fd(f) { } void -FileServer::ftruncate(const NetFS::ReqEnv re, Ice::Long size, const Ice::Current&) +FileServer::ftruncate(const NetFS::ReqEnv re, Ice::Long size, const Ice::Current &) { (void)re; errno = 0; @@ -28,7 +24,8 @@ NetFS::Attr FileServer::fgetattr(const NetFS::ReqEnv re, const Ice::Current &) { (void)re; - struct stat s {}; + struct stat s { + }; if (::fstat(fd, &s) != 0) { throw NetFS::SystemError(errno); } @@ -46,7 +43,7 @@ FileServer::close(const Ice::Current & ice) } NetFS::Buffer -FileServer::read(Ice::Long offset, Ice::Long size, const Ice::Current&) +FileServer::read(Ice::Long offset, Ice::Long size, const Ice::Current &) { NetFS::Buffer buf; buf.resize(size); @@ -62,7 +59,7 @@ FileServer::read(Ice::Long offset, Ice::Long size, const Ice::Current&) } void -FileServer::write(Ice::Long offset, Ice::Long size, const NetFS::Buffer data, const Ice::Current&) +FileServer::write(Ice::Long offset, Ice::Long size, const NetFS::Buffer data, const Ice::Current &) { errno = 0; if (pwrite(fd, &data.front(), size, offset) != size) { @@ -71,14 +68,13 @@ FileServer::write(Ice::Long offset, Ice::Long size, const NetFS::Buffer data, co } Ice::Long -FileServer::copyrange(NetFS::FilePrxPtr to, Ice::Long offsrc, Ice::Long offdst, Ice::Long size, Ice::Int flags, const Ice::Current& ice) +FileServer::copyrange(NetFS::FilePrxPtr to, Ice::Long offsrc, Ice::Long offdst, Ice::Long size, Ice::Int flags, + const Ice::Current & ice) { - if (auto obj = ice.adapter->findByProxy(to); - auto file = std::dynamic_pointer_cast<FileServer>(obj)) { + if (auto obj = ice.adapter->findByProxy(to); auto file = std::dynamic_pointer_cast<FileServer>(obj)) { errno = 0; off_t src = offsrc, dst = offdst; - if (auto rtn = copy_file_range(fd, &src, file->fd, &dst, size, flags); - rtn != -1) { + if (auto rtn = copy_file_range(fd, &src, file->fd, &dst, size, flags); rtn != -1) { return rtn; } throw NetFS::SystemError(errno); @@ -88,4 +84,3 @@ FileServer::copyrange(NetFS::FilePrxPtr to, Ice::Long offsrc, Ice::Long offdst, return size; } } - |