Skip to content

Commit edd2f55

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: eliminate __nfs4_get_fd
This is wrapper is pointless, and just obscures what's going on. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent ee97e73 commit edd2f55

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

fs/nfsd/nfs4state.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -599,22 +599,16 @@ put_nfs4_file(struct nfs4_file *fi)
599599
}
600600
}
601601

602-
static struct nfsd_file *
603-
__nfs4_get_fd(struct nfs4_file *f, int oflag)
604-
{
605-
return nfsd_file_get(f->fi_fds[oflag]);
606-
}
607-
608602
static struct nfsd_file *
609603
find_writeable_file_locked(struct nfs4_file *f)
610604
{
611605
struct nfsd_file *ret;
612606

613607
lockdep_assert_held(&f->fi_lock);
614608

615-
ret = __nfs4_get_fd(f, O_WRONLY);
609+
ret = nfsd_file_get(f->fi_fds[O_WRONLY]);
616610
if (!ret)
617-
ret = __nfs4_get_fd(f, O_RDWR);
611+
ret = nfsd_file_get(f->fi_fds[O_RDWR]);
618612
return ret;
619613
}
620614

@@ -637,9 +631,9 @@ find_readable_file_locked(struct nfs4_file *f)
637631

638632
lockdep_assert_held(&f->fi_lock);
639633

640-
ret = __nfs4_get_fd(f, O_RDONLY);
634+
ret = nfsd_file_get(f->fi_fds[O_RDONLY]);
641635
if (!ret)
642-
ret = __nfs4_get_fd(f, O_RDWR);
636+
ret = nfsd_file_get(f->fi_fds[O_RDWR]);
643637
return ret;
644638
}
645639

@@ -663,11 +657,11 @@ find_any_file(struct nfs4_file *f)
663657
if (!f)
664658
return NULL;
665659
spin_lock(&f->fi_lock);
666-
ret = __nfs4_get_fd(f, O_RDWR);
660+
ret = nfsd_file_get(f->fi_fds[O_RDWR]);
667661
if (!ret) {
668-
ret = __nfs4_get_fd(f, O_WRONLY);
662+
ret = nfsd_file_get(f->fi_fds[O_WRONLY]);
669663
if (!ret)
670-
ret = __nfs4_get_fd(f, O_RDONLY);
664+
ret = nfsd_file_get(f->fi_fds[O_RDONLY]);
671665
}
672666
spin_unlock(&f->fi_lock);
673667
return ret;

0 commit comments

Comments
 (0)