def get_all_eden_mount_points(mount_table: mtab.MountTable) -> Set[bytes]: all_system_mounts = mount_table.read() return { mount.mount_point for mount in all_system_mounts if is_edenfs_mount_device(mount.device) and mount.vfstype == b"fuse" }
def in_proc_mounts(self, mount_path: str) -> bool: """Gets all eden mounts found in /proc/mounts, and returns true if this eden instance exists in list. """ mount_path_bytes = mount_path.encode() with open("/proc/mounts", "rb") as f: return any(mount_path_bytes == line.split(b" ")[1] for line in f.readlines() if util.is_edenfs_mount_device(line.split(b" ")[0]))
def get_all_eden_mount_points( mount_table: mtab.MountTable) -> Set[Tuple[bytes, bytes]]: """ Returns a set of mount point path, mount point type pairs of all of the mounts which seem to be EdenFS mounts. """ all_system_mounts = mount_table.read() eden_mounts = set() for mount in all_system_mounts: if is_edenfs_mount_device(mount.device): if mount.vfstype == b"fuse" or mount.vfstype == b"macfuse_eden": eden_mounts.add((mount.mount_point, b"fuse")) elif mount.vfstype == b"nfs" or mount.vfstype == b"edenfs:": eden_mounts.add((mount.mount_point, b"nfs")) return eden_mounts