From: Mark Vitale Date: Fri, 19 May 2017 20:34:21 +0000 (-0400) Subject: ubik: remove redundant memset from udisk_write X-Git-Tag: upstream/1.8.1_pre2^2~43 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f52d15371e2dddfb79a8346b3ad69613963e8866;p=packages%2Fo%2Fopenafs.git ubik: remove redundant memset from udisk_write When udisk_write is extending the database, DRead will return a null buffer. udisk_write then calls DNew to get a brand new buffer for the extension write, and clears it with memset. However, this is redundant, since DNew has already cleared the new buffer. Remove the redundant memset. No functional change should be incurred by this commit. Reviewed-on: https://gerrit.openafs.org/12621 Reviewed-by: Benjamin Kaduk Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Marcio Brito Barbosa Tested-by: BuildBot (cherry picked from commit 845c8927ef20e245bb88bc783dc2e581b61fbaba) Change-Id: I58d4052c69c16e4758c6accfbb2a0b1ac2aa413f Reviewed-on: https://gerrit.openafs.org/13124 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk --- diff --git a/src/ubik/disk.c b/src/ubik/disk.c index a091e7f2b..2cf419afe 100644 --- a/src/ubik/disk.c +++ b/src/ubik/disk.c @@ -807,7 +807,6 @@ udisk_write(struct ubik_trans *atrans, afs_int32 afile, void *abuffer, bp = DNew(atrans, afile, apos >> UBIK_LOGPAGESIZE); if (!bp) return UIOERROR; - memset(bp, 0, UBIK_PAGESIZE); } /* otherwise, min of remaining bytes and end of buffer to user mode */ offset = apos & (UBIK_PAGESIZE - 1);