FUSEX: avoid to create/open a journal for a read-only attachment to save file descriptors

parent cedc381d
Pipeline #504274 passed with stages
in 43 minutes and 39 seconds
......@@ -550,8 +550,8 @@ data::datax::attach(fuse_req_t freq, std::string& cookie, int flags)
}
int bcache = mFile->file() ? mFile->file()->attach(freq, cookie, isRW) : 0;
int jcache = mFile->journal() ? mFile->journal()->attach(freq, cookie,
isRW) : 0;
int jcache = mFile->journal() ? (isRW ? mFile->journal()->attach(freq, cookie,
isRW) : 0) : 0;
if (bcache < 0) {
char msg[1024];
......@@ -1575,7 +1575,8 @@ data::datax::detach(fuse_req_t req, std::string& cookie, int flags)
int rflush = flush(req);
XrdSysMutexHelper lLock(mLock);
int bcache = mFile->file() ? mFile->file()->detach(cookie) : 0;
int jcache = mFile->journal() ? mFile->journal()->detach(cookie) : 0;
int jcache = mFile->journal() ? (isRW ? mFile->journal()->detach(
cookie) : 0) : 0;
int xio = 0;
if (isRW) {
......
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