libgfapi : fix coverity issue

This patch fixes coverity issue in api/src/glfs-fops.c.

CID: 1389247, 1389296, 1389369, 1389392.
All coverity defects are of type Mixing enum types (MIXED_ENUMS).

updates: bz#789278

Change-Id: I007bb317ed5f0b8ddaf94a93b3a4d02b1e74cb8d
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
This commit is contained in:
Sunny Kumar 2018-12-28 13:04:36 +05:30 committed by Amar Tumballi
parent 7a84e705ed
commit 1ea203d6b6

View File

@ -5945,16 +5945,18 @@ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_xreaddirplus_get_stat, 3.11.0);
void
gf_lease_to_glfs_lease(struct gf_lease *gf_lease, struct glfs_lease *lease)
{
u_int lease_type = gf_lease->lease_type;
lease->cmd = gf_lease->cmd;
lease->lease_type = gf_lease->lease_type;
lease->lease_type = lease_type;
memcpy(lease->lease_id, gf_lease->lease_id, LEASE_ID_SIZE);
}
void
glfs_lease_to_gf_lease(struct glfs_lease *lease, struct gf_lease *gf_lease)
{
u_int lease_type = lease->lease_type;
gf_lease->cmd = lease->cmd;
gf_lease->lease_type = lease->lease_type;
gf_lease->lease_type = lease_type;
memcpy(gf_lease->lease_id, lease->lease_id, LEASE_ID_SIZE);
}