def _rm_udf_link(self, rec):
        '''
        An internal method to remove a UDF File Entry link.
        Parameters:
         rec - The UDF File Entry to remove.
        Returns:
         The number of bytes to remove from the ISO.
        '''
        if not rec.is_file() and not rec.is_symlink():
            raise pycdlibexception.PyCdlibInvalidInput('Cannot remove a directory with rm_hard_link (try rm_directory instead)')
        logical_block_size = self.pvd.logical_block_size()
        num_bytes_to_remove = 0
        if rec.inode is not None:
            found_index = None
            for index, link in enumerate(rec.inode.linked_records):
                if id(link) == id(rec):
                    found_index = index
                    break
            else:
                raise pycdlibexception.PyCdlibInternalError('Could not find inode corresponding to record')
            del rec.inode.linked_records[found_index]
            rec.inode.num_udf -= 1
            if not rec.inode.linked_records:
                found_index = None
                for index, ino in enumerate(self.inodes):
                    if id(ino) == id(rec.inode):
                        found_index = index
                        break
                else:
                    raise pycdlibexception.PyCdlibInternalError('Could not find inode corresponding to record')
                del self.inodes[found_index]
                num_bytes_to_remove += rec.get_data_length()
            if rec.inode.num_udf == 0:
                num_bytes_to_remove += logical_block_size
        else:
            num_bytes_to_remove += logical_block_size
        if rec.parent is None:
            raise pycdlibexception.PyCdlibInternalError('Cannot remove a UDF record with no parent')
        if rec.file_ident is None:
            raise pycdlibexception.PyCdlibInternalError('Cannot remove a UDF record with no file identifier')
        return num_bytes_to_remove + self._rm_udf_file_ident(rec.parent, rec.file_ident.fi)