nfds = xchg(&files->max_fdset, nfds); new_openset = xchg(&files->open_fds, new_openset); new_execset = xchg(&files->close_on_exec, new_execset); 
nfds = xchg(&fdt->max_fdset, nfds); new_openset = xchg(&fdt->open_fds, new_openset); new_execset = xchg(&fdt->close_on_exec, new_execset); 
	__acquires(file->file_lock){	fd_set *new_openset = NULL, *new_execset = NULL;	int error, nfds = 0;	error = -EMFILE;	if (files->max_fdset >= NR_OPEN || nr >= NR_OPEN)		goto out;	nfds = files->max_fdset;	spin_unlock(&files->file_lock);	/* Expand to the max in easy steps */	do {		if (nfds < (PAGE_SIZE * 8))			nfds = PAGE_SIZE * 8;		else {			nfds = nfds * 2;			if (nfds > NR_OPEN)				nfds = NR_OPEN;		}	} while (nfds <= nr);	error = -ENOMEM;	new_openset = alloc_fdset(nfds);	new_execset = alloc_fdset(nfds);	spin_lock(&files->file_lock);	if (!new_openset || !new_execset)		goto out;	error = 0;		/* Copy the existing tables and install the new pointers */	if (nfds > files->max_fdset) {		int i = files->max_fdset / (sizeof(unsigned long) * 8);		int count = (nfds - files->max_fdset) / 8;				/* 		 * Don't copy the entire array if the current fdset is		 * not yet initialised.  		 */		if (i) {			memcpy (new_openset, files->open_fds, files->max_fdset/8);			memcpy (new_execset, files->close_on_exec, files->max_fdset/8);			memset (&new_openset->fds_bits[i], 0, count);			memset (&new_execset->fds_bits[i], 0, count);		}				nfds = xchg(&files->max_fdset, nfds);		new_openset = xchg(&files->open_fds, new_openset);		new_execset = xchg(&files->close_on_exec, new_execset);		spin_unlock(&files->file_lock);		free_fdset (new_openset, nfds);		free_fdset (new_execset, nfds);		spin_lock(&files->file_lock);		return 0;	} 	/* Somebody expanded the array while we slept ... */out:	spin_unlock(&files->file_lock);	if (new_openset)		free_fdset(new_openset, nfds);	if (new_execset)		free_fdset(new_execset, nfds);	spin_lock(&files->file_lock);	return error;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/badf16621c1f9d1ac753be056fce11b43d6e0be5/file.c/clean/fs/file.c