Some style(9) fixes in order to fabricate a commit to denote that
the commit message for r201896 actually should have read: As nfsm_srvmtofh_xx() assumes the 4-byte alignment required by XDR ensure the mbuf data is aligned accordingly by calling nfs_realign() in fha_extract_info(). This fix is orthogonal to the problem solved by r199274/r199284. PR: 142102 (second part) MFC after: 1 week
This commit is contained in:
parent
60abca0fe5
commit
c5e9510afa
@ -82,14 +82,13 @@
|
||||
#define IO_METASYNC 0
|
||||
#endif
|
||||
|
||||
|
||||
/* NFS state flags XXX -Wunused */
|
||||
#define NFSRV_SNDLOCK 0x01000000 /* Send socket lock */
|
||||
#define NFSRV_WANTSND 0x02000000 /* Want above */
|
||||
|
||||
/*
|
||||
* Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
|
||||
* should ever try and use it.
|
||||
* Structures for the nfssvc(2) syscall. Not that anyone but nfsd and
|
||||
* mount_nfs should ever try and use it.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -73,9 +73,10 @@ static struct fha_global {
|
||||
|
||||
/*
|
||||
* These are the entries in the filehandle hash. They talk about a specific
|
||||
* file, requests against which are being handled by one or more nfsds. We keep
|
||||
* a chain of nfsds against the file. We only have more than one if reads are
|
||||
* ongoing, and then only if the reads affect disparate regions of the file.
|
||||
* file, requests against which are being handled by one or more nfsds. We
|
||||
* keep a chain of nfsds against the file. We only have more than one if reads
|
||||
* are ongoing, and then only if the reads affect disparate regions of the
|
||||
* file.
|
||||
*
|
||||
* In general, we want to assign a new request to an existing nfsd if it is
|
||||
* going to contend with work happening already on that nfsd, or if the
|
||||
@ -271,7 +272,7 @@ fha_hash_entry_new(u_int64_t fh)
|
||||
e->num_threads = 0;
|
||||
LIST_INIT(&e->threads);
|
||||
|
||||
return e;
|
||||
return (e);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -296,10 +297,9 @@ fha_hash_entry_lookup(SVCPOOL *pool, u_int64_t fh)
|
||||
{
|
||||
struct fha_hash_entry *fhe, *new_fhe;
|
||||
|
||||
LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) {
|
||||
LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link)
|
||||
if (fhe->fh == fh)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!fhe) {
|
||||
/* Allocate a new entry. */
|
||||
@ -308,25 +308,24 @@ fha_hash_entry_lookup(SVCPOOL *pool, u_int64_t fh)
|
||||
mtx_lock(&pool->sp_lock);
|
||||
|
||||
/* Double-check to make sure we still need the new entry. */
|
||||
LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) {
|
||||
LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link)
|
||||
if (fhe->fh == fh)
|
||||
break;
|
||||
}
|
||||
if (!fhe) {
|
||||
fhe = new_fhe;
|
||||
LIST_INSERT_HEAD(&g_fha.hashtable[fh % g_fha.hashmask],
|
||||
fhe, link);
|
||||
} else {
|
||||
} else
|
||||
fha_hash_entry_destroy(new_fhe);
|
||||
}
|
||||
}
|
||||
|
||||
return fhe;
|
||||
return (fhe);
|
||||
}
|
||||
|
||||
static void
|
||||
fha_hash_entry_add_thread(struct fha_hash_entry *fhe, SVCTHREAD *thread)
|
||||
{
|
||||
|
||||
LIST_INSERT_HEAD(&fhe->threads, thread, st_alink);
|
||||
fhe->num_threads++;
|
||||
}
|
||||
|
@ -187,9 +187,9 @@ nfssvc_nfsserver(struct thread *td, struct nfssvc_args *uap)
|
||||
}
|
||||
error = nfssvc_addsock(fp, td);
|
||||
fdrop(fp, td);
|
||||
} else if (uap->flag & NFSSVC_OLDNFSD) {
|
||||
} else if (uap->flag & NFSSVC_OLDNFSD)
|
||||
error = nfssvc_nfsd(td, NULL);
|
||||
} else if (uap->flag & NFSSVC_NFSD) {
|
||||
else if (uap->flag & NFSSVC_NFSD) {
|
||||
if (!uap->argp)
|
||||
return (EINVAL);
|
||||
error = copyin(uap->argp, (caddr_t)&nfsdarg,
|
||||
@ -197,9 +197,8 @@ nfssvc_nfsserver(struct thread *td, struct nfssvc_args *uap)
|
||||
if (error)
|
||||
return (error);
|
||||
error = nfssvc_nfsd(td, &nfsdarg);
|
||||
} else {
|
||||
} else
|
||||
error = ENXIO;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -447,9 +446,8 @@ nfssvc_addsock(struct file *fp, struct thread *td)
|
||||
|
||||
siz = sb_max_adj;
|
||||
error = soreserve(so, siz, siz);
|
||||
if (error) {
|
||||
if (error)
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Steal the socket from userland so that it doesn't close
|
||||
|
Loading…
x
Reference in New Issue
Block a user