Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def readdir(self, id_, off, token):
log.debug('started with %d, %d', id_, off)
if off == 0:
off = -1
inode = self.inodes[id_]
if inode.atime_ns < inode.ctime_ns or inode.atime_ns < inode.mtime_ns:
inode.atime_ns = time_ns()
# NFS treats offsets 1 and 2 special, so we have to exclude
# them.
with self.db.query("SELECT name_id, name, inode FROM contents_v "
'WHERE parent_inode=? AND name_id > ? ORDER BY name_id',
(id_, off-3)) as res:
for (next_, name, cid_) in res:
if not pyfuse3.readdir_reply(
token, name, self.inodes[cid_].entry_attributes(), next_+3):
break
self.open_inodes[cid_] += 1
async def readdir(self, inode, off, token):
l.debug("readdir: inode=%r, off=%r, token=%r", inode, off, token)
if off < 1:
pyfuse3.readdir_reply(token, BASHFS_RUN,
await self.lookup(inode, BASHFS_RUN), 1)
return None