Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def entry_attributes(self):
attr = pyfuse3.EntryAttributes()
attr.st_nlink = self.refcount
attr.st_blocks = (self.size + 511) // 512
attr.st_ino = self.id
# Timeout, can effectively be infinite since attribute changes
# are only triggered by the kernel's own requests
attr.attr_timeout = 3600
attr.entry_timeout = 3600
# We want our blocksize for IO as large as possible to get large
# write requests
attr.st_blksize = 128 * 1024
attr.st_mode = self.mode
attr.st_uid = self.uid
attr.st_gid = self.gid
async def getattr(self, inode, ctx=None):
node = self._get_node(inode)
l.debug("getattr: %r", node)
entry = pyfuse3.EntryAttributes()
entry.st_ino = inode
entry.generation = 0
entry.entry_timeout = 0
entry.attr_timeout = 0
if not node.is_last:
entry.st_mode = 0o040777
else:
entry.st_mode = 0o100777
entry.st_nlink = 1
entry.st_uid = 1000
entry.st_gid = 1000
entry.st_rdev = 0
if not node.is_last:
entry.st_size = 4096
else: