From c724beb161ce5f21862e9bb425736efed7532777 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Wed, 7 Apr 2010 10:07:29 +0000 Subject: NFS: type fixes: some portability cleanup Signed-off-by: Csaba Henk Signed-off-by: Anand V. Avati BUG: 399 (NFS translator with Mount v3 and NFS v3 support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=399 --- xlators/nfs/server/src/nfs3-helpers.c | 4 ++-- xlators/nfs/server/src/nfs3.c | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'xlators/nfs/server') diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index 6b9c452c2..72861dfd0 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -1883,7 +1883,7 @@ nfs3_fdcache_add (struct nfs3_state *nfs3, fd_t *fd) { gf_log (GF_NFS3, GF_LOG_TRACE, "Adding fd: 0x%lx", (long int) fd); - fd_ctx_set (fd, nfs3->nfsx, (uint64_t)fde); + fd_ctx_set (fd, nfs3->nfsx, (uintptr_t)fde); fd_bind (fd); list_add_tail (&fde->list, &nfs3->fdlru); ++nfs3->fdcount; @@ -1945,7 +1945,7 @@ __nfs3_queue_call_state (nfs3_call_state_t *cs) gf_log (GF_NFS3, GF_LOG_TRACE, "Initing inode queue"); INIT_LIST_HEAD (inode_q); - __inode_ctx_put (cs->resolvedloc.inode, cs->nfsx, (uint64_t)inode_q); + __inode_ctx_put (cs->resolvedloc.inode, cs->nfsx, (uintptr_t)inode_q); attach_cs: if (list_empty (inode_q)) { diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 4129a1880..712bbcaf3 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -3588,17 +3588,17 @@ nfs3svc_readdir_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, nfs3err: if (cs->maxcount == 0) { nfs3_log_readdir_res (rpcsvc_request_xid (cs->req), stat, - op_errno, (uint64_t)cs->fd, + op_errno, (uintptr_t)cs->fd, cs->dircount, is_eof); - nfs3_readdir_reply (cs->req, stat, (uint64_t)cs->fd, + nfs3_readdir_reply (cs->req, stat, (uintptr_t)cs->fd, buf, &cs->entries, cs->dircount, is_eof); } else { nfs3_log_readdirp_res (rpcsvc_request_xid (cs->req), stat, - op_errno, (uint64_t)cs->fd, + op_errno, (uintptr_t)cs->fd, cs->dircount, cs->maxcount, is_eof); nfs3_readdirp_reply (cs->req, stat, &cs->parent, - (uint64_t)cs->fd, buf, + (uintptr_t)cs->fd, buf, &cs->entries, cs->dircount, cs->maxcount, is_eof); } @@ -4546,8 +4546,9 @@ rpcsvc_program_t nfs3prog = { int nfs3_init_options (struct nfs3_state *nfs3, xlator_t *nfsx) { - int ret = -1; - char *optstr = NULL; + int ret = -1; + char *optstr = NULL; + uint64_t size64 = 0; if ((!nfs3) || (!nfsx)) return -1; @@ -4563,7 +4564,8 @@ nfs3_init_options (struct nfs3_state *nfs3, xlator_t *nfsx) goto err; } - ret = gf_string2bytesize (optstr, &nfs3->readsize); + ret = gf_string2bytesize (optstr, &size64); + nfs3->readsize = size64; if (ret == -1) { gf_log (GF_NFS3, GF_LOG_ERROR, "Failed to format" " option: nfs3.read-size"); @@ -4583,7 +4585,8 @@ nfs3_init_options (struct nfs3_state *nfs3, xlator_t *nfsx) goto err; } - ret = gf_string2bytesize (optstr, &nfs3->writesize); + ret = gf_string2bytesize (optstr, &size64); + nfs3->writesize = size64; if (ret == -1) { gf_log (GF_NFS3, GF_LOG_ERROR, "Failed to format" " option: nfs3.write-size"); @@ -4603,7 +4606,8 @@ nfs3_init_options (struct nfs3_state *nfs3, xlator_t *nfsx) goto err; } - ret = gf_string2bytesize (optstr, &nfs3->readdirsize); + ret = gf_string2bytesize (optstr, &size64); + nfs3->readdirsize = size64; if (ret == -1) { gf_log (GF_NFS3, GF_LOG_ERROR, "Failed to format" " option: nfs3.readdir-size"); -- cgit