def mkfs(self, args): str = "" if len(args) > 2: str += "Usage: mkfs [-reuse]" return str brandnew = True if len(args) > 1: if args[1] == "-reuse": brandnew = False else: str += "Usage: mkfs [-reuse]" return str segmentmonitor = Cleaner.SegmentMonitor() Disk.disk = DiskClass(brandnew=brandnew) Segment.segmentmanager = SegmentManagerClass(segmentmonitor) InodeMap.inodemap = InodeMapClass() LFS.filesystem = LFSClass(initdisk=brandnew) if CLEANERFLAG: Cleaner.cleaner = Cleaner.CleanerClass(segmentmonitor) Cleaner.cleaner.start() #Starting the cleaner thread if brandnew: Inode.inodeidpool = 1 #Resetting this to 1 because mkfs might be run multiple times rootinode = Inode(isdirectory=True) #We make the root inode here else: LFS.filesystem.restore() return "1"