def unlink(self):
        log.info('Unlinking inode %r', self.name)

        nlink = self['nlink'] - 1
        if nlink > 0:
            log.info('Links remaining for inode %r: %d', self.name, nlink)
            self['nlink'] = nlink
        else:
            log.info('Links remaining for inode %r: 0; removing.', self.name)
            self.storage._remove_inode(self.name)
            self.tree.remove()

        self.storage._autocommit()
dataset/ETHPy150Open mgax/SpaghettiFS/spaghettifs/storage.py/StorageInode.unlink/original