Silence newer gcc warnings.

Newer versions of gcc generate "might not be initialized" warnings for
several variables in nfsrpc_doiods().  I have checked and all of these
variables are assigned values before they are used.
In the one case of "tdrpc", it could have passed garbage as an argument
to nfscl_dofflayoutio() when mirrorcnt is one. However nfscl_dofflayoutio() only
uses the argument when mirrorcnt > 1, so it wasn't actually broken.
This patch initializes "tdrpc" to avoid confusion and initializes the rest
to make the compiler happy.

Requested by:	mmacy
This commit is contained in:
Rick Macklem 2018-08-02 20:10:59 +00:00
parent aba9f1124f
commit ac0d649588

View File

@ -5619,10 +5619,10 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
int eof, error, firstmirror, i, iolaymode, mirrorcnt, recalled, timo;
void *lckp;
uint8_t *dev;
void *iovbase;
size_t iovlen;
off_t offs;
ssize_t resid;
void *iovbase = NULL;
size_t iovlen = 0;
off_t offs = 0;
ssize_t resid = 0;
if (!NFSHASPNFS(nmp) || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 ||
(np->n_flag & NNOLAYOUT) != 0)
@ -5696,7 +5696,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
* do all mirrors.
*/
m = NULL;
drpc = NULL;
tdrpc = drpc = NULL;
firstmirror = 0;
mirrorcnt = 1;
if ((layp->nfsly_flags & NFSLY_FLEXFILE) != 0 &&