Unstaticize nfs_iosize() in nfsclient and use it in nfs4client instead
of duplicating it except for larger style bugs in the copy. Fix some nearby style bugs (including a harmless type mismatch) in and near the remaining copy. This is part of fixing collisions of the 2 nfs*client's names. Even static names should have a unique prefixes so that they can be debugged easily.
This commit is contained in:
parent
938276b258
commit
5a952c0766
@ -65,24 +65,6 @@
|
|||||||
|
|
||||||
#include <nfsclient/nfsnode.h>
|
#include <nfsclient/nfsnode.h>
|
||||||
|
|
||||||
static int nfs_iosize(struct nfsmount *nmp);
|
|
||||||
|
|
||||||
static int
|
|
||||||
nfs_iosize(struct nfsmount *nmp)
|
|
||||||
{
|
|
||||||
int iosize;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Calculate the size used for io buffers. Use the larger
|
|
||||||
* of the two sizes to minimise nfs requests but make sure
|
|
||||||
* that it is at least one VM page to avoid wasting buffer
|
|
||||||
* space.
|
|
||||||
*/
|
|
||||||
iosize = max(nmp->nm_rsize, nmp->nm_wsize);
|
|
||||||
if (iosize < PAGE_SIZE) iosize = PAGE_SIZE;
|
|
||||||
return iosize;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nfs4_vfsop_fsinfo(struct nfsv4_fattr *fap, struct nfsmount *nmp)
|
nfs4_vfsop_fsinfo(struct nfsv4_fattr *fap, struct nfsmount *nmp)
|
||||||
{
|
{
|
||||||
|
@ -329,6 +329,7 @@ int nfs_connect(struct nfsmount *, struct nfsreq *);
|
|||||||
void nfs_disconnect(struct nfsmount *);
|
void nfs_disconnect(struct nfsmount *);
|
||||||
void nfs_safedisconnect(struct nfsmount *);
|
void nfs_safedisconnect(struct nfsmount *);
|
||||||
int nfs_getattrcache(struct vnode *, struct vattr *);
|
int nfs_getattrcache(struct vnode *, struct vattr *);
|
||||||
|
int nfs_iosize(struct nfsmount *nmp);
|
||||||
int nfsm_strtmbuf(struct mbuf **, char **, const char *, long);
|
int nfsm_strtmbuf(struct mbuf **, char **, const char *, long);
|
||||||
int nfs_bioread(struct vnode *, struct uio *, int, struct ucred *);
|
int nfs_bioread(struct vnode *, struct uio *, int, struct ucred *);
|
||||||
int nfsm_uiotombuf(struct uio *, struct mbuf **, int, caddr_t *);
|
int nfsm_uiotombuf(struct uio *, struct mbuf **, int, caddr_t *);
|
||||||
|
@ -105,8 +105,8 @@ static int nfs_tprintf_delay = NFS_TPRINTF_DELAY;
|
|||||||
SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_DELAY,
|
SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_DELAY,
|
||||||
downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "");
|
downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "");
|
||||||
|
|
||||||
static int nfs_iosize(struct nfsmount *nmp);
|
static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp,
|
||||||
static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp);
|
struct nfs_args *argp);
|
||||||
static int mountnfs(struct nfs_args *, struct mount *,
|
static int mountnfs(struct nfs_args *, struct mount *,
|
||||||
struct sockaddr *, char *, struct vnode **,
|
struct sockaddr *, char *, struct vnode **,
|
||||||
struct ucred *cred);
|
struct ucred *cred);
|
||||||
@ -174,7 +174,7 @@ static void nfs_convert_diskless(void);
|
|||||||
static void nfs_convert_oargs(struct nfs_args *args,
|
static void nfs_convert_oargs(struct nfs_args *args,
|
||||||
struct onfs_args *oargs);
|
struct onfs_args *oargs);
|
||||||
|
|
||||||
static int
|
int
|
||||||
nfs_iosize(struct nfsmount *nmp)
|
nfs_iosize(struct nfsmount *nmp)
|
||||||
{
|
{
|
||||||
int iosize;
|
int iosize;
|
||||||
@ -185,10 +185,9 @@ nfs_iosize(struct nfsmount *nmp)
|
|||||||
* that it is at least one VM page to avoid wasting buffer
|
* that it is at least one VM page to avoid wasting buffer
|
||||||
* space.
|
* space.
|
||||||
*/
|
*/
|
||||||
iosize = max(nmp->nm_rsize, nmp->nm_wsize);
|
iosize = imax(nmp->nm_rsize, nmp->nm_wsize);
|
||||||
if (iosize < PAGE_SIZE)
|
iosize = imax(iosize, PAGE_SIZE);
|
||||||
iosize = PAGE_SIZE;
|
return (iosize);
|
||||||
return iosize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user