mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	nfsd: eliminate __nfs4_get_fd
This is wrapper is pointless, and just obscures what's going on. Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
		
							parent
							
								
									ee97e73015
								
							
						
					
					
						commit
						edd2f5526e
					
				
					 1 changed files with 7 additions and 13 deletions
				
			
		| 
						 | 
					@ -599,12 +599,6 @@ put_nfs4_file(struct nfs4_file *fi)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct nfsd_file *
 | 
					 | 
				
			||||||
__nfs4_get_fd(struct nfs4_file *f, int oflag)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	return nfsd_file_get(f->fi_fds[oflag]);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static struct nfsd_file *
 | 
					static struct nfsd_file *
 | 
				
			||||||
find_writeable_file_locked(struct nfs4_file *f)
 | 
					find_writeable_file_locked(struct nfs4_file *f)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -612,9 +606,9 @@ find_writeable_file_locked(struct nfs4_file *f)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	lockdep_assert_held(&f->fi_lock);
 | 
						lockdep_assert_held(&f->fi_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = __nfs4_get_fd(f, O_WRONLY);
 | 
						ret = nfsd_file_get(f->fi_fds[O_WRONLY]);
 | 
				
			||||||
	if (!ret)
 | 
						if (!ret)
 | 
				
			||||||
		ret = __nfs4_get_fd(f, O_RDWR);
 | 
							ret = nfsd_file_get(f->fi_fds[O_RDWR]);
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -637,9 +631,9 @@ find_readable_file_locked(struct nfs4_file *f)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	lockdep_assert_held(&f->fi_lock);
 | 
						lockdep_assert_held(&f->fi_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = __nfs4_get_fd(f, O_RDONLY);
 | 
						ret = nfsd_file_get(f->fi_fds[O_RDONLY]);
 | 
				
			||||||
	if (!ret)
 | 
						if (!ret)
 | 
				
			||||||
		ret = __nfs4_get_fd(f, O_RDWR);
 | 
							ret = nfsd_file_get(f->fi_fds[O_RDWR]);
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -663,11 +657,11 @@ find_any_file(struct nfs4_file *f)
 | 
				
			||||||
	if (!f)
 | 
						if (!f)
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	spin_lock(&f->fi_lock);
 | 
						spin_lock(&f->fi_lock);
 | 
				
			||||||
	ret = __nfs4_get_fd(f, O_RDWR);
 | 
						ret = nfsd_file_get(f->fi_fds[O_RDWR]);
 | 
				
			||||||
	if (!ret) {
 | 
						if (!ret) {
 | 
				
			||||||
		ret = __nfs4_get_fd(f, O_WRONLY);
 | 
							ret = nfsd_file_get(f->fi_fds[O_WRONLY]);
 | 
				
			||||||
		if (!ret)
 | 
							if (!ret)
 | 
				
			||||||
			ret = __nfs4_get_fd(f, O_RDONLY);
 | 
								ret = nfsd_file_get(f->fi_fds[O_RDONLY]);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	spin_unlock(&f->fi_lock);
 | 
						spin_unlock(&f->fi_lock);
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue