nfsd: remove nfs4_file_put_fd
...and replace it with a simple swap call. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
		
					parent
					
						
							
								1265965172
							
						
					
				
			
			
				commit
				
					
						6d338b51eb
					
				
			
		
					 1 changed files with 2 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -394,15 +394,6 @@ nfs4_file_get_access(struct nfs4_file *fp, u32 access)
 | 
			
		|||
	return nfs_ok;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct file *nfs4_file_put_fd(struct nfs4_file *fp, int oflag)
 | 
			
		||||
{
 | 
			
		||||
	struct file *filp;
 | 
			
		||||
 | 
			
		||||
	filp = fp->fi_fds[oflag];
 | 
			
		||||
	fp->fi_fds[oflag] = NULL;
 | 
			
		||||
	return filp;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag)
 | 
			
		||||
{
 | 
			
		||||
	might_lock(&fp->fi_lock);
 | 
			
		||||
| 
						 | 
				
			
			@ -411,9 +402,9 @@ static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag)
 | 
			
		|||
		struct file *f1 = NULL;
 | 
			
		||||
		struct file *f2 = NULL;
 | 
			
		||||
 | 
			
		||||
		f1 = nfs4_file_put_fd(fp, oflag);
 | 
			
		||||
		swap(f1, fp->fi_fds[oflag]);
 | 
			
		||||
		if (atomic_read(&fp->fi_access[1 - oflag]) == 0)
 | 
			
		||||
			f2 = nfs4_file_put_fd(fp, O_RDWR);
 | 
			
		||||
			swap(f2, fp->fi_fds[O_RDWR]);
 | 
			
		||||
		spin_unlock(&fp->fi_lock);
 | 
			
		||||
		if (f1)
 | 
			
		||||
			fput(f1);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue