Commit 6588e1a7 authored by Andreas Joachim Peters's avatar Andreas Joachim Peters Committed by Elvin Sindrilaru

MGM/FUSEX: properly support local FIFOs client&server side - this can be…

MGM/FUSEX: properly support local FIFOs client&server side - this can be extended to have FIFOs between machines
parent b3d5de32
......@@ -87,6 +87,7 @@
const char *k_mdino = "sys.eos.mdino";
const char *k_nlink = "sys.eos.nlink";
const char *k_fifo = "sys.eos.fifo";
EosFuse* EosFuse::sEosFuse = 0;
......@@ -3255,6 +3256,11 @@ The O_NONBLOCK flag was specified, and an incompatible lease was held on the fil
md->set_err(0);
md->set_mode(mode | (S_ISFIFO(mode) ? S_IFIFO : S_IFREG));
if (S_ISFIFO(mode)) {
(*md->mutable_attr())[k_fifo] = "";
}
struct timespec ts;
eos::common::Timing::GetTimeSpec(ts);
md->set_name(name);
......
......@@ -321,6 +321,7 @@ void
metad::mdx::convert(struct fuse_entry_param& e)
{
const char *k_mdino = "sys.eos.mdino";
const char *k_fifo = "sys.eos.fifo";
auto attrMap = attr();
e.ino = id();
......@@ -341,6 +342,12 @@ metad::mdx::convert(struct fuse_entry_param& e)
e.ino = e.attr.st_ino = local_ino;
}
if (attrMap.count(k_fifo)) {
e.attr.st_mode &= !S_IFREG;
e.attr.st_mode |= S_IFIFO;
}
e.attr.st_uid = uid();
e.attr.st_gid = gid();
e.attr.st_rdev = 0;
......
......@@ -2585,7 +2585,7 @@ FuseServer::HandleMD(const std::string& id,
return 0;
}
if (S_ISREG(md.mode())) {
if (S_ISREG(md.mode()) || S_ISFIFO(md.mode())) {
eos_static_info("ino=%lx pin=%lx authid=%s file", (long) md.md_ino(),
(long) md.md_pino(),
md.authid().c_str());
......
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