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:
parent
aba9f1124f
commit
ac0d649588
@ -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;
|
int eof, error, firstmirror, i, iolaymode, mirrorcnt, recalled, timo;
|
||||||
void *lckp;
|
void *lckp;
|
||||||
uint8_t *dev;
|
uint8_t *dev;
|
||||||
void *iovbase;
|
void *iovbase = NULL;
|
||||||
size_t iovlen;
|
size_t iovlen = 0;
|
||||||
off_t offs;
|
off_t offs = 0;
|
||||||
ssize_t resid;
|
ssize_t resid = 0;
|
||||||
|
|
||||||
if (!NFSHASPNFS(nmp) || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 ||
|
if (!NFSHASPNFS(nmp) || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 ||
|
||||||
(np->n_flag & NNOLAYOUT) != 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.
|
* do all mirrors.
|
||||||
*/
|
*/
|
||||||
m = NULL;
|
m = NULL;
|
||||||
drpc = NULL;
|
tdrpc = drpc = NULL;
|
||||||
firstmirror = 0;
|
firstmirror = 0;
|
||||||
mirrorcnt = 1;
|
mirrorcnt = 1;
|
||||||
if ((layp->nfsly_flags & NFSLY_FLEXFILE) != 0 &&
|
if ((layp->nfsly_flags & NFSLY_FLEXFILE) != 0 &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user