diff options
| author | Shehjar Tikoo <shehjart@gluster.com> | 2009-10-01 06:58:50 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-01 07:22:58 -0700 | 
| commit | b5c4ad4cbb7e313f66d22148e93b58c486e32d1b (patch) | |
| tree | e8ecf3babf6062306f9616d4be50a4750469c574 /xlators/protocol/server/src/server-protocol.c | |
| parent | 9710782e8a42712dfbbea46b50ac3681e57a860d (diff) | |
server: NFS-friendly logic changes
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 145 (NFSv3 related additions to 2.1 task list)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
Diffstat (limited to 'xlators/protocol/server/src/server-protocol.c')
| -rw-r--r-- | xlators/protocol/server/src/server-protocol.c | 20 | 
1 files changed, 19 insertions, 1 deletions
diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index a37f4da43..88f5cb61d 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -1160,6 +1160,12 @@ server_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  			      state->loc2.parent, state->loc2.name,  			      state->loc.inode, stbuf);  		gf_stat_from_stat (&rsp->stat, stbuf); + +		gf_stat_from_stat (&rsp->preoldparent, preoldparent); +		gf_stat_from_stat (&rsp->postoldparent, postoldparent); + +		gf_stat_from_stat (&rsp->prenewparent, prenewparent); +		gf_stat_from_stat (&rsp->postnewparent, postnewparent);  	}  	server_loc_wipe (&(state->loc)); @@ -1386,6 +1392,7 @@ server_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  	if (op_ret == 0) {  		gf_stat_from_stat (&rsp->prestat, prebuf); +		gf_stat_from_stat (&rsp->poststat, postbuf);  	} else {  		gf_log (this->name, GF_LOG_DEBUG,  			"%"PRId64": TRUNCATE %s (%"PRId64") ==> %"PRId32" (%s)", @@ -1481,6 +1488,7 @@ server_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  	if (op_ret == 0) {  		gf_stat_from_stat (&rsp->prestat, prebuf); +		gf_stat_from_stat (&rsp->poststat, postbuf);  	} else {  		state = CALL_STATE (frame); @@ -1574,11 +1582,17 @@ server_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  	hdrlen = gf_hdr_len (rsp, 0);  	hdr    = gf_hdr_new (rsp, 0); +	rsp = gf_param (hdr);  	hdr->rsp.op_ret = hton32 (op_ret);  	gf_errno        = gf_errno_to_error (op_errno);  	hdr->rsp.op_errno = hton32 (gf_errno); +        if (op_ret >= 0) { +                gf_stat_from_stat (&(rsp->prestat), prebuf); +                gf_stat_from_stat (&(rsp->poststat), postbuf); +        } +  	protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FSYNC,  			       hdr, hdrlen, NULL, 0, NULL); @@ -1649,6 +1663,7 @@ server_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  	hdr->rsp.op_errno = hton32 (gf_errno_to_error (op_errno));  	if (op_ret >= 0) { +		gf_stat_from_stat (&rsp->prestat, prebuf);  		gf_stat_from_stat (&rsp->poststat, postbuf);  	} else {  		state = CALL_STATE(frame); @@ -1901,8 +1916,10 @@ server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  	gf_errno        = gf_errno_to_error (op_errno);  	hdr->rsp.op_errno = hton32 (gf_errno_to_error (op_errno)); -	if (op_ret >= 0) +	if (op_ret >= 0) { +                gf_stat_from_stat (&(rsp->buf), sbuf);  		strcpy (rsp->path, buf); +        }  	server_loc_wipe (&(state->loc)); @@ -2167,6 +2184,7 @@ server_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  		}  		gf_stat_from_stat (&rsp->stat, stbuf); +		gf_stat_from_stat (&rsp->postparent, postparent);  		if (inode->ino == 0) {  			inode_link (inode, state->loc.parent,   | 
