diff options
author | Niels de Vos <ndevos@redhat.com> | 2015-05-16 10:27:59 +0200 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-06-01 02:21:00 -0700 |
commit | 99ab3637b2b457c866a46a7d109b09e2d4a23e5d (patch) | |
tree | ec6865148cfb14e9ec62279f0df295fcac0e02b9 /xlators/nfs | |
parent | a25529a0980b17567060eae8b40524381ca025d3 (diff) |
nfs: Use uuid_clear() instead of memset
Fixes the following incorrect usage:
mount3.c: In function '__mnt3_build_mountid_from_path':
mount3.c:705:24: warning: 'sizeof' on array function parameter 'mountid' will
return size of 'unsigned char *' [-Wsizeof-array-argument]
length = sizeof(mountid);
^
mount3.c:699:58: note: declared here
__mnt3_build_mountid_from_path (const char *path, uuid_t mountid)
^
mount3.c: In function '__mnt3_get_mount_id':
mount3.c:732:24: warning: 'sizeof' on array function parameter 'mountid' will
return size of 'unsigned char *' [-Wsizeof-array-argument]
length = sizeof(mountid);
^
mount3.c:726:46: note: declared here
__mnt3_get_mount_id (xlator_t *mntxl, uuid_t mountid)
Cherry picked from commit df12f00851a234b0e892af4b958e606a1fa660ed:
> Change-Id: I08f46c5994578fc99a7b61681e808d1115e41d71
> BUG: 1221095
> Signed-off-by: Vijay Bellur <vbellur@redhat.com>
> Reviewed-on: http://review.gluster.org/10765
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Change-Id: I08f46c5994578fc99a7b61681e808d1115e41d71
BUG: 1222198
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/10798
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/nfs')
-rw-r--r-- | xlators/nfs/server/src/mount3.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index b053efd3af3..8197cb1e7ca 100644 --- a/xlators/nfs/server/src/mount3.c +++ b/xlators/nfs/server/src/mount3.c @@ -700,14 +700,12 @@ __mnt3_build_mountid_from_path (const char *path, uuid_t mountid) { uint32_t hashed_path = 0; int ret = -1; - size_t length; - length = sizeof(mountid); while (strlen (path) > 0 && path[0] == '/') path++; /* Clear the mountid */ - memset (mountid, 0, length); + gf_uuid_clear (mountid); hashed_path = SuperFastHash (path, strlen (path)); if (hashed_path == 1) { @@ -727,12 +725,10 @@ __mnt3_get_mount_id (xlator_t *mntxl, uuid_t mountid) { int ret = -1; uint32_t hashed_path = 0; - size_t length; - length = sizeof(mountid); /* first clear the mountid */ - memset (mountid, 0, length); + gf_uuid_clear (mountid); hashed_path = SuperFastHash (mntxl->name, strlen (mntxl->name)); if (hashed_path == 1) { |