Commit b3d5de32 by Rainer Toebbicke Committed by Elvin Sindrilaru

EOS-2452 Support for FIFOs

parent dc36842d
......@@ -3105,11 +3105,10 @@ EosFuse::mknod(fuse_req_t req, fuse_ino_t parent, const char* name,
int rc = 0;
fuse_id id(req);
if (!S_ISREG(mode)) {
// we only implement files
rc = ENOSYS;
} else {
if (S_ISREG(mode) || S_ISFIFO(mode)) {
create(req, parent, name, mode, 0);
} else {
rc = ENOSYS;
}
if (rc) {
......@@ -3255,7 +3254,7 @@ The O_NONBLOCK flag was specified, and an incompatible lease was held on the fil
}
md->set_err(0);
md->set_mode(mode | S_IFREG);
md->set_mode(mode | (S_ISFIFO(mode) ? S_IFIFO : S_IFREG));
struct timespec ts;
eos::common::Timing::GetTimeSpec(ts);
md->set_name(name);
......
......@@ -2876,9 +2876,9 @@ FuseServer::HandleMD(const std::string& id,
return 0;
}
if (S_ISLNK(md.mode())) {
if (S_ISLNK(md.mode()) || S_ISFIFO(md.mode())) {
uint64_t clock = 0;
eos_static_info("ino=%lx set-link", (long) md.md_ino());
eos_static_info("ino=%#lx set-link/fifo %s", (long) md.md_ino(), md.name().c_str());
eos::common::RWMutexWriteLock lock(gOFS->eosViewRWMutex);
std::shared_ptr<eos::IFileMD> fmd;
std::shared_ptr<eos::IContainerMD> pcmd;
......@@ -2903,7 +2903,7 @@ FuseServer::HandleMD(const std::string& id,
}
fmd->setName(md.name());
fmd->setLink(md.target());
if (S_ISLNK(md.mode())) fmd->setLink(md.target());
fmd->setLayoutId(0);
md_ino = eos::common::FileId::FidToInode(fmd->getId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment