Bug Summary

File:xlators/protocol/server/src/server-rpc-fops.c
Location:line 1029, column 24
Description:Access to field 'ia_type' results in a dereference of a null pointer (loaded from variable 'stbuf')

Annotated Source Code

1/*
2 Copyright (c) 2010-2013 Red Hat, Inc. <http://www.redhat.com>
3 This file is part of GlusterFS.
4
5 This file is licensed to you under your choice of the GNU Lesser
6 General Public License, version 3 or any later version (LGPLv3 or
7 later), or the GNU General Public License, version 2 (GPLv2), in all
8 cases as published by the Free Software Foundation.
9*/
10
11
12#ifndef _CONFIG_H
13#define _CONFIG_H
14#include "config.h"
15#endif
16
17#include <openssl/md5.h>
18
19#include "server.h"
20#include "server-helpers.h"
21#include "glusterfs3-xdr.h"
22#include "glusterfs3.h"
23#include "compat-errno.h"
24
25#include "xdr-nfs3.h"
26
27
28/* Callback function section */
29int
30server_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
31 int32_t op_ret, int32_t op_errno, struct statvfs *buf,
32 dict_t *xdata)
33{
34 gfs3_statfs_rsp rsp = {0,};
35 rpcsvc_request_t *req = NULL((void*)0);
36
37 req = frame->local;
38
39 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 40, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
40 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 40, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
41
42 if (op_ret < 0) {
43 gf_log (this->name, GF_LOG_WARNING,do { do { if (0) printf ("%""ll" "d"": STATFS (%s)", frame->
root->unique, strerror (op_errno)); } while (0); _gf_log (
this->name, "server-rpc-fops.c", __FUNCTION__, 45, GF_LOG_WARNING
, "%""ll" "d"": STATFS (%s)", frame->root->unique, strerror
(op_errno)); } while (0)
44 "%"PRId64": STATFS (%s)",do { do { if (0) printf ("%""ll" "d"": STATFS (%s)", frame->
root->unique, strerror (op_errno)); } while (0); _gf_log (
this->name, "server-rpc-fops.c", __FUNCTION__, 45, GF_LOG_WARNING
, "%""ll" "d"": STATFS (%s)", frame->root->unique, strerror
(op_errno)); } while (0)
45 frame->root->unique, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": STATFS (%s)", frame->
root->unique, strerror (op_errno)); } while (0); _gf_log (
this->name, "server-rpc-fops.c", __FUNCTION__, 45, GF_LOG_WARNING
, "%""ll" "d"": STATFS (%s)", frame->root->unique, strerror
(op_errno)); } while (0)
;
46 goto out;
47 }
48
49 gf_statfs_from_statfs (&rsp.statfs, buf);
50
51out:
52 rsp.op_ret = op_ret;
53 rsp.op_errno = gf_errno_to_error (op_errno);
54
55
56 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
57 (xdrproc_t)xdr_gfs3_statfs_rsp);
58
59 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
60
61 return 0;
62}
63
64int
65server_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
66 int32_t op_ret, int32_t op_errno,
67 inode_t *inode, struct iatt *stbuf, dict_t *xdata,
68 struct iatt *postparent)
69{
70 rpcsvc_request_t *req = NULL((void*)0);
71 server_state_t *state = NULL((void*)0);
72 inode_t *root_inode = NULL((void*)0);
73 inode_t *link_inode = NULL((void*)0);
74 loc_t fresh_loc = {0,};
75 gfs3_lookup_rsp rsp = {0,};
76 uuid_t rootgfid = {0,};
77
78 req = frame->local;
79 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
80
81 if (state->is_revalidate == 1 && op_ret == -1) {
82 state->is_revalidate = 2;
83 loc_copy (&fresh_loc, &state->loc);
84 inode_unref (fresh_loc.inode);
85 fresh_loc.inode = inode_new (state->itable);
86
87 STACK_WIND (frame, server_lookup_cbk, BOUND_XL (frame),do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 89
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( ((xlator_t *) ((server_state_t *)frame->root->state)->
conn->bound_xl)->fops->lookup_cbk) tmp_cbk = server_lookup_cbk
; _new->root = frame->root; _new->this = ((xlator_t *
) ((server_state_t *)frame->root->state)->conn->bound_xl
); _new->ret = (ret_fn_t) tmp_cbk; _new->parent = frame
; _new->cookie = _new; _new->wind_from = __FUNCTION__; _new
->wind_to = "BOUND_XL (frame)->fops->lookup"; _new->
unwind_to = "server_lookup_cbk"; pthread_spin_init (&_new
->lock, 0); pthread_spin_lock (&frame->root->stack_lock
); { _new->next = frame->root->frames.next; _new->
prev = &frame->root->frames; if (frame->root->
frames.next) frame->root->frames.next->prev = _new; frame
->root->frames.next = _new; frame->ref_count++; } pthread_spin_unlock
(&frame->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = ((xlator_t *) ((server_state_t
*)frame->root->state)->conn->bound_xl); if (frame
->this->ctx->measure_latency) gf_latency_begin (_new
, ((xlator_t *) ((server_state_t *)frame->root->state)->
conn->bound_xl)->fops->lookup); ((xlator_t *) ((server_state_t
*)frame->root->state)->conn->bound_xl)->fops->
lookup (_new, ((xlator_t *) ((server_state_t *)frame->root
->state)->conn->bound_xl), &fresh_loc, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
88 BOUND_XL (frame)->fops->lookup,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 89
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( ((xlator_t *) ((server_state_t *)frame->root->state)->
conn->bound_xl)->fops->lookup_cbk) tmp_cbk = server_lookup_cbk
; _new->root = frame->root; _new->this = ((xlator_t *
) ((server_state_t *)frame->root->state)->conn->bound_xl
); _new->ret = (ret_fn_t) tmp_cbk; _new->parent = frame
; _new->cookie = _new; _new->wind_from = __FUNCTION__; _new
->wind_to = "BOUND_XL (frame)->fops->lookup"; _new->
unwind_to = "server_lookup_cbk"; pthread_spin_init (&_new
->lock, 0); pthread_spin_lock (&frame->root->stack_lock
); { _new->next = frame->root->frames.next; _new->
prev = &frame->root->frames; if (frame->root->
frames.next) frame->root->frames.next->prev = _new; frame
->root->frames.next = _new; frame->ref_count++; } pthread_spin_unlock
(&frame->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = ((xlator_t *) ((server_state_t
*)frame->root->state)->conn->bound_xl); if (frame
->this->ctx->measure_latency) gf_latency_begin (_new
, ((xlator_t *) ((server_state_t *)frame->root->state)->
conn->bound_xl)->fops->lookup); ((xlator_t *) ((server_state_t
*)frame->root->state)->conn->bound_xl)->fops->
lookup (_new, ((xlator_t *) ((server_state_t *)frame->root
->state)->conn->bound_xl), &fresh_loc, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
89 &fresh_loc, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 89
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( ((xlator_t *) ((server_state_t *)frame->root->state)->
conn->bound_xl)->fops->lookup_cbk) tmp_cbk = server_lookup_cbk
; _new->root = frame->root; _new->this = ((xlator_t *
) ((server_state_t *)frame->root->state)->conn->bound_xl
); _new->ret = (ret_fn_t) tmp_cbk; _new->parent = frame
; _new->cookie = _new; _new->wind_from = __FUNCTION__; _new
->wind_to = "BOUND_XL (frame)->fops->lookup"; _new->
unwind_to = "server_lookup_cbk"; pthread_spin_init (&_new
->lock, 0); pthread_spin_lock (&frame->root->stack_lock
); { _new->next = frame->root->frames.next; _new->
prev = &frame->root->frames; if (frame->root->
frames.next) frame->root->frames.next->prev = _new; frame
->root->frames.next = _new; frame->ref_count++; } pthread_spin_unlock
(&frame->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = ((xlator_t *) ((server_state_t
*)frame->root->state)->conn->bound_xl); if (frame
->this->ctx->measure_latency) gf_latency_begin (_new
, ((xlator_t *) ((server_state_t *)frame->root->state)->
conn->bound_xl)->fops->lookup); ((xlator_t *) ((server_state_t
*)frame->root->state)->conn->bound_xl)->fops->
lookup (_new, ((xlator_t *) ((server_state_t *)frame->root
->state)->conn->bound_xl), &fresh_loc, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
;
90
91 loc_wipe (&fresh_loc);
92 return 0;
93 }
94
95 gf_stat_from_iatt (&rsp.postparent, postparent);
96
97 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 98, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
98 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 98, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
99
100 if (op_ret) {
101 if (state->is_revalidate && op_errno == ENOENT2) {
102 if (!__is_root_gfid (state->resolve.gfid)) {
103 inode_unlink (state->loc.inode,
104 state->loc.parent,
105 state->loc.name);
106 }
107 }
108 goto out;
109 }
110
111 root_inode = BOUND_XL(frame)((xlator_t *) ((server_state_t *)frame->root->state)->
conn->bound_xl)
->itable->root;
112 if (inode == root_inode) {
113 /* we just looked up root ("/") */
114 stbuf->ia_ino = 1;
115 rootgfid[15] = 1;
116 uuid_copy (stbuf->ia_gfid, rootgfid);
117 if (inode->ia_type == 0)
118 inode->ia_type = stbuf->ia_type;
119 }
120
121 gf_stat_from_iatt (&rsp.stat, stbuf);
122
123 if (!__is_root_gfid (inode->gfid)) {
124 link_inode = inode_link (inode, state->loc.parent,
125 state->loc.name, stbuf);
126 if (link_inode) {
127 inode_lookup (link_inode);
128 inode_unref (link_inode);
129 }
130 }
131
132out:
133 rsp.op_ret = op_ret;
134 rsp.op_errno = gf_errno_to_error (op_errno);
135
136 if (op_ret) {
137 if (state->resolve.bname) {
138 gf_log (this->name, ((op_errno == ENOENT) ?do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 144, ((op_errno == 2) ? GF_LOG_TRACE : GF_LOG_INFO
), "%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
139 GF_LOG_TRACE : GF_LOG_INFO),do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 144, ((op_errno == 2) ? GF_LOG_TRACE : GF_LOG_INFO
), "%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
140 "%"PRId64": LOOKUP %s (%s/%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 144, ((op_errno == 2) ? GF_LOG_TRACE : GF_LOG_INFO
), "%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
141 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 144, ((op_errno == 2) ? GF_LOG_TRACE : GF_LOG_INFO
), "%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
142 uuid_utoa (state->resolve.pargfid),do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 144, ((op_errno == 2) ? GF_LOG_TRACE : GF_LOG_INFO
), "%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
143 state->resolve.bname,do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 144, ((op_errno == 2) ? GF_LOG_TRACE : GF_LOG_INFO
), "%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
144 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 144, ((op_errno == 2) ? GF_LOG_TRACE : GF_LOG_INFO
), "%""ll" "d"": LOOKUP %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
;
145 } else {
146 gf_log (this->name, ((op_errno == ENOENT) ?do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 151, ((op_errno
== 2) ? GF_LOG_TRACE : GF_LOG_INFO), "%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0)
147 GF_LOG_TRACE : GF_LOG_INFO),do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 151, ((op_errno
== 2) ? GF_LOG_TRACE : GF_LOG_INFO), "%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0)
148 "%"PRId64": LOOKUP %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 151, ((op_errno
== 2) ? GF_LOG_TRACE : GF_LOG_INFO), "%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0)
149 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 151, ((op_errno
== 2) ? GF_LOG_TRACE : GF_LOG_INFO), "%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0)
150 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 151, ((op_errno
== 2) ? GF_LOG_TRACE : GF_LOG_INFO), "%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0)
151 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 151, ((op_errno
== 2) ? GF_LOG_TRACE : GF_LOG_INFO), "%""ll" "d"": LOOKUP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0)
;
152 }
153 }
154
155 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
156 (xdrproc_t)xdr_gfs3_lookup_rsp);
157
158 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
159
160 return 0;
161}
162
163
164int
165server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
166 int32_t op_ret, int32_t op_errno, struct gf_flock *lock,
167 dict_t *xdata)
168{
169 gfs3_lk_rsp rsp = {0,};
170 rpcsvc_request_t *req = NULL((void*)0);
171 server_state_t *state = NULL((void*)0);
172
173 req = frame->local;
174 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
175
176 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 177, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
177 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 177, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
178
179 if (op_ret) {
180 if ((op_errno != ENOSYS38) && (op_errno != EAGAIN11)) {
181 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 185
, GF_LOG_INFO, "%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
182 "%"PRId64": LK %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 185
, GF_LOG_INFO, "%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
183 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 185
, GF_LOG_INFO, "%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
184 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 185
, GF_LOG_INFO, "%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
185 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 185
, GF_LOG_INFO, "%""ll" "d"": LK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
186 }
187 goto out;
188 }
189
190 switch (lock->l_type) {
191 case F_RDLCK0:
192 lock->l_type = GF_LK_F_RDLCK;
193 break;
194 case F_WRLCK1:
195 lock->l_type = GF_LK_F_WRLCK;
196 break;
197 case F_UNLCK2:
198 lock->l_type = GF_LK_F_UNLCK;
199 break;
200 default:
201 gf_log (this->name, GF_LOG_ERROR,do { do { if (0) printf ("Unknown lock type: %""d""!", lock->
l_type); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 202, GF_LOG_ERROR, "Unknown lock type: %""d""!"
, lock->l_type); } while (0)
202 "Unknown lock type: %"PRId32"!", lock->l_type)do { do { if (0) printf ("Unknown lock type: %""d""!", lock->
l_type); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 202, GF_LOG_ERROR, "Unknown lock type: %""d""!"
, lock->l_type); } while (0)
;
203 break;
204 }
205
206 gf_proto_flock_from_flock (&rsp.flock, lock);
207
208out:
209 rsp.op_ret = op_ret;
210 rsp.op_errno = gf_errno_to_error (op_errno);
211
212 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
213 (xdrproc_t)xdr_gfs3_lk_rsp);
214
215 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
216
217 return 0;
218}
219
220
221int
222server_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
223 int32_t op_ret, int32_t op_errno, dict_t *xdata)
224{
225 gf_common_rsp rsp = {0,};
226 server_connection_t *conn = NULL((void*)0);
227 server_state_t *state = NULL((void*)0);
228 rpcsvc_request_t *req = NULL((void*)0);
229
230 req = frame->local;
231 conn = SERVER_CONNECTION(frame)((server_connection_t *) ((server_state_t *)frame->root->
state)->conn)
;
232 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
233
234 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 235, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
235 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 235, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
236
237 if (op_ret < 0) {
238 if ((op_errno != ENOSYS38) && (op_errno != EAGAIN11)) {
239 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": INODELK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 243, GF_LOG_INFO
, "%""ll" "d"": INODELK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
240 "%"PRId64": INODELK %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": INODELK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 243, GF_LOG_INFO
, "%""ll" "d"": INODELK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
241 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": INODELK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 243, GF_LOG_INFO
, "%""ll" "d"": INODELK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
242 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": INODELK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 243, GF_LOG_INFO
, "%""ll" "d"": INODELK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
243 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": INODELK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 243, GF_LOG_INFO
, "%""ll" "d"": INODELK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
;
244 }
245 goto out;
246 }
247
248 if (state->flock.l_type == F_UNLCK2)
249 gf_del_locker (conn, state->volume,
250 &state->loc, NULL((void*)0), &frame->root->lk_owner,
251 GF_FOP_INODELK);
252 else
253 gf_add_locker (conn, state->volume,
254 &state->loc, NULL((void*)0), frame->root->pid,
255 &frame->root->lk_owner,
256 GF_FOP_INODELK);
257
258out:
259 rsp.op_ret = op_ret;
260 rsp.op_errno = gf_errno_to_error (op_errno);
261
262 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
263 (xdrproc_t)xdr_gf_common_rsp);
264
265 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
266
267 return 0;
268}
269
270
271int
272server_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
273 int32_t op_ret, int32_t op_errno, dict_t *xdata)
274{
275 gf_common_rsp rsp = {0,};
276 server_state_t *state = NULL((void*)0);
277 server_connection_t *conn = NULL((void*)0);
278 rpcsvc_request_t *req = NULL((void*)0);
279
280 req = frame->local;
281 conn = SERVER_CONNECTION(frame)((server_connection_t *) ((server_state_t *)frame->root->
state)->conn)
;
282 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
283
284 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 285, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
285 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 285, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
286
287 if (op_ret < 0) {
288 if ((op_errno != ENOSYS38) && (op_errno != EAGAIN11)) {
289 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 293
, GF_LOG_INFO, "%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
290 "%"PRId64": FINODELK %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 293
, GF_LOG_INFO, "%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
291 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 293
, GF_LOG_INFO, "%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
292 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 293
, GF_LOG_INFO, "%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
293 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 293
, GF_LOG_INFO, "%""ll" "d"": FINODELK %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
294 }
295 goto out;
296 }
297
298 if (state->flock.l_type == F_UNLCK2)
299 gf_del_locker (conn, state->volume,
300 NULL((void*)0), state->fd,
301 &frame->root->lk_owner, GF_FOP_INODELK);
302 else
303 gf_add_locker (conn, state->volume,
304 NULL((void*)0), state->fd,
305 frame->root->pid,
306 &frame->root->lk_owner, GF_FOP_INODELK);
307
308out:
309 rsp.op_ret = op_ret;
310 rsp.op_errno = gf_errno_to_error (op_errno);
311
312 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
313 (xdrproc_t)xdr_gf_common_rsp);
314
315 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
316
317 return 0;
318}
319
320int
321server_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
322 int32_t op_ret, int32_t op_errno, dict_t *xdata)
323{
324 server_connection_t *conn = NULL((void*)0);
325 server_state_t *state = NULL((void*)0);
326 rpcsvc_request_t *req = NULL((void*)0);
327 gf_common_rsp rsp = {0,};
328
329 req = frame->local;
330 conn = SERVER_CONNECTION(frame)((server_connection_t *) ((server_state_t *)frame->root->
state)->conn)
;
331 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
332
333 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 334, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
334 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 334, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
335
336 if (op_ret < 0) {
337 if ((op_errno != ENOSYS38) && (op_errno != EAGAIN11)) {
338 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": ENTRYLK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 342, GF_LOG_INFO
, "%""ll" "d"": ENTRYLK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
339 "%"PRId64": ENTRYLK %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": ENTRYLK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 342, GF_LOG_INFO
, "%""ll" "d"": ENTRYLK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
340 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": ENTRYLK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 342, GF_LOG_INFO
, "%""ll" "d"": ENTRYLK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
341 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": ENTRYLK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 342, GF_LOG_INFO
, "%""ll" "d"": ENTRYLK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
342 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": ENTRYLK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 342, GF_LOG_INFO
, "%""ll" "d"": ENTRYLK %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
;
343 }
344 goto out;
345 }
346
347 if (state->cmd == ENTRYLK_UNLOCK)
348 gf_del_locker (conn, state->volume,
349 &state->loc, NULL((void*)0), &frame->root->lk_owner,
350 GF_FOP_ENTRYLK);
351 else
352 gf_add_locker (conn, state->volume,
353 &state->loc, NULL((void*)0), frame->root->pid,
354 &frame->root->lk_owner,
355 GF_FOP_ENTRYLK);
356
357out:
358 rsp.op_ret = op_ret;
359 rsp.op_errno = gf_errno_to_error (op_errno);
360
361 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
362 (xdrproc_t)xdr_gf_common_rsp);
363
364 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
365
366 return 0;
367}
368
369
370int
371server_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
372 int32_t op_ret, int32_t op_errno, dict_t *xdata)
373{
374 gf_common_rsp rsp = {0,};
375 server_connection_t *conn = NULL((void*)0);
376 server_state_t *state = NULL((void*)0);
377 rpcsvc_request_t *req = NULL((void*)0);
378
379 req = frame->local;
380 conn = SERVER_CONNECTION(frame)((server_connection_t *) ((server_state_t *)frame->root->
state)->conn)
;
381 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
382
383 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 384, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
384 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 384, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
385
386 if (op_ret < 0) {
387 if ((op_errno != ENOSYS38) && (op_errno != EAGAIN11)) {
388 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 392
, GF_LOG_INFO, "%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
389 "%"PRId64": FENTRYLK %"PRId64" (%s) ==>(%s)",do { do { if (0) printf ("%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 392
, GF_LOG_INFO, "%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
390 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 392
, GF_LOG_INFO, "%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
391 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 392
, GF_LOG_INFO, "%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
392 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 392
, GF_LOG_INFO, "%""ll" "d"": FENTRYLK %""ll" "d"" (%s) ==>(%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
393 }
394 goto out;
395 }
396
397 if (state->cmd == ENTRYLK_UNLOCK)
398 gf_del_locker (conn, state->volume,
399 NULL((void*)0), state->fd, &frame->root->lk_owner,
400 GF_FOP_ENTRYLK);
401 else
402 gf_add_locker (conn, state->volume,
403 NULL((void*)0), state->fd, frame->root->pid,
404 &frame->root->lk_owner, GF_FOP_ENTRYLK);
405
406out:
407 rsp.op_ret = op_ret;
408 rsp.op_errno = gf_errno_to_error (op_errno);
409
410 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
411 (xdrproc_t)xdr_gf_common_rsp);
412
413 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
414
415 return 0;
416}
417
418
419int
420server_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
421 int32_t op_ret, int32_t op_errno, dict_t *xdata)
422{
423 gf_common_rsp rsp = {0,};
424 rpcsvc_request_t *req = NULL((void*)0);
425 server_state_t *state = NULL((void*)0);
426
427 req = frame->local;
428 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
429
430 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 431, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
431 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 431, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
432
433 if (op_ret) {
434 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": ACCESS %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 438, GF_LOG_INFO
, "%""ll" "d"": ACCESS %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
435 "%"PRId64": ACCESS %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": ACCESS %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 438, GF_LOG_INFO
, "%""ll" "d"": ACCESS %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
436 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": ACCESS %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 438, GF_LOG_INFO
, "%""ll" "d"": ACCESS %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
437 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": ACCESS %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 438, GF_LOG_INFO
, "%""ll" "d"": ACCESS %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
438 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": ACCESS %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 438, GF_LOG_INFO
, "%""ll" "d"": ACCESS %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
;
439 goto out;
440 }
441
442out:
443 rsp.op_ret = op_ret;
444 rsp.op_errno = gf_errno_to_error (op_errno);
445
446 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
447 (xdrproc_t)xdr_gf_common_rsp);
448
449 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
450
451 return 0;
452}
453
454int
455server_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
456 int32_t op_ret, int32_t op_errno, struct iatt *preparent,
457 struct iatt *postparent, dict_t *xdata)
458{
459 gfs3_rmdir_rsp rsp = {0,};
460 server_state_t *state = NULL((void*)0);
461 inode_t *parent = NULL((void*)0);
462 rpcsvc_request_t *req = NULL((void*)0);
463
464 req = frame->local;
465 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
466
467 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 468, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
468 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 468, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
469
470 if (op_ret) {
471 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 475, GF_LOG_INFO, "%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
472 "%"PRId64": RMDIR %s (%s/%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 475, GF_LOG_INFO, "%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
473 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 475, GF_LOG_INFO, "%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
474 uuid_utoa (state->resolve.pargfid),do { do { if (0) printf ("%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 475, GF_LOG_INFO, "%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
475 state->resolve.bname, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 475, GF_LOG_INFO, "%""ll" "d"": RMDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
;
476 goto out;
477 }
478
479 inode_unlink (state->loc.inode, state->loc.parent,
480 state->loc.name);
481 parent = inode_parent (state->loc.inode, 0, NULL((void*)0));
482 if (parent)
483 /* parent should not be found for directories after
484 * inode_unlink, since directories cannot have
485 * hardlinks.
486 */
487 inode_unref (parent);
488 else
489 inode_forget (state->loc.inode, 0);
490
491 gf_stat_from_iatt (&rsp.preparent, preparent);
492 gf_stat_from_iatt (&rsp.postparent, postparent);
493
494out:
495 rsp.op_ret = op_ret;
496 rsp.op_errno = gf_errno_to_error (op_errno);
497
498 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
499 (xdrproc_t)xdr_gfs3_rmdir_rsp);
500
501 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
502
503 return 0;
504}
505
506int
507server_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
508 int32_t op_ret, int32_t op_errno, inode_t *inode,
509 struct iatt *stbuf, struct iatt *preparent,
510 struct iatt *postparent, dict_t *xdata)
511{
512 gfs3_mkdir_rsp rsp = {0,};
513 server_state_t *state = NULL((void*)0);
514 inode_t *link_inode = NULL((void*)0);
515 rpcsvc_request_t *req = NULL((void*)0);
516
517 req = frame->local;
518 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
519
520 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 521, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
521 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 521, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
522
523 if (op_ret < 0) {
524 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 528, GF_LOG_INFO, "%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
525 "%"PRId64": MKDIR %s (%s/%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 528, GF_LOG_INFO, "%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
526 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 528, GF_LOG_INFO, "%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
527 uuid_utoa (state->resolve.pargfid),do { do { if (0) printf ("%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 528, GF_LOG_INFO, "%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
528 state->resolve.bname, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 528, GF_LOG_INFO, "%""ll" "d"": MKDIR %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
;
529 goto out;
530 }
531
532 gf_stat_from_iatt (&rsp.stat, stbuf);
533 gf_stat_from_iatt (&rsp.preparent, preparent);
534 gf_stat_from_iatt (&rsp.postparent, postparent);
535
536 link_inode = inode_link (inode, state->loc.parent,
537 state->loc.name, stbuf);
538 inode_lookup (link_inode);
539 inode_unref (link_inode);
540
541out:
542 rsp.op_ret = op_ret;
543 rsp.op_errno = gf_errno_to_error (op_errno);
544
545 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
546 (xdrproc_t)xdr_gfs3_mkdir_rsp);
547
548 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
549
550 return 0;
551}
552
553int
554server_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
555 int32_t op_ret, int32_t op_errno,
556 inode_t *inode, struct iatt *stbuf, struct iatt *preparent,
557 struct iatt *postparent, dict_t *xdata)
558{
559 gfs3_mknod_rsp rsp = {0,};
560 server_state_t *state = NULL((void*)0);
561 inode_t *link_inode = NULL((void*)0);
562 rpcsvc_request_t *req = NULL((void*)0);
563
564 req = frame->local;
565 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
566
567 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 568, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
568 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 568, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
569
570 if (op_ret < 0) {
571 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 575, GF_LOG_INFO, "%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
572 "%"PRId64": MKNOD %s (%s/%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 575, GF_LOG_INFO, "%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
573 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 575, GF_LOG_INFO, "%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
574 uuid_utoa (state->resolve.pargfid),do { do { if (0) printf ("%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 575, GF_LOG_INFO, "%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
575 state->resolve.bname, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 575, GF_LOG_INFO, "%""ll" "d"": MKNOD %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
;
576 goto out;
577 }
578
579 gf_stat_from_iatt (&rsp.stat, stbuf);
580 gf_stat_from_iatt (&rsp.preparent, preparent);
581 gf_stat_from_iatt (&rsp.postparent, postparent);
582
583 link_inode = inode_link (inode, state->loc.parent,
584 state->loc.name, stbuf);
585 inode_lookup (link_inode);
586 inode_unref (link_inode);
587
588out:
589 rsp.op_ret = op_ret;
590 rsp.op_errno = gf_errno_to_error (op_errno);
591
592 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
593 (xdrproc_t)xdr_gfs3_mknod_rsp);
594
595 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
596
597 return 0;
598}
599
600int
601server_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
602 int32_t op_ret, int32_t op_errno, dict_t *xdata)
603{
604 gf_common_rsp rsp = {0,};
605 server_state_t *state = NULL((void*)0);
606 rpcsvc_request_t *req = NULL((void*)0);
607
608 req = frame->local;
609 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
610
611 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 612, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
612 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 612, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
613
614 if (op_ret < 0) {
615 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 619
, GF_LOG_INFO, "%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
616 "%"PRId64": FSYNCDIR %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 619
, GF_LOG_INFO, "%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
617 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 619
, GF_LOG_INFO, "%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
618 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 619
, GF_LOG_INFO, "%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
619 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 619
, GF_LOG_INFO, "%""ll" "d"": FSYNCDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
620 goto out;
621 }
622
623out:
624 rsp.op_ret = op_ret;
625 rsp.op_errno = gf_errno_to_error (op_errno);
626
627 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
628 (xdrproc_t)xdr_gf_common_rsp);
629
630 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
631
632 return 0;
633}
634
635int
636server_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
637 int32_t op_ret, int32_t op_errno, gf_dirent_t *entries,
638 dict_t *xdata)
639{
640 gfs3_readdir_rsp rsp = {0,};
641 server_state_t *state = NULL((void*)0);
642 rpcsvc_request_t *req = NULL((void*)0);
643 int ret = 0;
644
645 req = frame->local;
646 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
647
648 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 649, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
649 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 649, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
650
651 if (op_ret < 0) {
652 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 656
, GF_LOG_INFO, "%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
653 "%"PRId64": READDIR %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 656
, GF_LOG_INFO, "%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
654 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 656
, GF_LOG_INFO, "%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
655 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 656
, GF_LOG_INFO, "%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
656 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 656
, GF_LOG_INFO, "%""ll" "d"": READDIR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
657 goto out;
658 }
659
660 /* (op_ret == 0) is valid, and means EOF */
661 if (op_ret) {
662 ret = serialize_rsp_dirent (entries, &rsp);
663 if (ret == -1) {
664 op_ret = -1;
665 op_errno = ENOMEM12;
666 goto out;
667 }
668 }
669
670out:
671 rsp.op_ret = op_ret;
672 rsp.op_errno = gf_errno_to_error (op_errno);
673
674 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
675 (xdrproc_t)xdr_gfs3_readdir_rsp);
676
677 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
678
679 readdir_rsp_cleanup (&rsp);
680
681 return 0;
682}
683
684int
685server_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
686 int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
687{
688 server_connection_t *conn = NULL((void*)0);
689 server_state_t *state = NULL((void*)0);
690 rpcsvc_request_t *req = NULL((void*)0);
691 gfs3_opendir_rsp rsp = {0,};
692 uint64_t fd_no = 0;
693
694 req = frame->local;
695 conn = SERVER_CONNECTION (frame)((server_connection_t *) ((server_state_t *)frame->root->
state)->conn)
;
696 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
697
698 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 699, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
699 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 699, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
700
701 if (op_ret < 0) {
702 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": OPENDIR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 705, GF_LOG_INFO
, "%""ll" "d"": OPENDIR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
703 "%"PRId64": OPENDIR %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": OPENDIR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 705, GF_LOG_INFO
, "%""ll" "d"": OPENDIR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
704 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": OPENDIR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 705, GF_LOG_INFO
, "%""ll" "d"": OPENDIR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
705 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": OPENDIR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 705, GF_LOG_INFO
, "%""ll" "d"": OPENDIR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
;
706 goto out;
707 }
708
709 fd_bind (fd);
710 fd_no = gf_fd_unused_get (conn->fdtable, fd);
711 fd_ref (fd); // on behalf of the client
712
713out:
714 rsp.fd = fd_no;
715 rsp.op_ret = op_ret;
716 rsp.op_errno = gf_errno_to_error (op_errno);
717
718 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
719 (xdrproc_t)xdr_gfs3_opendir_rsp);
720
721 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
722
723 return 0;
724}
725
726int
727server_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
728 int32_t op_ret, int32_t op_errno, dict_t *xdata)
729{
730 gf_common_rsp rsp = {0,};
731 rpcsvc_request_t *req = NULL((void*)0);
732 server_state_t *state = NULL((void*)0);
733
734 req = frame->local;
735 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
736
737 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 738, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
738 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 738, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
739
740 if (op_ret == -1) {
741 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 745, GF_LOG_INFO, "%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
742 "%"PRId64": REMOVEXATTR %s (%s) of key %s ==> (%s)",do { do { if (0) printf ("%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 745, GF_LOG_INFO, "%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
743 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 745, GF_LOG_INFO, "%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
744 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 745, GF_LOG_INFO, "%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
745 state->name, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 745, GF_LOG_INFO, "%""ll" "d"": REMOVEXATTR %s (%s) of key %s ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
;
746 goto out;
747 }
748
749out:
750 rsp.op_ret = op_ret;
751 rsp.op_errno = gf_errno_to_error (op_errno);
752
753 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
754 (xdrproc_t)xdr_gf_common_rsp);
755
756 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
757
758 return 0;
759}
760
761int
762server_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
763 int32_t op_ret, int32_t op_errno, dict_t *xdata)
764{
765 gf_common_rsp rsp = {0,};
766 rpcsvc_request_t *req = NULL((void*)0);
767 server_state_t *state = NULL((void*)0);
768
769 req = frame->local;
770 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
771
772 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 773, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
773 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 773, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
774
775 if (op_ret == -1) {
776 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FREMOVEXATTR %""ll" "d"
" (%s) (%s) ==> (%s)", frame->root->unique, state->
resolve.fd_no, uuid_utoa (state->resolve.gfid), state->
name, strerror (op_errno)); } while (0); _gf_log (this->name
, "server-rpc-fops.c", __FUNCTION__, 780, GF_LOG_INFO, "%""ll"
"d"": FREMOVEXATTR %""ll" "d"" (%s) (%s) ==> (%s)", frame
->root->unique, state->resolve.fd_no, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
777 "%"PRId64": FREMOVEXATTR %"PRId64" (%s) (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FREMOVEXATTR %""ll" "d"
" (%s) (%s) ==> (%s)", frame->root->unique, state->
resolve.fd_no, uuid_utoa (state->resolve.gfid), state->
name, strerror (op_errno)); } while (0); _gf_log (this->name
, "server-rpc-fops.c", __FUNCTION__, 780, GF_LOG_INFO, "%""ll"
"d"": FREMOVEXATTR %""ll" "d"" (%s) (%s) ==> (%s)", frame
->root->unique, state->resolve.fd_no, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
778 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FREMOVEXATTR %""ll" "d"
" (%s) (%s) ==> (%s)", frame->root->unique, state->
resolve.fd_no, uuid_utoa (state->resolve.gfid), state->
name, strerror (op_errno)); } while (0); _gf_log (this->name
, "server-rpc-fops.c", __FUNCTION__, 780, GF_LOG_INFO, "%""ll"
"d"": FREMOVEXATTR %""ll" "d"" (%s) (%s) ==> (%s)", frame
->root->unique, state->resolve.fd_no, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
779 uuid_utoa (state->resolve.gfid), state->name,do { do { if (0) printf ("%""ll" "d"": FREMOVEXATTR %""ll" "d"
" (%s) (%s) ==> (%s)", frame->root->unique, state->
resolve.fd_no, uuid_utoa (state->resolve.gfid), state->
name, strerror (op_errno)); } while (0); _gf_log (this->name
, "server-rpc-fops.c", __FUNCTION__, 780, GF_LOG_INFO, "%""ll"
"d"": FREMOVEXATTR %""ll" "d"" (%s) (%s) ==> (%s)", frame
->root->unique, state->resolve.fd_no, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
780 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FREMOVEXATTR %""ll" "d"
" (%s) (%s) ==> (%s)", frame->root->unique, state->
resolve.fd_no, uuid_utoa (state->resolve.gfid), state->
name, strerror (op_errno)); } while (0); _gf_log (this->name
, "server-rpc-fops.c", __FUNCTION__, 780, GF_LOG_INFO, "%""ll"
"d"": FREMOVEXATTR %""ll" "d"" (%s) (%s) ==> (%s)", frame
->root->unique, state->resolve.fd_no, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
;
781 goto out;
782 }
783
784out:
785 rsp.op_ret = op_ret;
786 rsp.op_errno = gf_errno_to_error (op_errno);
787
788 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
789 (xdrproc_t)xdr_gf_common_rsp);
790
791 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
792
793 return 0;
794}
795
796int
797server_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
798 int32_t op_ret, int32_t op_errno, dict_t *dict,
799 dict_t *xdata)
800{
801 gfs3_getxattr_rsp rsp = {0,};
802 rpcsvc_request_t *req = NULL((void*)0);
803 server_state_t *state = NULL((void*)0);
804
805 req = frame->local;
806 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
807
808 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 809, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
809 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 809, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
810
811 if (op_ret == -1) {
812 gf_log (this->name, (((op_errno == ENOTSUP) ||do { do { if (0) printf ("%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 819, (((op_errno == 95) || (op_errno == 61) || (op_errno ==
2)) ? GF_LOG_DEBUG : GF_LOG_INFO), "%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
813 (op_errno == ENODATA) ||do { do { if (0) printf ("%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 819, (((op_errno == 95) || (op_errno == 61) || (op_errno ==
2)) ? GF_LOG_DEBUG : GF_LOG_INFO), "%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
814 (op_errno == ENOENT)) ?do { do { if (0) printf ("%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 819, (((op_errno == 95) || (op_errno == 61) || (op_errno ==
2)) ? GF_LOG_DEBUG : GF_LOG_INFO), "%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
815 GF_LOG_DEBUG : GF_LOG_INFO),do { do { if (0) printf ("%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 819, (((op_errno == 95) || (op_errno == 61) || (op_errno ==
2)) ? GF_LOG_DEBUG : GF_LOG_INFO), "%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
816 "%"PRId64": GETXATTR %s (%s) (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 819, (((op_errno == 95) || (op_errno == 61) || (op_errno ==
2)) ? GF_LOG_DEBUG : GF_LOG_INFO), "%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
817 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 819, (((op_errno == 95) || (op_errno == 61) || (op_errno ==
2)) ? GF_LOG_DEBUG : GF_LOG_INFO), "%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
818 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 819, (((op_errno == 95) || (op_errno == 61) || (op_errno ==
2)) ? GF_LOG_DEBUG : GF_LOG_INFO), "%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
819 state->name, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0); _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__
, 819, (((op_errno == 95) || (op_errno == 61) || (op_errno ==
2)) ? GF_LOG_DEBUG : GF_LOG_INFO), "%""ll" "d"": GETXATTR %s (%s) (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), state->name, strerror (op_errno)); } while
(0)
;
820 goto out;
821 }
822
823 GF_PROTOCOL_DICT_SERIALIZE (this, dict, (&rsp.dict.dict_val),do { int ret = 0; if (!dict) break; ret = dict_allocate_and_serialize
(dict, (&rsp.dict.dict_val), &rsp.dict.dict_len); if
(ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("dict")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 824, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("dict")); } while (0); op_errno = 22; goto out; } } while (
0)
824 rsp.dict.dict_len, op_errno, out)do { int ret = 0; if (!dict) break; ret = dict_allocate_and_serialize
(dict, (&rsp.dict.dict_val), &rsp.dict.dict_len); if
(ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("dict")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 824, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("dict")); } while (0); op_errno = 22; goto out; } } while (
0)
;
825
826out:
827 rsp.op_ret = op_ret;
828 rsp.op_errno = gf_errno_to_error (op_errno);
829
830 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
831 (xdrproc_t)xdr_gfs3_getxattr_rsp);
832
833 GF_FREE (rsp.dict.dict_val)__gf_free (rsp.dict.dict_val);
834
835 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
836
837 return 0;
838}
839
840
841int
842server_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
843 int32_t op_ret, int32_t op_errno, dict_t *dict,
844 dict_t *xdata)
845{
846 gfs3_fgetxattr_rsp rsp = {0,};
847 server_state_t *state = NULL((void*)0);
848 rpcsvc_request_t *req = NULL((void*)0);
849
850 req = frame->local;
851 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
852
853 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 854, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
854 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 854, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
855
856 if (op_ret == -1) {
857 gf_log (this->name, ((op_errno == ENOTSUP) ?do { do { if (0) printf ("%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 862, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0)
858 GF_LOG_DEBUG : GF_LOG_INFO),do { do { if (0) printf ("%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 862, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0)
859 "%"PRId64": FGETXATTR %"PRId64" (%s) (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 862, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0)
860 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 862, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0)
861 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 862, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0)
862 state->name, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 862, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%""ll" "d"": FGETXATTR %""ll" "d"" (%s) (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), state->name, strerror (op_errno
)); } while (0)
;
863 goto out;
864 }
865
866 GF_PROTOCOL_DICT_SERIALIZE (this, dict, (&rsp.dict.dict_val),do { int ret = 0; if (!dict) break; ret = dict_allocate_and_serialize
(dict, (&rsp.dict.dict_val), &rsp.dict.dict_len); if
(ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("dict")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 867, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("dict")); } while (0); op_errno = 22; goto out; } } while (
0)
867 rsp.dict.dict_len, op_errno, out)do { int ret = 0; if (!dict) break; ret = dict_allocate_and_serialize
(dict, (&rsp.dict.dict_val), &rsp.dict.dict_len); if
(ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("dict")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 867, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("dict")); } while (0); op_errno = 22; goto out; } } while (
0)
;
868
869out:
870
871 rsp.op_ret = op_ret;
872 rsp.op_errno = gf_errno_to_error (op_errno);
873
874 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
875 (xdrproc_t)xdr_gfs3_fgetxattr_rsp);
876
877 GF_FREE (rsp.dict.dict_val)__gf_free (rsp.dict.dict_val);
878
879 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
880
881 return 0;
882}
883
884/* print every key */
885static int
886_gf_server_log_setxattr_failure (dict_t *d, char *k, data_t *v,
887 void *tmp)
888{
889 server_state_t *state = NULL((void*)0);
890 call_frame_t *frame = NULL((void*)0);
891
892 frame = tmp;
893 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
894
895 gf_log (THIS->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": SETXATTR %s (%s) ==> %s"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), k); } while (0); _gf_log ((*__glusterfs_this_location
())->name, "server-rpc-fops.c", __FUNCTION__, 898, GF_LOG_INFO
, "%""ll" "d"": SETXATTR %s (%s) ==> %s", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), k); } while (0)
896 "%"PRId64": SETXATTR %s (%s) ==> %s",do { do { if (0) printf ("%""ll" "d"": SETXATTR %s (%s) ==> %s"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), k); } while (0); _gf_log ((*__glusterfs_this_location
())->name, "server-rpc-fops.c", __FUNCTION__, 898, GF_LOG_INFO
, "%""ll" "d"": SETXATTR %s (%s) ==> %s", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), k); } while (0)
897 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": SETXATTR %s (%s) ==> %s"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), k); } while (0); _gf_log ((*__glusterfs_this_location
())->name, "server-rpc-fops.c", __FUNCTION__, 898, GF_LOG_INFO
, "%""ll" "d"": SETXATTR %s (%s) ==> %s", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), k); } while (0)
898 uuid_utoa (state->resolve.gfid), k)do { do { if (0) printf ("%""ll" "d"": SETXATTR %s (%s) ==> %s"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), k); } while (0); _gf_log ((*__glusterfs_this_location
())->name, "server-rpc-fops.c", __FUNCTION__, 898, GF_LOG_INFO
, "%""ll" "d"": SETXATTR %s (%s) ==> %s", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), k); } while (0)
;
899 return 0;
900}
901
902int
903server_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
904 int32_t op_ret, int32_t op_errno, dict_t *xdata)
905{
906 gf_common_rsp rsp = {0,};
907 rpcsvc_request_t *req = NULL((void*)0);
908 server_state_t *state = NULL((void*)0);
909
910 req = frame->local;
911 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
912
913 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 914, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
914 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 914, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
915
916 if (op_ret == -1) {
917 if (op_errno != ENOTSUP95)
918 dict_foreach (state->dict,
919 _gf_server_log_setxattr_failure,
920 frame);
921
922 gf_log (THIS->name, ((op_errno == ENOTSUP) ?do { do { if (0) printf ("%s", strerror (op_errno)); } while (
0); _gf_log ((*__glusterfs_this_location())->name, "server-rpc-fops.c"
, __FUNCTION__, 924, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%s", strerror (op_errno)); } while (0)
923 GF_LOG_DEBUG : GF_LOG_INFO),do { do { if (0) printf ("%s", strerror (op_errno)); } while (
0); _gf_log ((*__glusterfs_this_location())->name, "server-rpc-fops.c"
, __FUNCTION__, 924, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%s", strerror (op_errno)); } while (0)
924 "%s", strerror (op_errno))do { do { if (0) printf ("%s", strerror (op_errno)); } while (
0); _gf_log ((*__glusterfs_this_location())->name, "server-rpc-fops.c"
, __FUNCTION__, 924, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%s", strerror (op_errno)); } while (0)
;
925 goto out;
926 }
927
928out:
929 rsp.op_ret = op_ret;
930 rsp.op_errno = gf_errno_to_error (op_errno);
931
932 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
933 (xdrproc_t)xdr_gf_common_rsp);
934
935 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
936
937 return 0;
938}
939
940/* print every key here */
941static int
942_gf_server_log_fsetxattr_failure (dict_t *d, char *k, data_t *v,
943 void *tmp)
944{
945 call_frame_t *frame = NULL((void*)0);
946 server_state_t *state = NULL((void*)0);
947
948 frame = tmp;
949 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
950
951 gf_log (THIS->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FSETXATTR %""ll" "d"" (%s) ==> %s"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), k); } while (0); _gf_log ((*__glusterfs_this_location
())->name, "server-rpc-fops.c", __FUNCTION__, 954, GF_LOG_INFO
, "%""ll" "d"": FSETXATTR %""ll" "d"" (%s) ==> %s", frame->
root->unique, state->resolve.fd_no, uuid_utoa (state->
resolve.gfid), k); } while (0)
952 "%"PRId64": FSETXATTR %"PRId64" (%s) ==> %s",do { do { if (0) printf ("%""ll" "d"": FSETXATTR %""ll" "d"" (%s) ==> %s"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), k); } while (0); _gf_log ((*__glusterfs_this_location
())->name, "server-rpc-fops.c", __FUNCTION__, 954, GF_LOG_INFO
, "%""ll" "d"": FSETXATTR %""ll" "d"" (%s) ==> %s", frame->
root->unique, state->resolve.fd_no, uuid_utoa (state->
resolve.gfid), k); } while (0)
953 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FSETXATTR %""ll" "d"" (%s) ==> %s"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), k); } while (0); _gf_log ((*__glusterfs_this_location
())->name, "server-rpc-fops.c", __FUNCTION__, 954, GF_LOG_INFO
, "%""ll" "d"": FSETXATTR %""ll" "d"" (%s) ==> %s", frame->
root->unique, state->resolve.fd_no, uuid_utoa (state->
resolve.gfid), k); } while (0)
954 uuid_utoa (state->resolve.gfid), k)do { do { if (0) printf ("%""ll" "d"": FSETXATTR %""ll" "d"" (%s) ==> %s"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), k); } while (0); _gf_log ((*__glusterfs_this_location
())->name, "server-rpc-fops.c", __FUNCTION__, 954, GF_LOG_INFO
, "%""ll" "d"": FSETXATTR %""ll" "d"" (%s) ==> %s", frame->
root->unique, state->resolve.fd_no, uuid_utoa (state->
resolve.gfid), k); } while (0)
;
955
956 return 0;
957}
958
959int
960server_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
961 int32_t op_ret, int32_t op_errno, dict_t *xdata)
962{
963 gf_common_rsp rsp = {0,};
964 rpcsvc_request_t *req = NULL((void*)0);
965 server_state_t *state = NULL((void*)0);
966
967 req = frame->local;
968 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
969
970 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 971, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
971 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 971, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
972
973 if (op_ret == -1) {
974 if (op_errno != ENOTSUP95) {
975 dict_foreach (state->dict,
976 _gf_server_log_fsetxattr_failure,
977 frame);
978 }
979 gf_log (THIS->name, ((op_errno == ENOTSUP) ?do { do { if (0) printf ("%s", strerror (op_errno)); } while (
0); _gf_log ((*__glusterfs_this_location())->name, "server-rpc-fops.c"
, __FUNCTION__, 981, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%s", strerror (op_errno)); } while (0)
980 GF_LOG_DEBUG : GF_LOG_INFO),do { do { if (0) printf ("%s", strerror (op_errno)); } while (
0); _gf_log ((*__glusterfs_this_location())->name, "server-rpc-fops.c"
, __FUNCTION__, 981, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%s", strerror (op_errno)); } while (0)
981 "%s", strerror (op_errno))do { do { if (0) printf ("%s", strerror (op_errno)); } while (
0); _gf_log ((*__glusterfs_this_location())->name, "server-rpc-fops.c"
, __FUNCTION__, 981, ((op_errno == 95) ? GF_LOG_DEBUG : GF_LOG_INFO
), "%s", strerror (op_errno)); } while (0)
;
982 goto out;
983 }
984
985out:
986 rsp.op_ret = op_ret;
987 rsp.op_errno = gf_errno_to_error (op_errno);
988
989 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
990 (xdrproc_t)xdr_gf_common_rsp);
991
992 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
993
994 return 0;
995}
996
997int
998server_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
999 int32_t op_ret, int32_t op_errno, struct iatt *stbuf,
1000 struct iatt *preoldparent, struct iatt *postoldparent,
1001 struct iatt *prenewparent, struct iatt *postnewparent,
1002 dict_t *xdata)
1003{
1004 gfs3_rename_rsp rsp = {0,};
1005 server_state_t *state = NULL((void*)0);
1006 rpcsvc_request_t *req = NULL((void*)0);
1007 inode_t *tmp_inode = NULL((void*)0);
1008 inode_t *tmp_parent = NULL((void*)0);
1009 char oldpar_str[50] = {0,};
1010 char newpar_str[50] = {0,};
1011
1012 req = frame->local;
1013 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1014
1015 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1016, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1016 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1016, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1017
1018 if (op_ret == -1) {
5
Taking false branch
1019 uuid_utoa_r (state->resolve.gfid, oldpar_str);
1020 uuid_utoa_r (state->resolve2.gfid, newpar_str);
1021 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0); _gf_log (this
->name, "server-rpc-fops.c", __FUNCTION__, 1025, GF_LOG_INFO
, "%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0)
1022 "%"PRId64": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0); _gf_log (this
->name, "server-rpc-fops.c", __FUNCTION__, 1025, GF_LOG_INFO
, "%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0)
1023 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0); _gf_log (this
->name, "server-rpc-fops.c", __FUNCTION__, 1025, GF_LOG_INFO
, "%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0)
1024 oldpar_str, state->resolve.bname, state->loc2.path,do { do { if (0) printf ("%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0); _gf_log (this
->name, "server-rpc-fops.c", __FUNCTION__, 1025, GF_LOG_INFO
, "%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0)
1025 newpar_str, state->resolve2.bname, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0); _gf_log (this
->name, "server-rpc-fops.c", __FUNCTION__, 1025, GF_LOG_INFO
, "%""ll" "d"": RENAME %s (%s/%s) -> %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, oldpar_str, state
->resolve.bname, state->loc2.path, newpar_str, state->
resolve2.bname, strerror (op_errno)); } while (0)
;
1026 goto out;
1027 }
1028
1029 stbuf->ia_type = state->loc.inode->ia_type;
6
Access to field 'ia_type' results in a dereference of a null pointer (loaded from variable 'stbuf')
1030
1031 /* TODO: log gfid of the inodes */
1032 gf_log (state->conn->bound_xl->name, GF_LOG_TRACE,do { do { if (0) printf ("%""ll" "d"": RENAME_CBK %s ==> %s"
, frame->root->unique, state->loc.name, state->loc2
.name); } while (0); _gf_log (state->conn->bound_xl->
name, "server-rpc-fops.c", __FUNCTION__, 1034, GF_LOG_TRACE, "%"
"ll" "d"": RENAME_CBK %s ==> %s", frame->root->unique
, state->loc.name, state->loc2.name); } while (0)
1033 "%"PRId64": RENAME_CBK %s ==> %s",do { do { if (0) printf ("%""ll" "d"": RENAME_CBK %s ==> %s"
, frame->root->unique, state->loc.name, state->loc2
.name); } while (0); _gf_log (state->conn->bound_xl->
name, "server-rpc-fops.c", __FUNCTION__, 1034, GF_LOG_TRACE, "%"
"ll" "d"": RENAME_CBK %s ==> %s", frame->root->unique
, state->loc.name, state->loc2.name); } while (0)
1034 frame->root->unique, state->loc.name, state->loc2.name)do { do { if (0) printf ("%""ll" "d"": RENAME_CBK %s ==> %s"
, frame->root->unique, state->loc.name, state->loc2
.name); } while (0); _gf_log (state->conn->bound_xl->
name, "server-rpc-fops.c", __FUNCTION__, 1034, GF_LOG_TRACE, "%"
"ll" "d"": RENAME_CBK %s ==> %s", frame->root->unique
, state->loc.name, state->loc2.name); } while (0)
;
1035
1036 /* Before renaming the inode, we have to get the inode for the
1037 * destination entry (i.e. inode with state->loc2.parent as
1038 * parent and state->loc2.name as name). If it exists, then
1039 * unlink that inode, and send forget on that inode if the
1040 * unlinked entry is the last entry. In case of fuse client
1041 * the fuse kernel module itself sends the forget on the
1042 * unlinked inode.
1043 */
1044 tmp_inode = inode_grep (state->loc.inode->table,
1045 state->loc2.parent, state->loc2.name);
1046 if (tmp_inode) {
1047 inode_unlink (tmp_inode, state->loc2.parent,
1048 state->loc2.name);
1049 tmp_parent = inode_parent (tmp_inode, 0, NULL((void*)0));
1050 if (tmp_parent)
1051 inode_unref (tmp_parent);
1052 else
1053 inode_forget (tmp_inode, 0);
1054
1055 inode_unref (tmp_inode);
1056 }
1057
1058 inode_rename (state->itable,
1059 state->loc.parent, state->loc.name,
1060 state->loc2.parent, state->loc2.name,
1061 state->loc.inode, stbuf);
1062 gf_stat_from_iatt (&rsp.stat, stbuf);
1063
1064 gf_stat_from_iatt (&rsp.preoldparent, preoldparent);
1065 gf_stat_from_iatt (&rsp.postoldparent, postoldparent);
1066
1067 gf_stat_from_iatt (&rsp.prenewparent, prenewparent);
1068 gf_stat_from_iatt (&rsp.postnewparent, postnewparent);
1069
1070out:
1071 rsp.op_ret = op_ret;
1072 rsp.op_errno = gf_errno_to_error (op_errno);
1073
1074 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1075 (xdrproc_t)xdr_gfs3_rename_rsp);
1076
1077 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1078
1079 return 0;
1080}
1081
1082int
1083server_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1084 int32_t op_ret, int32_t op_errno, struct iatt *preparent,
1085 struct iatt *postparent, dict_t *xdata)
1086{
1087 gfs3_unlink_rsp rsp = {0,};
1088 server_state_t *state = NULL((void*)0);
1089 inode_t *parent = NULL((void*)0);
1090 rpcsvc_request_t *req = NULL((void*)0);
1091
1092 req = frame->local;
1093 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1094
1095 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1096, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1096 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1096, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1097
1098 if (op_ret) {
1099 gf_log (this->name, (op_errno == ENOENT)?do { do { if (0) printf ("%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1104, (op_errno == 2)? GF_LOG_DEBUG:GF_LOG_ERROR
, "%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
1100 GF_LOG_DEBUG:GF_LOG_ERROR,do { do { if (0) printf ("%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1104, (op_errno == 2)? GF_LOG_DEBUG:GF_LOG_ERROR
, "%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
1101 "%"PRId64": UNLINK %s (%s/%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1104, (op_errno == 2)? GF_LOG_DEBUG:GF_LOG_ERROR
, "%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
1102 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1104, (op_errno == 2)? GF_LOG_DEBUG:GF_LOG_ERROR
, "%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
1103 uuid_utoa (state->resolve.pargfid),do { do { if (0) printf ("%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1104, (op_errno == 2)? GF_LOG_DEBUG:GF_LOG_ERROR
, "%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
1104 state->resolve.bname, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1104, (op_errno == 2)? GF_LOG_DEBUG:GF_LOG_ERROR
, "%""ll" "d"": UNLINK %s (%s/%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.pargfid), state->resolve.bname, strerror (op_errno)); } while
(0)
;
1105 goto out;
1106 }
1107
1108 /* TODO: log gfid of the inodes */
1109 gf_log (state->conn->bound_xl->name, GF_LOG_TRACE,do { do { if (0) printf ("%""ll" "d"": UNLINK_CBK %s", frame->
root->unique, state->loc.name); } while (0); _gf_log (state
->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 1111, GF_LOG_TRACE, "%""ll" "d"": UNLINK_CBK %s", frame->
root->unique, state->loc.name); } while (0)
1110 "%"PRId64": UNLINK_CBK %s",do { do { if (0) printf ("%""ll" "d"": UNLINK_CBK %s", frame->
root->unique, state->loc.name); } while (0); _gf_log (state
->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 1111, GF_LOG_TRACE, "%""ll" "d"": UNLINK_CBK %s", frame->
root->unique, state->loc.name); } while (0)
1111 frame->root->unique, state->loc.name)do { do { if (0) printf ("%""ll" "d"": UNLINK_CBK %s", frame->
root->unique, state->loc.name); } while (0); _gf_log (state
->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 1111, GF_LOG_TRACE, "%""ll" "d"": UNLINK_CBK %s", frame->
root->unique, state->loc.name); } while (0)
;
1112
1113 inode_unlink (state->loc.inode, state->loc.parent,
1114 state->loc.name);
1115
1116 parent = inode_parent (state->loc.inode, 0, NULL((void*)0));
1117 if (parent)
1118 inode_unref (parent);
1119 else
1120 inode_forget (state->loc.inode, 0);
1121
1122 gf_stat_from_iatt (&rsp.preparent, preparent);
1123 gf_stat_from_iatt (&rsp.postparent, postparent);
1124
1125out:
1126 rsp.op_ret = op_ret;
1127 rsp.op_errno = gf_errno_to_error (op_errno);
1128
1129 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1130 (xdrproc_t)xdr_gfs3_unlink_rsp);
1131
1132 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1133
1134 return 0;
1135}
1136
1137int
1138server_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1139 int32_t op_ret, int32_t op_errno, inode_t *inode,
1140 struct iatt *stbuf, struct iatt *preparent,
1141 struct iatt *postparent, dict_t *xdata)
1142{
1143 gfs3_symlink_rsp rsp = {0,};
1144 server_state_t *state = NULL((void*)0);
1145 inode_t *link_inode = NULL((void*)0);
1146 rpcsvc_request_t *req = NULL((void*)0);
1147
1148 req = frame->local;
1149 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1150
1151 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1152, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1152 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1152, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1153
1154 if (op_ret < 0) {
1155 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1159, GF_LOG_INFO, "%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
1156 "%"PRId64": SYMLINK %s (%s/%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1159, GF_LOG_INFO, "%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
1157 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1159, GF_LOG_INFO, "%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
1158 uuid_utoa (state->resolve.pargfid),do { do { if (0) printf ("%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1159, GF_LOG_INFO, "%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
1159 state->resolve.bname, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1159, GF_LOG_INFO, "%""ll" "d"": SYMLINK %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
;
1160 goto out;
1161 }
1162
1163 gf_stat_from_iatt (&rsp.stat, stbuf);
1164 gf_stat_from_iatt (&rsp.preparent, preparent);
1165 gf_stat_from_iatt (&rsp.postparent, postparent);
1166
1167 link_inode = inode_link (inode, state->loc.parent,
1168 state->loc.name, stbuf);
1169 inode_lookup (link_inode);
1170 inode_unref (link_inode);
1171
1172out:
1173 rsp.op_ret = op_ret;
1174 rsp.op_errno = gf_errno_to_error (op_errno);
1175
1176 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1177 (xdrproc_t)xdr_gfs3_symlink_rsp);
1178
1179 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1180
1181 return 0;
1182}
1183
1184
1185int
1186server_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1187 int32_t op_ret, int32_t op_errno, inode_t *inode,
1188 struct iatt *stbuf, struct iatt *preparent,
1189 struct iatt *postparent, dict_t *xdata)
1190{
1191 gfs3_link_rsp rsp = {0,};
1192 server_state_t *state = NULL((void*)0);
1193 inode_t *link_inode = NULL((void*)0);
1194 rpcsvc_request_t *req = NULL((void*)0);
1195 char gfid_str[50] = {0,};
1196 char newpar_str[50] = {0,};
1197
1198 req = frame->local;
1199 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1200
1201 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1202, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1202 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1202, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1203
1204 if (op_ret) {
1205 uuid_utoa_r (state->resolve.gfid, gfid_str);
1206 uuid_utoa_r (state->resolve2.pargfid, newpar_str);
1207
1208 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": LINK %s (%s) -> %s/%s ==> (%s)"
, frame->root->unique, state->loc.path, gfid_str, newpar_str
, state->resolve2.bname, strerror (op_errno)); } while (0)
; _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1211
, GF_LOG_INFO, "%""ll" "d"": LINK %s (%s) -> %s/%s ==> (%s)"
, frame->root->unique, state->loc.path, gfid_str, newpar_str
, state->resolve2.bname, strerror (op_errno)); } while (0)
1209 "%"PRId64": LINK %s (%s) -> %s/%s ==> (%s)",do { do { if (0) printf ("%""ll" "d"": LINK %s (%s) -> %s/%s ==> (%s)"
, frame->root->unique, state->loc.path, gfid_str, newpar_str
, state->resolve2.bname, strerror (op_errno)); } while (0)
; _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1211
, GF_LOG_INFO, "%""ll" "d"": LINK %s (%s) -> %s/%s ==> (%s)"
, frame->root->unique, state->loc.path, gfid_str, newpar_str
, state->resolve2.bname, strerror (op_errno)); } while (0)
1210 frame->root->unique, state->loc.path, gfid_str,do { do { if (0) printf ("%""ll" "d"": LINK %s (%s) -> %s/%s ==> (%s)"
, frame->root->unique, state->loc.path, gfid_str, newpar_str
, state->resolve2.bname, strerror (op_errno)); } while (0)
; _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1211
, GF_LOG_INFO, "%""ll" "d"": LINK %s (%s) -> %s/%s ==> (%s)"
, frame->root->unique, state->loc.path, gfid_str, newpar_str
, state->resolve2.bname, strerror (op_errno)); } while (0)
1211 newpar_str, state->resolve2.bname, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": LINK %s (%s) -> %s/%s ==> (%s)"
, frame->root->unique, state->loc.path, gfid_str, newpar_str
, state->resolve2.bname, strerror (op_errno)); } while (0)
; _gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1211
, GF_LOG_INFO, "%""ll" "d"": LINK %s (%s) -> %s/%s ==> (%s)"
, frame->root->unique, state->loc.path, gfid_str, newpar_str
, state->resolve2.bname, strerror (op_errno)); } while (0)
;
1212 goto out;
1213 }
1214
1215 gf_stat_from_iatt (&rsp.stat, stbuf);
1216 gf_stat_from_iatt (&rsp.preparent, preparent);
1217 gf_stat_from_iatt (&rsp.postparent, postparent);
1218
1219 link_inode = inode_link (inode, state->loc2.parent,
1220 state->loc2.name, stbuf);
1221 inode_unref (link_inode);
1222
1223out:
1224 rsp.op_ret = op_ret;
1225 rsp.op_errno = gf_errno_to_error (op_errno);
1226
1227 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1228 (xdrproc_t)xdr_gfs3_link_rsp);
1229
1230 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1231
1232 return 0;
1233}
1234
1235int
1236server_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1237 int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
1238 struct iatt *postbuf, dict_t *xdata)
1239{
1240 gfs3_truncate_rsp rsp = {0,};
1241 server_state_t *state = NULL((void*)0);
1242 rpcsvc_request_t *req = NULL((void*)0);
1243
1244 req = frame->local;
1245 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1246
1247 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1248, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1248 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1248, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1249
1250 if (op_ret) {
1251 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": TRUNCATE %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1254, GF_LOG_INFO
, "%""ll" "d"": TRUNCATE %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
1252 "%"PRId64": TRUNCATE %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": TRUNCATE %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1254, GF_LOG_INFO
, "%""ll" "d"": TRUNCATE %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
1253 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": TRUNCATE %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1254, GF_LOG_INFO
, "%""ll" "d"": TRUNCATE %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
1254 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": TRUNCATE %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1254, GF_LOG_INFO
, "%""ll" "d"": TRUNCATE %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
;
1255 goto out;
1256 }
1257
1258 gf_stat_from_iatt (&rsp.prestat, prebuf);
1259 gf_stat_from_iatt (&rsp.poststat, postbuf);
1260
1261out:
1262 rsp.op_ret = op_ret;
1263 rsp.op_errno = gf_errno_to_error (op_errno);
1264
1265 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1266 (xdrproc_t)xdr_gfs3_truncate_rsp);
1267
1268 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1269
1270 return 0;
1271}
1272
1273int
1274server_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1275 int32_t op_ret, int32_t op_errno, struct iatt *stbuf,
1276 dict_t *xdata)
1277{
1278 gfs3_fstat_rsp rsp = {0,};
1279 server_state_t *state = NULL((void*)0);
1280 rpcsvc_request_t *req = NULL((void*)0);
1281
1282 req = frame->local;
1283 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1284
1285 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1286, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1286 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1286, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1287
1288 if (op_ret) {
1289 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FSTAT %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1292
, GF_LOG_INFO, "%""ll" "d"": FSTAT %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1290 "%"PRId64": FSTAT %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FSTAT %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1292
, GF_LOG_INFO, "%""ll" "d"": FSTAT %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1291 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FSTAT %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1292
, GF_LOG_INFO, "%""ll" "d"": FSTAT %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1292 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FSTAT %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1292
, GF_LOG_INFO, "%""ll" "d"": FSTAT %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1293 goto out;
1294 }
1295
1296 gf_stat_from_iatt (&rsp.stat, stbuf);
1297
1298out:
1299 rsp.op_ret = op_ret;
1300 rsp.op_errno = gf_errno_to_error (op_errno);
1301
1302 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1303 (xdrproc_t)xdr_gfs3_fstat_rsp);
1304
1305 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1306
1307 return 0;
1308}
1309
1310int
1311server_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1312 int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
1313 struct iatt *postbuf, dict_t *xdata)
1314{
1315 gfs3_ftruncate_rsp rsp = {0};
1316 server_state_t *state = NULL((void*)0);
1317 rpcsvc_request_t *req = NULL((void*)0);
1318
1319 req = frame->local;
1320 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1321
1322 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1323, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1323 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1323, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1324
1325 if (op_ret) {
1326 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FTRUNCATE %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1329
, GF_LOG_INFO, "%""ll" "d"": FTRUNCATE %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1327 "%"PRId64": FTRUNCATE %"PRId64" (%s)==> (%s)",do { do { if (0) printf ("%""ll" "d"": FTRUNCATE %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1329
, GF_LOG_INFO, "%""ll" "d"": FTRUNCATE %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1328 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FTRUNCATE %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1329
, GF_LOG_INFO, "%""ll" "d"": FTRUNCATE %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1329 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FTRUNCATE %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1329
, GF_LOG_INFO, "%""ll" "d"": FTRUNCATE %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1330 goto out;
1331 }
1332
1333 gf_stat_from_iatt (&rsp.prestat, prebuf);
1334 gf_stat_from_iatt (&rsp.poststat, postbuf);
1335
1336out:
1337 rsp.op_ret = op_ret;
1338 rsp.op_errno = gf_errno_to_error (op_errno);
1339
1340 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1341 (xdrproc_t)xdr_gfs3_ftruncate_rsp);
1342
1343 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1344
1345 return 0;
1346}
1347
1348int
1349server_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1350 int32_t op_ret, int32_t op_errno, dict_t *xdata)
1351{
1352 gf_common_rsp rsp = {0,};
1353 server_state_t *state = NULL((void*)0);
1354 rpcsvc_request_t *req = NULL((void*)0);
1355
1356 req = frame->local;
1357 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1358
1359 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1360, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1360 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1360, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1361
1362 if (op_ret < 0) {
1363 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FLUSH %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1366
, GF_LOG_INFO, "%""ll" "d"": FLUSH %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1364 "%"PRId64": FLUSH %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FLUSH %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1366
, GF_LOG_INFO, "%""ll" "d"": FLUSH %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1365 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FLUSH %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1366
, GF_LOG_INFO, "%""ll" "d"": FLUSH %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1366 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FLUSH %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1366
, GF_LOG_INFO, "%""ll" "d"": FLUSH %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1367 goto out;
1368 }
1369
1370out:
1371 rsp.op_ret = op_ret;
1372 rsp.op_errno = gf_errno_to_error (op_errno);
1373
1374 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1375 (xdrproc_t)xdr_gf_common_rsp);
1376
1377 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1378
1379 return 0;
1380}
1381
1382int
1383server_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1384 int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
1385 struct iatt *postbuf, dict_t *xdata)
1386{
1387 gfs3_fsync_rsp rsp = {0,};
1388 server_state_t *state = NULL((void*)0);
1389 rpcsvc_request_t *req = NULL((void*)0);
1390
1391 req = frame->local;
1392 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1393
1394 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1395, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1395 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1395, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1396
1397 if (op_ret < 0) {
1398 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FSYNC %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1401
, GF_LOG_INFO, "%""ll" "d"": FSYNC %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1399 "%"PRId64": FSYNC %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FSYNC %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1401
, GF_LOG_INFO, "%""ll" "d"": FSYNC %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1400 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FSYNC %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1401
, GF_LOG_INFO, "%""ll" "d"": FSYNC %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1401 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FSYNC %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1401
, GF_LOG_INFO, "%""ll" "d"": FSYNC %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1402 goto out;
1403 }
1404
1405 gf_stat_from_iatt (&(rsp.prestat), prebuf);
1406 gf_stat_from_iatt (&(rsp.poststat), postbuf);
1407
1408out:
1409 rsp.op_ret = op_ret;
1410 rsp.op_errno = gf_errno_to_error (op_errno);
1411
1412 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1413 (xdrproc_t)xdr_gfs3_fsync_rsp);
1414
1415 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1416
1417 return 0;
1418}
1419
1420int
1421server_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1422 int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
1423 struct iatt *postbuf, dict_t *xdata)
1424{
1425 gfs3_write_rsp rsp = {0,};
1426 server_state_t *state = NULL((void*)0);
1427 rpcsvc_request_t *req = NULL((void*)0);
1428
1429 req = frame->local;
1430 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1431
1432 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1433, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1433 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1433, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1434
1435 if (op_ret < 0) {
1436 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": WRITEV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1439
, GF_LOG_INFO, "%""ll" "d"": WRITEV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1437 "%"PRId64": WRITEV %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": WRITEV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1439
, GF_LOG_INFO, "%""ll" "d"": WRITEV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1438 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": WRITEV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1439
, GF_LOG_INFO, "%""ll" "d"": WRITEV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1439 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": WRITEV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1439
, GF_LOG_INFO, "%""ll" "d"": WRITEV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1440 goto out;
1441 }
1442
1443 gf_stat_from_iatt (&rsp.prestat, prebuf);
1444 gf_stat_from_iatt (&rsp.poststat, postbuf);
1445
1446out:
1447 rsp.op_ret = op_ret;
1448 rsp.op_errno = gf_errno_to_error (op_errno);
1449
1450 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1451 (xdrproc_t)xdr_gfs3_write_rsp);
1452
1453 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1454
1455 return 0;
1456}
1457
1458
1459int
1460server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1461 int32_t op_ret, int32_t op_errno,
1462 struct iovec *vector, int32_t count,
1463 struct iatt *stbuf, struct iobref *iobref, dict_t *xdata)
1464{
1465 gfs3_read_rsp rsp = {0,};
1466 server_state_t *state = NULL((void*)0);
1467 rpcsvc_request_t *req = NULL((void*)0);
1468
1469 req = frame->local;
1470 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1471
1472#ifdef GF_TESTING_IO_XDATA
1473 {
1474 int ret = 0;
1475 if (!xdata)
1476 xdata = dict_new ();
1477
1478 ret = dict_set_str (xdata, "testing-the-xdata-key",
1479 "testing-xdata-value");
1480 }
1481#endif
1482 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1483, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1483 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1483, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1484
1485 if (op_ret < 0) {
1486 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": READV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1489
, GF_LOG_INFO, "%""ll" "d"": READV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1487 "%"PRId64": READV %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": READV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1489
, GF_LOG_INFO, "%""ll" "d"": READV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1488 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": READV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1489
, GF_LOG_INFO, "%""ll" "d"": READV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1489 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": READV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1489
, GF_LOG_INFO, "%""ll" "d"": READV %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1490 goto out;
1491 }
1492
1493 gf_stat_from_iatt (&rsp.stat, stbuf);
1494 rsp.size = op_ret;
1495
1496out:
1497 rsp.op_ret = op_ret;
1498 rsp.op_errno = gf_errno_to_error (op_errno);
1499
1500 server_submit_reply (frame, req, &rsp, vector, count, iobref,
1501 (xdrproc_t)xdr_gfs3_read_rsp);
1502
1503 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1504
1505 return 0;
1506}
1507
1508int
1509server_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1510 int32_t op_ret, int32_t op_errno,
1511 uint32_t weak_checksum, uint8_t *strong_checksum,
1512 dict_t *xdata)
1513{
1514 gfs3_rchecksum_rsp rsp = {0,};
1515 rpcsvc_request_t *req = NULL((void*)0);
1516 server_state_t *state = NULL((void*)0);
1517
1518 req = frame->local;
1519 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1520
1521 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1522, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1522 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1522, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1523
1524 if (op_ret < 0) {
1525 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": RCHECKSUM %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1528
, GF_LOG_INFO, "%""ll" "d"": RCHECKSUM %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1526 "%"PRId64": RCHECKSUM %"PRId64" (%s)==> (%s)",do { do { if (0) printf ("%""ll" "d"": RCHECKSUM %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1528
, GF_LOG_INFO, "%""ll" "d"": RCHECKSUM %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1527 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": RCHECKSUM %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1528
, GF_LOG_INFO, "%""ll" "d"": RCHECKSUM %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1528 uuid_utoa (state->resolve.gfid), strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": RCHECKSUM %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1528
, GF_LOG_INFO, "%""ll" "d"": RCHECKSUM %""ll" "d"" (%s)==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1529 goto out;
1530 }
1531
1532 rsp.weak_checksum = weak_checksum;
1533
1534 rsp.strong_checksum.strong_checksum_val = (char *)strong_checksum;
1535 rsp.strong_checksum.strong_checksum_len = MD5_DIGEST_LENGTH16;
1536
1537out:
1538 rsp.op_ret = op_ret;
1539 rsp.op_errno = gf_errno_to_error (op_errno);
1540
1541 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1542 (xdrproc_t)xdr_gfs3_rchecksum_rsp);
1543
1544 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1545
1546 return 0;
1547}
1548
1549
1550int
1551server_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1552 int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
1553{
1554 server_connection_t *conn = NULL((void*)0);
1555 server_state_t *state = NULL((void*)0);
1556 rpcsvc_request_t *req = NULL((void*)0);
1557 uint64_t fd_no = 0;
1558 gfs3_open_rsp rsp = {0,};
1559
1560 req = frame->local;
1561 conn = SERVER_CONNECTION (frame)((server_connection_t *) ((server_state_t *)frame->root->
state)->conn)
;
1562 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1563
1564 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1565, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1565 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1565, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1566
1567 if (op_ret < 0) {
1568 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": OPEN %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1572, GF_LOG_INFO
, "%""ll" "d"": OPEN %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1569 "%"PRId64": OPEN %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": OPEN %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1572, GF_LOG_INFO
, "%""ll" "d"": OPEN %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1570 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": OPEN %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1572, GF_LOG_INFO
, "%""ll" "d"": OPEN %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1571 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": OPEN %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1572, GF_LOG_INFO
, "%""ll" "d"": OPEN %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1572 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": OPEN %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1572, GF_LOG_INFO
, "%""ll" "d"": OPEN %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
;
1573 goto out;
1574 }
1575
1576 fd_bind (fd);
1577 fd_no = gf_fd_unused_get (conn->fdtable, fd);
1578 fd_ref (fd);
1579 rsp.fd = fd_no;
1580
1581out:
1582 rsp.op_ret = op_ret;
1583 rsp.op_errno = gf_errno_to_error (op_errno);
1584
1585 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1586 (xdrproc_t)xdr_gfs3_open_rsp);
1587 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1588
1589 return 0;
1590}
1591
1592
1593int
1594server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1595 int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
1596 struct iatt *stbuf, struct iatt *preparent,
1597 struct iatt *postparent, dict_t *xdata)
1598{
1599 server_connection_t *conn = NULL((void*)0);
1600 server_state_t *state = NULL((void*)0);
1601 inode_t *link_inode = NULL((void*)0);
1602 rpcsvc_request_t *req = NULL((void*)0);
1603 uint64_t fd_no = 0;
1604 gfs3_create_rsp rsp = {0,};
1605
1606 req = frame->local;
1607 conn = SERVER_CONNECTION (frame)((server_connection_t *) ((server_state_t *)frame->root->
state)->conn)
;
1608 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1609
1610 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1611, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1611 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1611, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1612
1613 if (op_ret < 0) {
1614 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1618, GF_LOG_INFO, "%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
1615 "%"PRId64": CREATE %s (%s/%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1618, GF_LOG_INFO, "%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
1616 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1618, GF_LOG_INFO, "%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
1617 uuid_utoa (state->resolve.pargfid),do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1618, GF_LOG_INFO, "%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
1618 state->resolve.bname, strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0); _gf_log (this->name, "server-rpc-fops.c",
__FUNCTION__, 1618, GF_LOG_INFO, "%""ll" "d"": CREATE %s (%s/%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.pargfid), state->resolve.bname, strerror (op_errno
)); } while (0)
;
1619 goto out;
1620 }
1621
1622 /* TODO: log gfid too */
1623 gf_log (state->conn->bound_xl->name, GF_LOG_TRACE,do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s)", frame
->root->unique, state->loc.name, uuid_utoa (stbuf->
ia_gfid)); } while (0); _gf_log (state->conn->bound_xl->
name, "server-rpc-fops.c", __FUNCTION__, 1626, GF_LOG_TRACE, "%"
"ll" "d"": CREATE %s (%s)", frame->root->unique, state->
loc.name, uuid_utoa (stbuf->ia_gfid)); } while (0)
1624 "%"PRId64": CREATE %s (%s)",do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s)", frame
->root->unique, state->loc.name, uuid_utoa (stbuf->
ia_gfid)); } while (0); _gf_log (state->conn->bound_xl->
name, "server-rpc-fops.c", __FUNCTION__, 1626, GF_LOG_TRACE, "%"
"ll" "d"": CREATE %s (%s)", frame->root->unique, state->
loc.name, uuid_utoa (stbuf->ia_gfid)); } while (0)
1625 frame->root->unique, state->loc.name,do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s)", frame
->root->unique, state->loc.name, uuid_utoa (stbuf->
ia_gfid)); } while (0); _gf_log (state->conn->bound_xl->
name, "server-rpc-fops.c", __FUNCTION__, 1626, GF_LOG_TRACE, "%"
"ll" "d"": CREATE %s (%s)", frame->root->unique, state->
loc.name, uuid_utoa (stbuf->ia_gfid)); } while (0)
1626 uuid_utoa (stbuf->ia_gfid))do { do { if (0) printf ("%""ll" "d"": CREATE %s (%s)", frame
->root->unique, state->loc.name, uuid_utoa (stbuf->
ia_gfid)); } while (0); _gf_log (state->conn->bound_xl->
name, "server-rpc-fops.c", __FUNCTION__, 1626, GF_LOG_TRACE, "%"
"ll" "d"": CREATE %s (%s)", frame->root->unique, state->
loc.name, uuid_utoa (stbuf->ia_gfid)); } while (0)
;
1627
1628 link_inode = inode_link (inode, state->loc.parent,
1629 state->loc.name, stbuf);
1630
1631 if (!link_inode) {
1632 op_ret = -1;
1633 op_errno = ENOENT2;
1634 goto out;
1635 }
1636
1637 if (link_inode != inode) {
1638 /*
1639 VERY racy code (if used anywhere else)
1640 -- don't do this without understanding
1641 */
1642
1643 inode_unref (fd->inode);
1644 fd->inode = inode_ref (link_inode);
1645 }
1646
1647 inode_lookup (link_inode);
1648 inode_unref (link_inode);
1649
1650 fd_bind (fd);
1651
1652 fd_no = gf_fd_unused_get (conn->fdtable, fd);
1653 fd_ref (fd);
1654
1655 if ((fd_no < 0) || (fd == 0)) {
1656 op_ret = fd_no;
1657 op_errno = errno(*__errno_location ());
1658 }
1659
1660 gf_stat_from_iatt (&rsp.stat, stbuf);
1661 gf_stat_from_iatt (&rsp.preparent, preparent);
1662 gf_stat_from_iatt (&rsp.postparent, postparent);
1663
1664out:
1665 rsp.fd = fd_no;
1666 rsp.op_ret = op_ret;
1667 rsp.op_errno = gf_errno_to_error (op_errno);
1668
1669 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1670 (xdrproc_t)xdr_gfs3_create_rsp);
1671
1672 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1673
1674 return 0;
1675}
1676
1677int
1678server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1679 int32_t op_ret, int32_t op_errno, const char *buf,
1680 struct iatt *stbuf, dict_t *xdata)
1681{
1682 gfs3_readlink_rsp rsp = {0,};
1683 server_state_t *state = NULL((void*)0);
1684 rpcsvc_request_t *req = NULL((void*)0);
1685
1686 req = frame->local;
1687 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1688
1689 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1690, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1690 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1690, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1691
1692 if (op_ret < 0) {
1693 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": READLINK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1697, GF_LOG_INFO
, "%""ll" "d"": READLINK %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
1694 "%"PRId64": READLINK %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": READLINK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1697, GF_LOG_INFO
, "%""ll" "d"": READLINK %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
1695 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": READLINK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1697, GF_LOG_INFO
, "%""ll" "d"": READLINK %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
1696 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": READLINK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1697, GF_LOG_INFO
, "%""ll" "d"": READLINK %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
1697 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": READLINK %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1697, GF_LOG_INFO
, "%""ll" "d"": READLINK %s (%s) ==> (%s)", frame->root
->unique, state->loc.path, uuid_utoa (state->resolve
.gfid), strerror (op_errno)); } while (0)
;
1698 goto out;
1699 }
1700
1701 gf_stat_from_iatt (&rsp.buf, stbuf);
1702 rsp.path = (char *)buf;
1703
1704out:
1705 rsp.op_ret = op_ret;
1706 rsp.op_errno = gf_errno_to_error (op_errno);
1707
1708 if (!rsp.path)
1709 rsp.path = "";
1710
1711 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1712 (xdrproc_t)xdr_gfs3_readlink_rsp);
1713
1714 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1715
1716 return 0;
1717}
1718
1719int
1720server_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1721 int32_t op_ret, int32_t op_errno, struct iatt *stbuf,
1722 dict_t *xdata)
1723{
1724 gfs3_stat_rsp rsp = {0,};
1725 server_state_t *state = NULL((void*)0);
1726 rpcsvc_request_t *req = NULL((void*)0);
1727
1728 req = frame->local;
1729 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1730
1731 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1732, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1732 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1732, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1733
1734 if (op_ret) {
1735 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": STAT %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1739, GF_LOG_INFO
, "%""ll" "d"": STAT %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1736 "%"PRId64": STAT %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": STAT %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1739, GF_LOG_INFO
, "%""ll" "d"": STAT %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1737 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": STAT %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1739, GF_LOG_INFO
, "%""ll" "d"": STAT %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1738 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": STAT %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1739, GF_LOG_INFO
, "%""ll" "d"": STAT %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1739 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": STAT %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1739, GF_LOG_INFO
, "%""ll" "d"": STAT %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
;
1740 goto out;
1741 }
1742
1743 gf_stat_from_iatt (&rsp.stat, stbuf);
1744
1745out:
1746 rsp.op_ret = op_ret;
1747 rsp.op_errno = gf_errno_to_error (op_errno);
1748
1749 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1750 (xdrproc_t)xdr_gfs3_stat_rsp);
1751
1752 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1753
1754 return 0;
1755}
1756
1757
1758int
1759server_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1760 int32_t op_ret, int32_t op_errno,
1761 struct iatt *statpre, struct iatt *statpost, dict_t *xdata)
1762{
1763 gfs3_setattr_rsp rsp = {0,};
1764 server_state_t *state = NULL((void*)0);
1765 rpcsvc_request_t *req = NULL((void*)0);
1766
1767 req = frame->local;
1768 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1769
1770 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1771, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1771 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1771, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1772
1773 if (op_ret) {
1774 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": SETATTR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1778, GF_LOG_INFO
, "%""ll" "d"": SETATTR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1775 "%"PRId64": SETATTR %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": SETATTR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1778, GF_LOG_INFO
, "%""ll" "d"": SETATTR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1776 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": SETATTR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1778, GF_LOG_INFO
, "%""ll" "d"": SETATTR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1777 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": SETATTR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1778, GF_LOG_INFO
, "%""ll" "d"": SETATTR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1778 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": SETATTR %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1778, GF_LOG_INFO
, "%""ll" "d"": SETATTR %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
;
1779 goto out;
1780 }
1781
1782 gf_stat_from_iatt (&rsp.statpre, statpre);
1783 gf_stat_from_iatt (&rsp.statpost, statpost);
1784
1785out:
1786 rsp.op_ret = op_ret;
1787 rsp.op_errno = gf_errno_to_error (op_errno);
1788
1789 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1790 (xdrproc_t)xdr_gfs3_setattr_rsp);
1791
1792 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1793
1794 return 0;
1795}
1796
1797int
1798server_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1799 int32_t op_ret, int32_t op_errno,
1800 struct iatt *statpre, struct iatt *statpost, dict_t *xdata)
1801{
1802 gfs3_fsetattr_rsp rsp = {0,};
1803 server_state_t *state = NULL((void*)0);
1804 rpcsvc_request_t *req = NULL((void*)0);
1805
1806 req = frame->local;
1807 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1808
1809 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1810, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1810 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1810, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1811
1812 if (op_ret) {
1813 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1817
, GF_LOG_INFO, "%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1814 "%"PRId64": FSETATTR %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1817
, GF_LOG_INFO, "%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1815 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1817
, GF_LOG_INFO, "%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1816 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1817
, GF_LOG_INFO, "%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1817 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1817
, GF_LOG_INFO, "%""ll" "d"": FSETATTR %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1818 goto out;
1819 }
1820
1821 gf_stat_from_iatt (&rsp.statpre, statpre);
1822 gf_stat_from_iatt (&rsp.statpost, statpost);
1823
1824out:
1825 rsp.op_ret = op_ret;
1826 rsp.op_errno = gf_errno_to_error (op_errno);
1827
1828 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1829 (xdrproc_t)xdr_gfs3_fsetattr_rsp);
1830
1831 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1832
1833 return 0;
1834}
1835
1836
1837int
1838server_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1839 int32_t op_ret, int32_t op_errno, dict_t *dict,
1840 dict_t *xdata)
1841{
1842 gfs3_xattrop_rsp rsp = {0,};
1843 server_state_t *state = NULL((void*)0);
1844 rpcsvc_request_t *req = NULL((void*)0);
1845
1846 req = frame->local;
1847 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1848
1849 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1850, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1850 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1850, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1851
1852 if (op_ret < 0) {
1853 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": XATTROP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1857, GF_LOG_INFO
, "%""ll" "d"": XATTROP %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1854 "%"PRId64": XATTROP %s (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": XATTROP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1857, GF_LOG_INFO
, "%""ll" "d"": XATTROP %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1855 frame->root->unique, state->loc.path,do { do { if (0) printf ("%""ll" "d"": XATTROP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1857, GF_LOG_INFO
, "%""ll" "d"": XATTROP %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1856 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": XATTROP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1857, GF_LOG_INFO
, "%""ll" "d"": XATTROP %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
1857 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": XATTROP %s (%s) ==> (%s)"
, frame->root->unique, state->loc.path, uuid_utoa (state
->resolve.gfid), strerror (op_errno)); } while (0); _gf_log
(this->name, "server-rpc-fops.c", __FUNCTION__, 1857, GF_LOG_INFO
, "%""ll" "d"": XATTROP %s (%s) ==> (%s)", frame->root->
unique, state->loc.path, uuid_utoa (state->resolve.gfid
), strerror (op_errno)); } while (0)
;
1858 goto out;
1859 }
1860
1861 GF_PROTOCOL_DICT_SERIALIZE (this, dict, (&rsp.dict.dict_val),do { int ret = 0; if (!dict) break; ret = dict_allocate_and_serialize
(dict, (&rsp.dict.dict_val), &rsp.dict.dict_len); if
(ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("dict")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1862, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("dict")); } while (0); op_errno = 22; goto out; } } while (
0)
1862 rsp.dict.dict_len, op_errno, out)do { int ret = 0; if (!dict) break; ret = dict_allocate_and_serialize
(dict, (&rsp.dict.dict_val), &rsp.dict.dict_len); if
(ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("dict")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1862, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("dict")); } while (0); op_errno = 22; goto out; } } while (
0)
;
1863
1864out:
1865 rsp.op_ret = op_ret;
1866 rsp.op_errno = gf_errno_to_error (op_errno);
1867
1868 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1869 (xdrproc_t)xdr_gfs3_xattrop_rsp);
1870
1871 GF_FREE (rsp.dict.dict_val)__gf_free (rsp.dict.dict_val);
1872
1873 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1874
1875 return 0;
1876}
1877
1878
1879int
1880server_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1881 int32_t op_ret, int32_t op_errno, dict_t *dict,
1882 dict_t *xdata)
1883{
1884 gfs3_xattrop_rsp rsp = {0,};
1885 server_state_t *state = NULL((void*)0);
1886 rpcsvc_request_t *req = NULL((void*)0);
1887
1888 req = frame->local;
1889 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1890
1891 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1892, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1892 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1892, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1893
1894 if (op_ret < 0) {
1895 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1899
, GF_LOG_INFO, "%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1896 "%"PRId64": FXATTROP %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1899
, GF_LOG_INFO, "%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1897 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1899
, GF_LOG_INFO, "%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1898 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1899
, GF_LOG_INFO, "%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1899 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1899
, GF_LOG_INFO, "%""ll" "d"": FXATTROP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1900 goto out;
1901 }
1902
1903 GF_PROTOCOL_DICT_SERIALIZE (this, dict, (&rsp.dict.dict_val),do { int ret = 0; if (!dict) break; ret = dict_allocate_and_serialize
(dict, (&rsp.dict.dict_val), &rsp.dict.dict_len); if
(ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("dict")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1904, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("dict")); } while (0); op_errno = 22; goto out; } } while (
0)
1904 rsp.dict.dict_len, op_errno, out)do { int ret = 0; if (!dict) break; ret = dict_allocate_and_serialize
(dict, (&rsp.dict.dict_val), &rsp.dict.dict_len); if
(ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("dict")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1904, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("dict")); } while (0); op_errno = 22; goto out; } } while (
0)
;
1905
1906out:
1907 rsp.op_ret = op_ret;
1908 rsp.op_errno = gf_errno_to_error (op_errno);
1909
1910 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1911 (xdrproc_t)xdr_gfs3_fxattrop_rsp);
1912
1913 GF_FREE (rsp.dict.dict_val)__gf_free (rsp.dict.dict_val);
1914
1915 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1916
1917 return 0;
1918}
1919
1920
1921int
1922server_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
1923 int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata)
1924{
1925 gfs3_readdirp_rsp rsp = {0,};
1926 server_state_t *state = NULL((void*)0);
1927 rpcsvc_request_t *req = NULL((void*)0);
1928 int ret = 0;
1929
1930 req = frame->local;
1931 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
1932
1933 GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val),do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1934, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
1934 rsp.xdata.xdata_len, op_errno, out)do { int ret = 0; if (!xdata) break; ret = dict_allocate_and_serialize
(xdata, (&rsp.xdata.xdata_val), &rsp.xdata.xdata_len
); if (ret < 0) { do { do { if (0) printf ("failed to get serialized dict (%s)"
, ("xdata")); } while (0); _gf_log (this->name, "server-rpc-fops.c"
, __FUNCTION__, 1934, GF_LOG_WARNING, "failed to get serialized dict (%s)"
, ("xdata")); } while (0); op_errno = 22; goto out; } } while
(0)
;
1935
1936 if (op_ret < 0) {
1937 gf_log (this->name, GF_LOG_INFO,do { do { if (0) printf ("%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1941
, GF_LOG_INFO, "%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1938 "%"PRId64": READDIRP %"PRId64" (%s) ==> (%s)",do { do { if (0) printf ("%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1941
, GF_LOG_INFO, "%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1939 frame->root->unique, state->resolve.fd_no,do { do { if (0) printf ("%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1941
, GF_LOG_INFO, "%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1940 uuid_utoa (state->resolve.gfid),do { do { if (0) printf ("%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1941
, GF_LOG_INFO, "%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
1941 strerror (op_errno))do { do { if (0) printf ("%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0);
_gf_log (this->name, "server-rpc-fops.c", __FUNCTION__, 1941
, GF_LOG_INFO, "%""ll" "d"": READDIRP %""ll" "d"" (%s) ==> (%s)"
, frame->root->unique, state->resolve.fd_no, uuid_utoa
(state->resolve.gfid), strerror (op_errno)); } while (0)
;
1942 goto out;
1943 }
1944
1945 /* (op_ret == 0) is valid, and means EOF */
1946 if (op_ret) {
1947 ret = serialize_rsp_direntp (entries, &rsp);
1948 if (ret == -1) {
1949 op_ret = -1;
1950 op_errno = ENOMEM12;
1951 goto out;
1952 }
1953 }
1954
1955 /* TODO: need more clear thoughts before calling this function. */
1956 /* gf_link_inodes_from_dirent (this, state->fd->inode, entries); */
1957
1958out:
1959 rsp.op_ret = op_ret;
1960 rsp.op_errno = gf_errno_to_error (op_errno);
1961
1962 server_submit_reply (frame, req, &rsp, NULL((void*)0), 0, NULL((void*)0),
1963 (xdrproc_t)xdr_gfs3_readdirp_rsp);
1964
1965 GF_FREE (rsp.xdata.xdata_val)__gf_free (rsp.xdata.xdata_val);
1966
1967 readdirp_rsp_cleanup (&rsp);
1968
1969 return 0;
1970}
1971
1972/* Resume function section */
1973
1974int
1975server_rchecksum_resume (call_frame_t *frame, xlator_t *bound_xl)
1976{
1977 server_state_t *state = NULL((void*)0);
1978 int op_ret = 0;
1979 int op_errno = EINVAL22;
1980
1981 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
1982
1983 if (state->resolve.op_ret != 0) {
1984 op_ret = state->resolve.op_ret;
1985 op_errno = state->resolve.op_errno;
1986 goto err;
1987 }
1988
1989 STACK_WIND (frame, server_rchecksum_cbk, bound_xl,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 1991
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->rchecksum_cbk) tmp_cbk = server_rchecksum_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->rchecksum"; _new->unwind_to = "server_rchecksum_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->rchecksum); bound_xl->fops->rchecksum (_new
, bound_xl, state->fd, state->offset, state->size, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
1990 bound_xl->fops->rchecksum, state->fd,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 1991
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->rchecksum_cbk) tmp_cbk = server_rchecksum_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->rchecksum"; _new->unwind_to = "server_rchecksum_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->rchecksum); bound_xl->fops->rchecksum (_new
, bound_xl, state->fd, state->offset, state->size, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
1991 state->offset, state->size, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 1991
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->rchecksum_cbk) tmp_cbk = server_rchecksum_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->rchecksum"; _new->unwind_to = "server_rchecksum_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->rchecksum); bound_xl->fops->rchecksum (_new
, bound_xl, state->fd, state->offset, state->size, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
;
1992
1993 return 0;
1994err:
1995 server_rchecksum_cbk (frame, NULL((void*)0), frame->this, op_ret, op_errno, 0,
1996 NULL((void*)0), NULL((void*)0));
1997
1998 return 0;
1999
2000}
2001
2002int
2003server_lk_resume (call_frame_t *frame, xlator_t *bound_xl)
2004{
2005 server_state_t *state = NULL((void*)0);
2006
2007 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2008
2009 if (state->resolve.op_ret != 0)
2010 goto err;
2011
2012 STACK_WIND (frame, server_lk_cbk, bound_xl, bound_xl->fops->lk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2013
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->lk_cbk) tmp_cbk = server_lk_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->lk"; _new->unwind_to = "server_lk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->lk); bound_xl->fops->lk (_new, bound_xl, state
->fd, state->cmd, &state->flock, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2013 state->fd, state->cmd, &state->flock, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2013
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->lk_cbk) tmp_cbk = server_lk_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->lk"; _new->unwind_to = "server_lk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->lk); bound_xl->fops->lk (_new, bound_xl, state
->fd, state->cmd, &state->flock, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
;
2014
2015 return 0;
2016
2017err:
2018 server_lk_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2019 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2020 return 0;
2021}
2022
2023int
2024server_rename_resume (call_frame_t *frame, xlator_t *bound_xl)
2025{
2026 server_state_t *state = NULL((void*)0);
2027 int op_ret = 0;
2028 int op_errno = 0;
2029
2030 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2031
2032 if (state->resolve.op_ret != 0) {
1
Taking true branch
2033 op_ret = state->resolve.op_ret;
2034 op_errno = state->resolve.op_errno;
2035 goto err;
2
Control jumps to line 2049
2036 }
2037
2038 if (state->resolve2.op_ret != 0) {
2039 op_ret = state->resolve2.op_ret;
2040 op_errno = state->resolve2.op_errno;
2041 goto err;
2042 }
2043
2044 STACK_WIND (frame, server_rename_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2046
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->rename_cbk) tmp_cbk = server_rename_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->rename"; _new->unwind_to = "server_rename_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->rename); bound_xl->fops->rename (_new, bound_xl
, &state->loc, &state->loc2, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
2045 bound_xl, bound_xl->fops->rename,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2046
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->rename_cbk) tmp_cbk = server_rename_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->rename"; _new->unwind_to = "server_rename_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->rename); bound_xl->fops->rename (_new, bound_xl
, &state->loc, &state->loc2, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
2046 &state->loc, &state->loc2, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2046
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->rename_cbk) tmp_cbk = server_rename_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->rename"; _new->unwind_to = "server_rename_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->rename); bound_xl->fops->rename (_new, bound_xl
, &state->loc, &state->loc2, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
;
2047 return 0;
2048err:
2049 server_rename_cbk (frame, NULL((void*)0), frame->this, op_ret, op_errno,
4
Calling 'server_rename_cbk'
2050 NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0));
3
Within the expansion of the macro 'NULL':
a
Passing null pointer value via 6th parameter 'stbuf'
2051 return 0;
2052}
2053
2054
2055int
2056server_link_resume (call_frame_t *frame, xlator_t *bound_xl)
2057{
2058 server_state_t *state = NULL((void*)0);
2059 int op_ret = 0;
2060 int op_errno = 0;
2061
2062 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2063
2064 if (state->resolve.op_ret != 0) {
2065 op_ret = state->resolve.op_ret;
2066 op_errno = state->resolve.op_errno;
2067 goto err;
2068 }
2069
2070 if (state->resolve2.op_ret != 0) {
2071 op_ret = state->resolve2.op_ret;
2072 op_errno = state->resolve2.op_errno;
2073 goto err;
2074 }
2075
2076 state->loc2.inode = inode_ref (state->loc.inode);
2077
2078 STACK_WIND (frame, server_link_cbk, bound_xl, bound_xl->fops->link,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2079
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->link_cbk) tmp_cbk = server_link_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->link"; _new->unwind_to = "server_link_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->link); bound_xl->fops->link (_new, bound_xl
, &state->loc, &state->loc2, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
2079 &state->loc, &state->loc2, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2079
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->link_cbk) tmp_cbk = server_link_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->link"; _new->unwind_to = "server_link_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->link); bound_xl->fops->link (_new, bound_xl
, &state->loc, &state->loc2, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
;
2080
2081 return 0;
2082err:
2083 server_link_cbk (frame, NULL((void*)0), frame->this, op_ret, op_errno,
2084 NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0));
2085 return 0;
2086}
2087
2088int
2089server_symlink_resume (call_frame_t *frame, xlator_t *bound_xl)
2090{
2091 server_state_t *state = NULL((void*)0);
2092
2093 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2094
2095 if (state->resolve.op_ret != 0)
2096 goto err;
2097
2098 state->loc.inode = inode_new (state->itable);
2099
2100 STACK_WIND (frame, server_symlink_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2102
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->symlink_cbk) tmp_cbk = server_symlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->symlink"; _new->unwind_to = "server_symlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->symlink); bound_xl->fops->symlink (_new, bound_xl
, state->name, &state->loc, state->umask, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2101 bound_xl, bound_xl->fops->symlink,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2102
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->symlink_cbk) tmp_cbk = server_symlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->symlink"; _new->unwind_to = "server_symlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->symlink); bound_xl->fops->symlink (_new, bound_xl
, state->name, &state->loc, state->umask, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2102 state->name, &state->loc, state->umask, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2102
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->symlink_cbk) tmp_cbk = server_symlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->symlink"; _new->unwind_to = "server_symlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->symlink); bound_xl->fops->symlink (_new, bound_xl
, state->name, &state->loc, state->umask, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
;
2103
2104 return 0;
2105err:
2106 server_symlink_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2107 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0));
2108 return 0;
2109}
2110
2111
2112int
2113server_access_resume (call_frame_t *frame, xlator_t *bound_xl)
2114{
2115 server_state_t *state = NULL((void*)0);
2116
2117 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2118
2119 if (state->resolve.op_ret != 0)
2120 goto err;
2121
2122 STACK_WIND (frame, server_access_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2124
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->access_cbk) tmp_cbk = server_access_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->access"; _new->unwind_to = "server_access_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->access); bound_xl->fops->access (_new, bound_xl
, &state->loc, state->mask, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2123 bound_xl, bound_xl->fops->access,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2124
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->access_cbk) tmp_cbk = server_access_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->access"; _new->unwind_to = "server_access_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->access); bound_xl->fops->access (_new, bound_xl
, &state->loc, state->mask, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2124 &state->loc, state->mask, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2124
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->access_cbk) tmp_cbk = server_access_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->access"; _new->unwind_to = "server_access_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->access); bound_xl->fops->access (_new, bound_xl
, &state->loc, state->mask, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2125 return 0;
2126err:
2127 server_access_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2128 state->resolve.op_errno, NULL((void*)0));
2129 return 0;
2130}
2131
2132int
2133server_fentrylk_resume (call_frame_t *frame, xlator_t *bound_xl)
2134{
2135 server_state_t *state = NULL((void*)0);
2136
2137 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2138
2139 if (state->resolve.op_ret != 0)
2140 goto err;
2141
2142 STACK_WIND (frame, server_fentrylk_cbk, bound_xl,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2145
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fentrylk_cbk) tmp_cbk = server_fentrylk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fentrylk"; _new->unwind_to = "server_fentrylk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fentrylk); bound_xl->fops->fentrylk (_new
, bound_xl, state->volume, state->fd, state->name, state
->cmd, state->type, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2143 bound_xl->fops->fentrylk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2145
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fentrylk_cbk) tmp_cbk = server_fentrylk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fentrylk"; _new->unwind_to = "server_fentrylk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fentrylk); bound_xl->fops->fentrylk (_new
, bound_xl, state->volume, state->fd, state->name, state
->cmd, state->type, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2144 state->volume, state->fd, state->name,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2145
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fentrylk_cbk) tmp_cbk = server_fentrylk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fentrylk"; _new->unwind_to = "server_fentrylk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fentrylk); bound_xl->fops->fentrylk (_new
, bound_xl, state->volume, state->fd, state->name, state
->cmd, state->type, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2145 state->cmd, state->type, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2145
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fentrylk_cbk) tmp_cbk = server_fentrylk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fentrylk"; _new->unwind_to = "server_fentrylk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fentrylk); bound_xl->fops->fentrylk (_new
, bound_xl, state->volume, state->fd, state->name, state
->cmd, state->type, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2146
2147 return 0;
2148err:
2149 server_fentrylk_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2150 state->resolve.op_errno, NULL((void*)0));
2151 return 0;
2152}
2153
2154
2155int
2156server_entrylk_resume (call_frame_t *frame, xlator_t *bound_xl)
2157{
2158 server_state_t *state = NULL((void*)0);
2159
2160 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2161
2162 if (state->resolve.op_ret != 0)
2163 goto err;
2164
2165 STACK_WIND (frame, server_entrylk_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2168
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->entrylk_cbk) tmp_cbk = server_entrylk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->entrylk"; _new->unwind_to = "server_entrylk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->entrylk); bound_xl->fops->entrylk (_new, bound_xl
, state->volume, &state->loc, state->name, state
->cmd, state->type, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2166 bound_xl, bound_xl->fops->entrylk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2168
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->entrylk_cbk) tmp_cbk = server_entrylk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->entrylk"; _new->unwind_to = "server_entrylk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->entrylk); bound_xl->fops->entrylk (_new, bound_xl
, state->volume, &state->loc, state->name, state
->cmd, state->type, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2167 state->volume, &state->loc, state->name,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2168
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->entrylk_cbk) tmp_cbk = server_entrylk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->entrylk"; _new->unwind_to = "server_entrylk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->entrylk); bound_xl->fops->entrylk (_new, bound_xl
, state->volume, &state->loc, state->name, state
->cmd, state->type, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2168 state->cmd, state->type, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2168
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->entrylk_cbk) tmp_cbk = server_entrylk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->entrylk"; _new->unwind_to = "server_entrylk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->entrylk); bound_xl->fops->entrylk (_new, bound_xl
, state->volume, &state->loc, state->name, state
->cmd, state->type, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2169 return 0;
2170err:
2171 server_entrylk_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2172 state->resolve.op_errno, NULL((void*)0));
2173 return 0;
2174}
2175
2176
2177int
2178server_finodelk_resume (call_frame_t *frame, xlator_t *bound_xl)
2179{
2180 server_state_t *state = NULL((void*)0);
2181
2182 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2183
2184 if (state->resolve.op_ret != 0)
2185 goto err;
2186
2187 STACK_WIND (frame, server_finodelk_cbk, bound_xl,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2189
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->finodelk_cbk) tmp_cbk = server_finodelk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->finodelk"; _new->unwind_to = "server_finodelk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->finodelk); bound_xl->fops->finodelk (_new
, bound_xl, state->volume, state->fd, state->cmd, &
state->flock, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2188 bound_xl->fops->finodelk, state->volume, state->fd,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2189
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->finodelk_cbk) tmp_cbk = server_finodelk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->finodelk"; _new->unwind_to = "server_finodelk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->finodelk); bound_xl->fops->finodelk (_new
, bound_xl, state->volume, state->fd, state->cmd, &
state->flock, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2189 state->cmd, &state->flock, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2189
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->finodelk_cbk) tmp_cbk = server_finodelk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->finodelk"; _new->unwind_to = "server_finodelk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->finodelk); bound_xl->fops->finodelk (_new
, bound_xl, state->volume, state->fd, state->cmd, &
state->flock, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2190
2191 return 0;
2192err:
2193 server_finodelk_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2194 state->resolve.op_errno, NULL((void*)0));
2195
2196 return 0;
2197}
2198
2199int
2200server_inodelk_resume (call_frame_t *frame, xlator_t *bound_xl)
2201{
2202 server_state_t *state = NULL((void*)0);
2203
2204 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2205
2206 if (state->resolve.op_ret != 0)
2207 goto err;
2208
2209 STACK_WIND (frame, server_inodelk_cbk, bound_xl,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2211
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->inodelk_cbk) tmp_cbk = server_inodelk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->inodelk"; _new->unwind_to = "server_inodelk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->inodelk); bound_xl->fops->inodelk (_new, bound_xl
, state->volume, &state->loc, state->cmd, &state
->flock, state->xdata); (*__glusterfs_this_location()) =
old_THIS; } while (0)
2210 bound_xl->fops->inodelk, state->volume, &state->loc,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2211
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->inodelk_cbk) tmp_cbk = server_inodelk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->inodelk"; _new->unwind_to = "server_inodelk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->inodelk); bound_xl->fops->inodelk (_new, bound_xl
, state->volume, &state->loc, state->cmd, &state
->flock, state->xdata); (*__glusterfs_this_location()) =
old_THIS; } while (0)
2211 state->cmd, &state->flock, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2211
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->inodelk_cbk) tmp_cbk = server_inodelk_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->inodelk"; _new->unwind_to = "server_inodelk_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->inodelk); bound_xl->fops->inodelk (_new, bound_xl
, state->volume, &state->loc, state->cmd, &state
->flock, state->xdata); (*__glusterfs_this_location()) =
old_THIS; } while (0)
;
2212 return 0;
2213err:
2214 server_inodelk_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2215 state->resolve.op_errno, NULL((void*)0));
2216 return 0;
2217}
2218
2219int
2220server_rmdir_resume (call_frame_t *frame, xlator_t *bound_xl)
2221{
2222 server_state_t *state = NULL((void*)0);
2223
2224 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2225
2226 if (state->resolve.op_ret != 0)
2227 goto err;
2228
2229 STACK_WIND (frame, server_rmdir_cbk, bound_xl, bound_xl->fops->rmdir,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2230
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->rmdir_cbk) tmp_cbk = server_rmdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->rmdir"; _new->unwind_to = "server_rmdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->rmdir); bound_xl->fops->rmdir (_new, bound_xl
, &state->loc, state->flags, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2230 &state->loc, state->flags, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2230
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->rmdir_cbk) tmp_cbk = server_rmdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->rmdir"; _new->unwind_to = "server_rmdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->rmdir); bound_xl->fops->rmdir (_new, bound_xl
, &state->loc, state->flags, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2231 return 0;
2232err:
2233 server_rmdir_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2234 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2235 return 0;
2236}
2237
2238int
2239server_mkdir_resume (call_frame_t *frame, xlator_t *bound_xl)
2240
2241{
2242 server_state_t *state = NULL((void*)0);
2243
2244 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2245
2246 if (state->resolve.op_ret != 0)
2247 goto err;
2248
2249 state->loc.inode = inode_new (state->itable);
2250
2251 STACK_WIND (frame, server_mkdir_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2253
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->mkdir_cbk) tmp_cbk = server_mkdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->mkdir"; _new->unwind_to = "server_mkdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->mkdir); bound_xl->fops->mkdir (_new, bound_xl
, &(state->loc), state->mode, state->umask, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2252 bound_xl, bound_xl->fops->mkdir,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2253
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->mkdir_cbk) tmp_cbk = server_mkdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->mkdir"; _new->unwind_to = "server_mkdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->mkdir); bound_xl->fops->mkdir (_new, bound_xl
, &(state->loc), state->mode, state->umask, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2253 &(state->loc), state->mode, state->umask, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2253
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->mkdir_cbk) tmp_cbk = server_mkdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->mkdir"; _new->unwind_to = "server_mkdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->mkdir); bound_xl->fops->mkdir (_new, bound_xl
, &(state->loc), state->mode, state->umask, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
;
2254
2255 return 0;
2256err:
2257 server_mkdir_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2258 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0));
2259 return 0;
2260}
2261
2262
2263int
2264server_mknod_resume (call_frame_t *frame, xlator_t *bound_xl)
2265{
2266 server_state_t *state = NULL((void*)0);
2267
2268 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2269
2270 if (state->resolve.op_ret != 0)
2271 goto err;
2272
2273 state->loc.inode = inode_new (state->itable);
2274
2275 STACK_WIND (frame, server_mknod_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2278
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->mknod_cbk) tmp_cbk = server_mknod_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->mknod"; _new->unwind_to = "server_mknod_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->mknod); bound_xl->fops->mknod (_new, bound_xl
, &(state->loc), state->mode, state->dev, state->
umask, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2276 bound_xl, bound_xl->fops->mknod,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2278
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->mknod_cbk) tmp_cbk = server_mknod_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->mknod"; _new->unwind_to = "server_mknod_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->mknod); bound_xl->fops->mknod (_new, bound_xl
, &(state->loc), state->mode, state->dev, state->
umask, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2277 &(state->loc), state->mode, state->dev,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2278
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->mknod_cbk) tmp_cbk = server_mknod_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->mknod"; _new->unwind_to = "server_mknod_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->mknod); bound_xl->fops->mknod (_new, bound_xl
, &(state->loc), state->mode, state->dev, state->
umask, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2278 state->umask, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2278
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->mknod_cbk) tmp_cbk = server_mknod_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->mknod"; _new->unwind_to = "server_mknod_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->mknod); bound_xl->fops->mknod (_new, bound_xl
, &(state->loc), state->mode, state->dev, state->
umask, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
;
2279
2280 return 0;
2281err:
2282 server_mknod_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2283 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0));
2284 return 0;
2285}
2286
2287
2288int
2289server_fsyncdir_resume (call_frame_t *frame, xlator_t *bound_xl)
2290{
2291 server_state_t *state = NULL((void*)0);
2292
2293 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2294
2295 if (state->resolve.op_ret != 0)
2296 goto err;
2297
2298 STACK_WIND (frame, server_fsyncdir_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2301
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsyncdir_cbk) tmp_cbk = server_fsyncdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsyncdir"; _new->unwind_to = "server_fsyncdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsyncdir); bound_xl->fops->fsyncdir (_new
, bound_xl, state->fd, state->flags, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
2299 bound_xl,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2301
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsyncdir_cbk) tmp_cbk = server_fsyncdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsyncdir"; _new->unwind_to = "server_fsyncdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsyncdir); bound_xl->fops->fsyncdir (_new
, bound_xl, state->fd, state->flags, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
2300 bound_xl->fops->fsyncdir,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2301
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsyncdir_cbk) tmp_cbk = server_fsyncdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsyncdir"; _new->unwind_to = "server_fsyncdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsyncdir); bound_xl->fops->fsyncdir (_new
, bound_xl, state->fd, state->flags, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
2301 state->fd, state->flags, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2301
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsyncdir_cbk) tmp_cbk = server_fsyncdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsyncdir"; _new->unwind_to = "server_fsyncdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsyncdir); bound_xl->fops->fsyncdir (_new
, bound_xl, state->fd, state->flags, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
;
2302 return 0;
2303
2304err:
2305 server_fsyncdir_cbk (frame, NULL((void*)0), frame->this,
2306 state->resolve.op_ret,
2307 state->resolve.op_errno, NULL((void*)0));
2308 return 0;
2309}
2310
2311
2312int
2313server_readdir_resume (call_frame_t *frame, xlator_t *bound_xl)
2314{
2315 server_state_t *state = NULL((void*)0);
2316
2317 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2318
2319 if (state->resolve.op_ret != 0)
2320 goto err;
2321
2322 GF_ASSERT (state->fd)do { if (!(state->fd)) { do { do { if (0) printf ("Assertion failed: "
"state->fd"); } while (0); _gf_log_callingfn ("", "server-rpc-fops.c"
, __FUNCTION__, 2322, GF_LOG_ERROR, "Assertion failed: " "state->fd"
); } while (0); } } while (0)
;
2323
2324 STACK_WIND (frame, server_readdir_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2327
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readdir_cbk) tmp_cbk = server_readdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readdir"; _new->unwind_to = "server_readdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readdir); bound_xl->fops->readdir (_new, bound_xl
, state->fd, state->size, state->offset, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2325 bound_xl,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2327
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readdir_cbk) tmp_cbk = server_readdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readdir"; _new->unwind_to = "server_readdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readdir); bound_xl->fops->readdir (_new, bound_xl
, state->fd, state->size, state->offset, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2326 bound_xl->fops->readdir,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2327
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readdir_cbk) tmp_cbk = server_readdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readdir"; _new->unwind_to = "server_readdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readdir); bound_xl->fops->readdir (_new, bound_xl
, state->fd, state->size, state->offset, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2327 state->fd, state->size, state->offset, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2327
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readdir_cbk) tmp_cbk = server_readdir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readdir"; _new->unwind_to = "server_readdir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readdir); bound_xl->fops->readdir (_new, bound_xl
, state->fd, state->size, state->offset, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
;
2328
2329 return 0;
2330err:
2331 server_readdir_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2332 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2333 return 0;
2334}
2335
2336int
2337server_readdirp_resume (call_frame_t *frame, xlator_t *bound_xl)
2338{
2339 server_state_t *state = NULL((void*)0);
2340
2341 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2342
2343 if (state->resolve.op_ret != 0)
2344 goto err;
2345
2346 STACK_WIND (frame, server_readdirp_cbk, bound_xl,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2348
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readdirp_cbk) tmp_cbk = server_readdirp_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readdirp"; _new->unwind_to = "server_readdirp_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readdirp); bound_xl->fops->readdirp (_new
, bound_xl, state->fd, state->size, state->offset, state
->dict); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2347 bound_xl->fops->readdirp, state->fd, state->size,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2348
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readdirp_cbk) tmp_cbk = server_readdirp_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readdirp"; _new->unwind_to = "server_readdirp_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readdirp); bound_xl->fops->readdirp (_new
, bound_xl, state->fd, state->size, state->offset, state
->dict); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2348 state->offset, state->dict)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2348
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readdirp_cbk) tmp_cbk = server_readdirp_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readdirp"; _new->unwind_to = "server_readdirp_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readdirp); bound_xl->fops->readdirp (_new
, bound_xl, state->fd, state->size, state->offset, state
->dict); (*__glusterfs_this_location()) = old_THIS; } while
(0)
;
2349
2350 return 0;
2351err:
2352 server_readdirp_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2353 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2354 return 0;
2355}
2356
2357
2358int
2359server_opendir_resume (call_frame_t *frame, xlator_t *bound_xl)
2360{
2361 server_state_t *state = NULL((void*)0);
2362
2363 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2364
2365 if (state->resolve.op_ret != 0)
2366 goto err;
2367
2368 state->fd = fd_create (state->loc.inode, frame->root->pid);
2369 if (!state->fd) {
2370 gf_log ("server", GF_LOG_ERROR, "could not create the fd")do { do { if (0) printf ("could not create the fd"); } while (
0); _gf_log ("server", "server-rpc-fops.c", __FUNCTION__, 2370
, GF_LOG_ERROR, "could not create the fd"); } while (0)
;
2371 goto err;
2372 }
2373
2374 STACK_WIND (frame, server_opendir_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2376
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->opendir_cbk) tmp_cbk = server_opendir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->opendir"; _new->unwind_to = "server_opendir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->opendir); bound_xl->fops->opendir (_new, bound_xl
, &state->loc, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2375 bound_xl, bound_xl->fops->opendir,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2376
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->opendir_cbk) tmp_cbk = server_opendir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->opendir"; _new->unwind_to = "server_opendir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->opendir); bound_xl->fops->opendir (_new, bound_xl
, &state->loc, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2376 &state->loc, state->fd, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2376
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->opendir_cbk) tmp_cbk = server_opendir_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->opendir"; _new->unwind_to = "server_opendir_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->opendir); bound_xl->fops->opendir (_new, bound_xl
, &state->loc, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2377 return 0;
2378err:
2379 server_opendir_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2380 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2381 return 0;
2382}
2383
2384
2385int
2386server_statfs_resume (call_frame_t *frame, xlator_t *bound_xl)
2387{
2388 server_state_t *state = NULL((void*)0);
2389
2390 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2391
2392 if (state->resolve.op_ret !=0)
2393 goto err;
2394
2395 STACK_WIND (frame, server_statfs_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2397
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->statfs_cbk) tmp_cbk = server_statfs_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->statfs"; _new->unwind_to = "server_statfs_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->statfs); bound_xl->fops->statfs (_new, bound_xl
, &state->loc, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2396 bound_xl, bound_xl->fops->statfs,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2397
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->statfs_cbk) tmp_cbk = server_statfs_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->statfs"; _new->unwind_to = "server_statfs_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->statfs); bound_xl->fops->statfs (_new, bound_xl
, &state->loc, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2397 &state->loc, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2397
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->statfs_cbk) tmp_cbk = server_statfs_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->statfs"; _new->unwind_to = "server_statfs_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->statfs); bound_xl->fops->statfs (_new, bound_xl
, &state->loc, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2398 return 0;
2399
2400err:
2401 server_statfs_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2402 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2403 return 0;
2404}
2405
2406
2407int
2408server_removexattr_resume (call_frame_t *frame, xlator_t *bound_xl)
2409{
2410 server_state_t *state = NULL((void*)0);
2411
2412 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2413
2414 if (state->resolve.op_ret != 0)
2415 goto err;
2416
2417 STACK_WIND (frame, server_removexattr_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2419
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->removexattr_cbk) tmp_cbk = server_removexattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->removexattr"; _new->unwind_to = "server_removexattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->removexattr); bound_xl->fops->removexattr
(_new, bound_xl, &state->loc, state->name, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2418 bound_xl, bound_xl->fops->removexattr,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2419
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->removexattr_cbk) tmp_cbk = server_removexattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->removexattr"; _new->unwind_to = "server_removexattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->removexattr); bound_xl->fops->removexattr
(_new, bound_xl, &state->loc, state->name, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2419 &state->loc, state->name, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2419
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->removexattr_cbk) tmp_cbk = server_removexattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->removexattr"; _new->unwind_to = "server_removexattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->removexattr); bound_xl->fops->removexattr
(_new, bound_xl, &state->loc, state->name, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
;
2420 return 0;
2421err:
2422 server_removexattr_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2423 state->resolve.op_errno, NULL((void*)0));
2424 return 0;
2425}
2426
2427int
2428server_fremovexattr_resume (call_frame_t *frame, xlator_t *bound_xl)
2429{
2430 server_state_t *state = NULL((void*)0);
2431
2432 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2433
2434 if (state->resolve.op_ret != 0)
2435 goto err;
2436
2437 STACK_WIND (frame, server_fremovexattr_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2439
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fremovexattr_cbk) tmp_cbk = server_fremovexattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fremovexattr"; _new->unwind_to =
"server_fremovexattr_cbk"; pthread_spin_init (&_new->
lock, 0); pthread_spin_lock (&frame->root->stack_lock
); { _new->next = frame->root->frames.next; _new->
prev = &frame->root->frames; if (frame->root->
frames.next) frame->root->frames.next->prev = _new; frame
->root->frames.next = _new; frame->ref_count++; } pthread_spin_unlock
(&frame->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fremovexattr); bound_xl->fops->fremovexattr
(_new, bound_xl, state->fd, state->name, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2438 bound_xl, bound_xl->fops->fremovexattr,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2439
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fremovexattr_cbk) tmp_cbk = server_fremovexattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fremovexattr"; _new->unwind_to =
"server_fremovexattr_cbk"; pthread_spin_init (&_new->
lock, 0); pthread_spin_lock (&frame->root->stack_lock
); { _new->next = frame->root->frames.next; _new->
prev = &frame->root->frames; if (frame->root->
frames.next) frame->root->frames.next->prev = _new; frame
->root->frames.next = _new; frame->ref_count++; } pthread_spin_unlock
(&frame->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fremovexattr); bound_xl->fops->fremovexattr
(_new, bound_xl, state->fd, state->name, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2439 state->fd, state->name, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2439
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fremovexattr_cbk) tmp_cbk = server_fremovexattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fremovexattr"; _new->unwind_to =
"server_fremovexattr_cbk"; pthread_spin_init (&_new->
lock, 0); pthread_spin_lock (&frame->root->stack_lock
); { _new->next = frame->root->frames.next; _new->
prev = &frame->root->frames; if (frame->root->
frames.next) frame->root->frames.next->prev = _new; frame
->root->frames.next = _new; frame->ref_count++; } pthread_spin_unlock
(&frame->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fremovexattr); bound_xl->fops->fremovexattr
(_new, bound_xl, state->fd, state->name, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
;
2440 return 0;
2441err:
2442 server_fremovexattr_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2443 state->resolve.op_errno, NULL((void*)0));
2444 return 0;
2445}
2446
2447int
2448server_fgetxattr_resume (call_frame_t *frame, xlator_t *bound_xl)
2449{
2450 server_state_t *state = NULL((void*)0);
2451
2452 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2453
2454 if (state->resolve.op_ret != 0)
2455 goto err;
2456
2457 STACK_WIND (frame, server_fgetxattr_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2459
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fgetxattr_cbk) tmp_cbk = server_fgetxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fgetxattr"; _new->unwind_to = "server_fgetxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fgetxattr); bound_xl->fops->fgetxattr (_new
, bound_xl, state->fd, state->name, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
2458 bound_xl, bound_xl->fops->fgetxattr,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2459
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fgetxattr_cbk) tmp_cbk = server_fgetxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fgetxattr"; _new->unwind_to = "server_fgetxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fgetxattr); bound_xl->fops->fgetxattr (_new
, bound_xl, state->fd, state->name, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
2459 state->fd, state->name, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2459
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fgetxattr_cbk) tmp_cbk = server_fgetxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fgetxattr"; _new->unwind_to = "server_fgetxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fgetxattr); bound_xl->fops->fgetxattr (_new
, bound_xl, state->fd, state->name, state->xdata); (
*__glusterfs_this_location()) = old_THIS; } while (0)
;
2460 return 0;
2461err:
2462 server_fgetxattr_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2463 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2464 return 0;
2465}
2466
2467
2468int
2469server_xattrop_resume (call_frame_t *frame, xlator_t *bound_xl)
2470{
2471 server_state_t *state = NULL((void*)0);
2472
2473 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2474
2475 if (state->resolve.op_ret != 0)
2476 goto err;
2477
2478 STACK_WIND (frame, server_xattrop_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2480
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->xattrop_cbk) tmp_cbk = server_xattrop_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->xattrop"; _new->unwind_to = "server_xattrop_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->xattrop); bound_xl->fops->xattrop (_new, bound_xl
, &state->loc, state->flags, state->dict, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2479 bound_xl, bound_xl->fops->xattrop,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2480
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->xattrop_cbk) tmp_cbk = server_xattrop_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->xattrop"; _new->unwind_to = "server_xattrop_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->xattrop); bound_xl->fops->xattrop (_new, bound_xl
, &state->loc, state->flags, state->dict, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2480 &state->loc, state->flags, state->dict, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2480
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->xattrop_cbk) tmp_cbk = server_xattrop_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->xattrop"; _new->unwind_to = "server_xattrop_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->xattrop); bound_xl->fops->xattrop (_new, bound_xl
, &state->loc, state->flags, state->dict, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
;
2481 return 0;
2482err:
2483 server_xattrop_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2484 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2485 return 0;
2486}
2487
2488int
2489server_fxattrop_resume (call_frame_t *frame, xlator_t *bound_xl)
2490{
2491 server_state_t *state = NULL((void*)0);
2492
2493 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2494
2495 if (state->resolve.op_ret != 0)
2496 goto err;
2497
2498 STACK_WIND (frame, server_fxattrop_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2500
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fxattrop_cbk) tmp_cbk = server_fxattrop_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fxattrop"; _new->unwind_to = "server_fxattrop_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fxattrop); bound_xl->fops->fxattrop (_new
, bound_xl, state->fd, state->flags, state->dict, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2499 bound_xl, bound_xl->fops->fxattrop,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2500
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fxattrop_cbk) tmp_cbk = server_fxattrop_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fxattrop"; _new->unwind_to = "server_fxattrop_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fxattrop); bound_xl->fops->fxattrop (_new
, bound_xl, state->fd, state->flags, state->dict, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2500 state->fd, state->flags, state->dict, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2500
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fxattrop_cbk) tmp_cbk = server_fxattrop_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fxattrop"; _new->unwind_to = "server_fxattrop_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fxattrop); bound_xl->fops->fxattrop (_new
, bound_xl, state->fd, state->flags, state->dict, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
;
2501 return 0;
2502err:
2503 server_fxattrop_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2504 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2505 return 0;
2506}
2507
2508int
2509server_fsetxattr_resume (call_frame_t *frame, xlator_t *bound_xl)
2510{
2511 server_state_t *state = NULL((void*)0);
2512
2513 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2514
2515 if (state->resolve.op_ret != 0)
2516 goto err;
2517
2518 STACK_WIND (frame, server_setxattr_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2520
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsetxattr_cbk) tmp_cbk = server_setxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsetxattr"; _new->unwind_to = "server_setxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsetxattr); bound_xl->fops->fsetxattr (_new
, bound_xl, state->fd, state->dict, state->flags, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2519 bound_xl, bound_xl->fops->fsetxattr,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2520
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsetxattr_cbk) tmp_cbk = server_setxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsetxattr"; _new->unwind_to = "server_setxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsetxattr); bound_xl->fops->fsetxattr (_new
, bound_xl, state->fd, state->dict, state->flags, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2520 state->fd, state->dict, state->flags, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2520
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsetxattr_cbk) tmp_cbk = server_setxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsetxattr"; _new->unwind_to = "server_setxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsetxattr); bound_xl->fops->fsetxattr (_new
, bound_xl, state->fd, state->dict, state->flags, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
;
2521 return 0;
2522err:
2523 server_fsetxattr_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2524 state->resolve.op_errno, NULL((void*)0));
2525
2526 return 0;
2527}
2528
2529int
2530server_unlink_resume (call_frame_t *frame, xlator_t *bound_xl)
2531{
2532 server_state_t *state = NULL((void*)0);
2533
2534 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2535
2536 if (state->resolve.op_ret != 0)
2537 goto err;
2538
2539 STACK_WIND (frame, server_unlink_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2541
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->unlink_cbk) tmp_cbk = server_unlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->unlink"; _new->unwind_to = "server_unlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->unlink); bound_xl->fops->unlink (_new, bound_xl
, &state->loc, state->flags, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2540 bound_xl, bound_xl->fops->unlink,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2541
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->unlink_cbk) tmp_cbk = server_unlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->unlink"; _new->unwind_to = "server_unlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->unlink); bound_xl->fops->unlink (_new, bound_xl
, &state->loc, state->flags, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2541 &state->loc, state->flags, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2541
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->unlink_cbk) tmp_cbk = server_unlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->unlink"; _new->unwind_to = "server_unlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->unlink); bound_xl->fops->unlink (_new, bound_xl
, &state->loc, state->flags, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2542 return 0;
2543err:
2544 server_unlink_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2545 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2546 return 0;
2547}
2548
2549int
2550server_truncate_resume (call_frame_t *frame, xlator_t *bound_xl)
2551{
2552 server_state_t *state = NULL((void*)0);
2553
2554 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2555
2556 if (state->resolve.op_ret != 0)
2557 goto err;
2558
2559 STACK_WIND (frame, server_truncate_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2561
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->truncate_cbk) tmp_cbk = server_truncate_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->truncate"; _new->unwind_to = "server_truncate_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->truncate); bound_xl->fops->truncate (_new
, bound_xl, &state->loc, state->offset, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2560 bound_xl, bound_xl->fops->truncate,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2561
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->truncate_cbk) tmp_cbk = server_truncate_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->truncate"; _new->unwind_to = "server_truncate_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->truncate); bound_xl->fops->truncate (_new
, bound_xl, &state->loc, state->offset, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2561 &state->loc, state->offset, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2561
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->truncate_cbk) tmp_cbk = server_truncate_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->truncate"; _new->unwind_to = "server_truncate_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->truncate); bound_xl->fops->truncate (_new
, bound_xl, &state->loc, state->offset, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
;
2562 return 0;
2563err:
2564 server_truncate_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2565 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2566 return 0;
2567}
2568
2569
2570
2571int
2572server_fstat_resume (call_frame_t *frame, xlator_t *bound_xl)
2573{
2574 server_state_t *state = NULL((void*)0);
2575
2576 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2577
2578 if (state->resolve.op_ret != 0)
2579 goto err;
2580
2581 STACK_WIND (frame, server_fstat_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2583
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fstat_cbk) tmp_cbk = server_fstat_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fstat"; _new->unwind_to = "server_fstat_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fstat); bound_xl->fops->fstat (_new, bound_xl
, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2582 bound_xl, bound_xl->fops->fstat,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2583
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fstat_cbk) tmp_cbk = server_fstat_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fstat"; _new->unwind_to = "server_fstat_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fstat); bound_xl->fops->fstat (_new, bound_xl
, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2583 state->fd, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2583
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fstat_cbk) tmp_cbk = server_fstat_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fstat"; _new->unwind_to = "server_fstat_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fstat); bound_xl->fops->fstat (_new, bound_xl
, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2584 return 0;
2585err:
2586 server_fstat_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2587 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2588 return 0;
2589}
2590
2591
2592int
2593server_setxattr_resume (call_frame_t *frame, xlator_t *bound_xl)
2594{
2595 server_state_t *state = NULL((void*)0);
2596
2597 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2598
2599 if (state->resolve.op_ret != 0)
2600 goto err;
2601
2602 STACK_WIND (frame, server_setxattr_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2604
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->setxattr_cbk) tmp_cbk = server_setxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->setxattr"; _new->unwind_to = "server_setxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->setxattr); bound_xl->fops->setxattr (_new
, bound_xl, &state->loc, state->dict, state->flags
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2603 bound_xl, bound_xl->fops->setxattr,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2604
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->setxattr_cbk) tmp_cbk = server_setxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->setxattr"; _new->unwind_to = "server_setxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->setxattr); bound_xl->fops->setxattr (_new
, bound_xl, &state->loc, state->dict, state->flags
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2604 &state->loc, state->dict, state->flags, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2604
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->setxattr_cbk) tmp_cbk = server_setxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->setxattr"; _new->unwind_to = "server_setxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->setxattr); bound_xl->fops->setxattr (_new
, bound_xl, &state->loc, state->dict, state->flags
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
;
2605 return 0;
2606err:
2607 server_setxattr_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2608 state->resolve.op_errno, NULL((void*)0));
2609
2610 return 0;
2611}
2612
2613
2614int
2615server_getxattr_resume (call_frame_t *frame, xlator_t *bound_xl)
2616{
2617 server_state_t *state = NULL((void*)0);
2618
2619 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2620
2621 if (state->resolve.op_ret != 0)
2622 goto err;
2623
2624 STACK_WIND (frame, server_getxattr_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2626
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->getxattr_cbk) tmp_cbk = server_getxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->getxattr"; _new->unwind_to = "server_getxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->getxattr); bound_xl->fops->getxattr (_new
, bound_xl, &state->loc, state->name, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2625 bound_xl, bound_xl->fops->getxattr,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2626
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->getxattr_cbk) tmp_cbk = server_getxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->getxattr"; _new->unwind_to = "server_getxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->getxattr); bound_xl->fops->getxattr (_new
, bound_xl, &state->loc, state->name, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2626 &state->loc, state->name, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2626
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->getxattr_cbk) tmp_cbk = server_getxattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->getxattr"; _new->unwind_to = "server_getxattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->getxattr); bound_xl->fops->getxattr (_new
, bound_xl, &state->loc, state->name, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
;
2627 return 0;
2628err:
2629 server_getxattr_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2630 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2631 return 0;
2632}
2633
2634
2635int
2636server_ftruncate_resume (call_frame_t *frame, xlator_t *bound_xl)
2637{
2638 server_state_t *state = NULL((void*)0);
2639
2640 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2641
2642 if (state->resolve.op_ret != 0)
2643 goto err;
2644
2645 STACK_WIND (frame, server_ftruncate_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2647
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->ftruncate_cbk) tmp_cbk = server_ftruncate_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->ftruncate"; _new->unwind_to = "server_ftruncate_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->ftruncate); bound_xl->fops->ftruncate (_new
, bound_xl, state->fd, state->offset, state->xdata);
(*__glusterfs_this_location()) = old_THIS; } while (0)
2646 bound_xl, bound_xl->fops->ftruncate,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2647
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->ftruncate_cbk) tmp_cbk = server_ftruncate_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->ftruncate"; _new->unwind_to = "server_ftruncate_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->ftruncate); bound_xl->fops->ftruncate (_new
, bound_xl, state->fd, state->offset, state->xdata);
(*__glusterfs_this_location()) = old_THIS; } while (0)
2647 state->fd, state->offset, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2647
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->ftruncate_cbk) tmp_cbk = server_ftruncate_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->ftruncate"; _new->unwind_to = "server_ftruncate_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->ftruncate); bound_xl->fops->ftruncate (_new
, bound_xl, state->fd, state->offset, state->xdata);
(*__glusterfs_this_location()) = old_THIS; } while (0)
;
2648 return 0;
2649err:
2650 server_ftruncate_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2651 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2652
2653 return 0;
2654}
2655
2656
2657int
2658server_flush_resume (call_frame_t *frame, xlator_t *bound_xl)
2659{
2660 server_state_t *state = NULL((void*)0);
2661
2662 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2663
2664 if (state->resolve.op_ret != 0)
2665 goto err;
2666
2667 STACK_WIND (frame, server_flush_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2668
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->flush_cbk) tmp_cbk = server_flush_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->flush"; _new->unwind_to = "server_flush_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->flush); bound_xl->fops->flush (_new, bound_xl
, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2668 bound_xl, bound_xl->fops->flush, state->fd, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2668
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->flush_cbk) tmp_cbk = server_flush_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->flush"; _new->unwind_to = "server_flush_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->flush); bound_xl->fops->flush (_new, bound_xl
, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2669 return 0;
2670err:
2671 server_flush_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2672 state->resolve.op_errno, NULL((void*)0));
2673
2674 return 0;
2675}
2676
2677
2678int
2679server_fsync_resume (call_frame_t *frame, xlator_t *bound_xl)
2680{
2681 server_state_t *state = NULL((void*)0);
2682
2683 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2684
2685 if (state->resolve.op_ret != 0)
2686 goto err;
2687
2688 STACK_WIND (frame, server_fsync_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2690
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsync_cbk) tmp_cbk = server_fsync_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsync"; _new->unwind_to = "server_fsync_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsync); bound_xl->fops->fsync (_new, bound_xl
, state->fd, state->flags, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2689 bound_xl, bound_xl->fops->fsync,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2690
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsync_cbk) tmp_cbk = server_fsync_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsync"; _new->unwind_to = "server_fsync_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsync); bound_xl->fops->fsync (_new, bound_xl
, state->fd, state->flags, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2690 state->fd, state->flags, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2690
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsync_cbk) tmp_cbk = server_fsync_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsync"; _new->unwind_to = "server_fsync_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsync); bound_xl->fops->fsync (_new, bound_xl
, state->fd, state->flags, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2691 return 0;
2692err:
2693 server_fsync_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2694 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2695
2696 return 0;
2697}
2698
2699int
2700server_writev_resume (call_frame_t *frame, xlator_t *bound_xl)
2701{
2702 server_state_t *state = NULL((void*)0);
2703
2704 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2705
2706 if (state->resolve.op_ret != 0)
2707 goto err;
2708
2709 STACK_WIND (frame, server_writev_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2712
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->writev_cbk) tmp_cbk = server_writev_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->writev"; _new->unwind_to = "server_writev_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->writev); bound_xl->fops->writev (_new, bound_xl
, state->fd, state->payload_vector, state->payload_count
, state->offset, state->flags, state->iobref, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2710 bound_xl, bound_xl->fops->writev,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2712
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->writev_cbk) tmp_cbk = server_writev_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->writev"; _new->unwind_to = "server_writev_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->writev); bound_xl->fops->writev (_new, bound_xl
, state->fd, state->payload_vector, state->payload_count
, state->offset, state->flags, state->iobref, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2711 state->fd, state->payload_vector, state->payload_count,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2712
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->writev_cbk) tmp_cbk = server_writev_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->writev"; _new->unwind_to = "server_writev_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->writev); bound_xl->fops->writev (_new, bound_xl
, state->fd, state->payload_vector, state->payload_count
, state->offset, state->flags, state->iobref, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2712 state->offset, state->flags, state->iobref, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2712
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->writev_cbk) tmp_cbk = server_writev_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->writev"; _new->unwind_to = "server_writev_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->writev); bound_xl->fops->writev (_new, bound_xl
, state->fd, state->payload_vector, state->payload_count
, state->offset, state->flags, state->iobref, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
;
2713
2714 return 0;
2715err:
2716 server_writev_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2717 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2718 return 0;
2719}
2720
2721
2722int
2723server_readv_resume (call_frame_t *frame, xlator_t *bound_xl)
2724{
2725 server_state_t *state = NULL((void*)0);
2726
2727 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2728
2729 if (state->resolve.op_ret != 0)
2730 goto err;
2731
2732 STACK_WIND (frame, server_readv_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2734
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readv_cbk) tmp_cbk = server_readv_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readv"; _new->unwind_to = "server_readv_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readv); bound_xl->fops->readv (_new, bound_xl
, state->fd, state->size, state->offset, state->flags
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2733 bound_xl, bound_xl->fops->readv,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2734
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readv_cbk) tmp_cbk = server_readv_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readv"; _new->unwind_to = "server_readv_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readv); bound_xl->fops->readv (_new, bound_xl
, state->fd, state->size, state->offset, state->flags
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2734 state->fd, state->size, state->offset, state->flags, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2734
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readv_cbk) tmp_cbk = server_readv_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readv"; _new->unwind_to = "server_readv_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readv); bound_xl->fops->readv (_new, bound_xl
, state->fd, state->size, state->offset, state->flags
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
;
2735
2736 return 0;
2737err:
2738 server_readv_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2739 state->resolve.op_errno, NULL((void*)0), 0, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2740 return 0;
2741}
2742
2743
2744int
2745server_create_resume (call_frame_t *frame, xlator_t *bound_xl)
2746{
2747 server_state_t *state = NULL((void*)0);
2748
2749 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2750
2751 if (state->resolve.op_ret != 0)
2752 goto err;
2753
2754 state->loc.inode = inode_new (state->itable);
2755
2756 state->fd = fd_create (state->loc.inode, frame->root->pid);
2757 if (!state->fd) {
2758 gf_log ("server", GF_LOG_ERROR, "fd creation for the inode %s "do { do { if (0) printf ("fd creation for the inode %s " "failed"
, state->loc.inode? uuid_utoa (state->loc.inode->gfid
):((void*)0)); } while (0); _gf_log ("server", "server-rpc-fops.c"
, __FUNCTION__, 2760, GF_LOG_ERROR, "fd creation for the inode %s "
"failed", state->loc.inode? uuid_utoa (state->loc.inode
->gfid):((void*)0)); } while (0)
2759 "failed", state->loc.inode?do { do { if (0) printf ("fd creation for the inode %s " "failed"
, state->loc.inode? uuid_utoa (state->loc.inode->gfid
):((void*)0)); } while (0); _gf_log ("server", "server-rpc-fops.c"
, __FUNCTION__, 2760, GF_LOG_ERROR, "fd creation for the inode %s "
"failed", state->loc.inode? uuid_utoa (state->loc.inode
->gfid):((void*)0)); } while (0)
2760 uuid_utoa (state->loc.inode->gfid):NULL)do { do { if (0) printf ("fd creation for the inode %s " "failed"
, state->loc.inode? uuid_utoa (state->loc.inode->gfid
):((void*)0)); } while (0); _gf_log ("server", "server-rpc-fops.c"
, __FUNCTION__, 2760, GF_LOG_ERROR, "fd creation for the inode %s "
"failed", state->loc.inode? uuid_utoa (state->loc.inode
->gfid):((void*)0)); } while (0)
;
2761 state->resolve.op_ret = -1;
2762 state->resolve.op_errno = ENOMEM12;
2763 goto err;
2764 }
2765 state->fd->flags = state->flags;
2766
2767 STACK_WIND (frame, server_create_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2770
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->create_cbk) tmp_cbk = server_create_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->create"; _new->unwind_to = "server_create_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->create); bound_xl->fops->create (_new, bound_xl
, &(state->loc), state->flags, state->mode, state
->umask, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2768 bound_xl, bound_xl->fops->create,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2770
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->create_cbk) tmp_cbk = server_create_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->create"; _new->unwind_to = "server_create_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->create); bound_xl->fops->create (_new, bound_xl
, &(state->loc), state->flags, state->mode, state
->umask, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2769 &(state->loc), state->flags, state->mode,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2770
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->create_cbk) tmp_cbk = server_create_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->create"; _new->unwind_to = "server_create_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->create); bound_xl->fops->create (_new, bound_xl
, &(state->loc), state->flags, state->mode, state
->umask, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2770 state->umask, state->fd, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2770
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->create_cbk) tmp_cbk = server_create_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->create"; _new->unwind_to = "server_create_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->create); bound_xl->fops->create (_new, bound_xl
, &(state->loc), state->flags, state->mode, state
->umask, state->fd, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2771
2772 return 0;
2773err:
2774 server_create_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2775 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0),
2776 NULL((void*)0), NULL((void*)0), NULL((void*)0));
2777 return 0;
2778}
2779
2780
2781int
2782server_open_resume (call_frame_t *frame, xlator_t *bound_xl)
2783{
2784 server_state_t *state = NULL((void*)0);
2785
2786 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2787
2788 if (state->resolve.op_ret != 0)
2789 goto err;
2790
2791 state->fd = fd_create (state->loc.inode, frame->root->pid);
2792 state->fd->flags = state->flags;
2793
2794 STACK_WIND (frame, server_open_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2796
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->open_cbk) tmp_cbk = server_open_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->open"; _new->unwind_to = "server_open_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->open); bound_xl->fops->open (_new, bound_xl
, &state->loc, state->flags, state->fd, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2795 bound_xl, bound_xl->fops->open,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2796
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->open_cbk) tmp_cbk = server_open_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->open"; _new->unwind_to = "server_open_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->open); bound_xl->fops->open (_new, bound_xl
, &state->loc, state->flags, state->fd, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
2796 &state->loc, state->flags, state->fd, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2796
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->open_cbk) tmp_cbk = server_open_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->open"; _new->unwind_to = "server_open_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->open); bound_xl->fops->open (_new, bound_xl
, &state->loc, state->flags, state->fd, state->
xdata); (*__glusterfs_this_location()) = old_THIS; } while (0
)
;
2797
2798 return 0;
2799err:
2800 server_open_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2801 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2802 return 0;
2803}
2804
2805
2806int
2807server_readlink_resume (call_frame_t *frame, xlator_t *bound_xl)
2808{
2809 server_state_t *state = NULL((void*)0);
2810
2811 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2812
2813 if (state->resolve.op_ret != 0)
2814 goto err;
2815
2816 STACK_WIND (frame, server_readlink_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2818
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readlink_cbk) tmp_cbk = server_readlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readlink"; _new->unwind_to = "server_readlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readlink); bound_xl->fops->readlink (_new
, bound_xl, &state->loc, state->size, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2817 bound_xl, bound_xl->fops->readlink,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2818
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readlink_cbk) tmp_cbk = server_readlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readlink"; _new->unwind_to = "server_readlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readlink); bound_xl->fops->readlink (_new
, bound_xl, &state->loc, state->size, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
2818 &state->loc, state->size, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2818
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->readlink_cbk) tmp_cbk = server_readlink_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->readlink"; _new->unwind_to = "server_readlink_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->readlink); bound_xl->fops->readlink (_new
, bound_xl, &state->loc, state->size, state->xdata
); (*__glusterfs_this_location()) = old_THIS; } while (0)
;
2819 return 0;
2820err:
2821 server_readlink_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2822 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2823 return 0;
2824}
2825
2826
2827int
2828server_fsetattr_resume (call_frame_t *frame, xlator_t *bound_xl)
2829{
2830 server_state_t *state = NULL((void*)0);
2831
2832 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2833
2834 if (state->resolve.op_ret != 0)
2835 goto err;
2836
2837 STACK_WIND (frame, server_fsetattr_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2839
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsetattr_cbk) tmp_cbk = server_fsetattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsetattr"; _new->unwind_to = "server_fsetattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsetattr); bound_xl->fops->fsetattr (_new
, bound_xl, state->fd, &state->stbuf, state->valid
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2838 bound_xl, bound_xl->fops->fsetattr,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2839
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsetattr_cbk) tmp_cbk = server_fsetattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsetattr"; _new->unwind_to = "server_fsetattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsetattr); bound_xl->fops->fsetattr (_new
, bound_xl, state->fd, &state->stbuf, state->valid
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
2839 state->fd, &state->stbuf, state->valid, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2839
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->fsetattr_cbk) tmp_cbk = server_fsetattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->fsetattr"; _new->unwind_to = "server_fsetattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->fsetattr); bound_xl->fops->fsetattr (_new
, bound_xl, state->fd, &state->stbuf, state->valid
, state->xdata); (*__glusterfs_this_location()) = old_THIS
; } while (0)
;
2840 return 0;
2841err:
2842 server_fsetattr_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2843 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2844
2845 return 0;
2846}
2847
2848
2849int
2850server_setattr_resume (call_frame_t *frame, xlator_t *bound_xl)
2851{
2852 server_state_t *state = NULL((void*)0);
2853
2854 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2855
2856 if (state->resolve.op_ret != 0)
2857 goto err;
2858
2859 STACK_WIND (frame, server_setattr_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2861
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->setattr_cbk) tmp_cbk = server_setattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->setattr"; _new->unwind_to = "server_setattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->setattr); bound_xl->fops->setattr (_new, bound_xl
, &state->loc, &state->stbuf, state->valid, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2860 bound_xl, bound_xl->fops->setattr,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2861
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->setattr_cbk) tmp_cbk = server_setattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->setattr"; _new->unwind_to = "server_setattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->setattr); bound_xl->fops->setattr (_new, bound_xl
, &state->loc, &state->stbuf, state->valid, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
2861 &state->loc, &state->stbuf, state->valid, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2861
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->setattr_cbk) tmp_cbk = server_setattr_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->setattr"; _new->unwind_to = "server_setattr_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->setattr); bound_xl->fops->setattr (_new, bound_xl
, &state->loc, &state->stbuf, state->valid, state
->xdata); (*__glusterfs_this_location()) = old_THIS; } while
(0)
;
2862 return 0;
2863err:
2864 server_setattr_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2865 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0));
2866
2867 return 0;
2868}
2869
2870
2871int
2872server_stat_resume (call_frame_t *frame, xlator_t *bound_xl)
2873{
2874 server_state_t *state = NULL((void*)0);
2875
2876 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2877
2878 if (state->resolve.op_ret != 0)
2879 goto err;
2880
2881 STACK_WIND (frame, server_stat_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2882
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->stat_cbk) tmp_cbk = server_stat_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->stat"; _new->unwind_to = "server_stat_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->stat); bound_xl->fops->stat (_new, bound_xl
, &state->loc, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2882 bound_xl, bound_xl->fops->stat, &state->loc, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2882
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->stat_cbk) tmp_cbk = server_stat_cbk; _new
->root = frame->root; _new->this = bound_xl; _new->
ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->cookie
= _new; _new->wind_from = __FUNCTION__; _new->wind_to =
"bound_xl->fops->stat"; _new->unwind_to = "server_stat_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->stat); bound_xl->fops->stat (_new, bound_xl
, &state->loc, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2883 return 0;
2884err:
2885 server_stat_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2886 state->resolve.op_errno, NULL((void*)0), NULL((void*)0));
2887 return 0;
2888}
2889
2890int
2891server_lookup_resume (call_frame_t *frame, xlator_t *bound_xl)
2892{
2893 server_state_t *state = NULL((void*)0);
2894
2895 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2896
2897 if (state->resolve.op_ret != 0)
2898 goto err;
2899
2900 if (!state->loc.inode)
2901 state->loc.inode = inode_new (state->itable);
2902 else
2903 state->is_revalidate = 1;
2904
2905 STACK_WIND (frame, server_lookup_cbk,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2907
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->lookup_cbk) tmp_cbk = server_lookup_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->lookup"; _new->unwind_to = "server_lookup_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->lookup); bound_xl->fops->lookup (_new, bound_xl
, &state->loc, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2906 bound_xl, bound_xl->fops->lookup,do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2907
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->lookup_cbk) tmp_cbk = server_lookup_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->lookup"; _new->unwind_to = "server_lookup_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->lookup); bound_xl->fops->lookup (_new, bound_xl
, &state->loc, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
2907 &state->loc, state->xdata)do { call_frame_t *_new = ((void*)0); xlator_t *old_THIS = ((
void*)0); _new = mem_get0 (frame->root->pool->frame_mem_pool
); if (!_new) { do { do { if (0) printf ("alloc failed"); } while
(0); _gf_log ("stack", "server-rpc-fops.c", __FUNCTION__, 2907
, GF_LOG_ERROR, "alloc failed"); } while (0); break; } typeof
( bound_xl->fops->lookup_cbk) tmp_cbk = server_lookup_cbk
; _new->root = frame->root; _new->this = bound_xl; _new
->ret = (ret_fn_t) tmp_cbk; _new->parent = frame; _new->
cookie = _new; _new->wind_from = __FUNCTION__; _new->wind_to
= "bound_xl->fops->lookup"; _new->unwind_to = "server_lookup_cbk"
; pthread_spin_init (&_new->lock, 0); pthread_spin_lock
(&frame->root->stack_lock); { _new->next = frame
->root->frames.next; _new->prev = &frame->root
->frames; if (frame->root->frames.next) frame->root
->frames.next->prev = _new; frame->root->frames.next
= _new; frame->ref_count++; } pthread_spin_unlock (&frame
->root->stack_lock); old_THIS = (*__glusterfs_this_location
()); (*__glusterfs_this_location()) = bound_xl; if (frame->
this->ctx->measure_latency) gf_latency_begin (_new, bound_xl
->fops->lookup); bound_xl->fops->lookup (_new, bound_xl
, &state->loc, state->xdata); (*__glusterfs_this_location
()) = old_THIS; } while (0)
;
2908
2909 return 0;
2910err:
2911 server_lookup_cbk (frame, NULL((void*)0), frame->this, state->resolve.op_ret,
2912 state->resolve.op_errno, NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0));
2913
2914 return 0;
2915}
2916
2917
2918
2919
2920/* Fop section */
2921
2922int
2923server3_3_stat (rpcsvc_request_t *req)
2924{
2925 server_state_t *state = NULL((void*)0);
2926 call_frame_t *frame = NULL((void*)0);
2927 gfs3_stat_req args = {{0,},};
2928 int ret = -1;
2929 int op_errno = 0;
2930
2931 if (!req)
2932 return 0;
2933
2934 /* Initialize args first, then decode */
2935
2936 ret = xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_stat_req);
2937 if (ret < 0) {
2938 //failed to decode msg;
2939 req->rpc_err = GARBAGE_ARGS;
2940 goto out;
2941 }
2942
2943 frame = get_frame_from_request (req);
2944 if (!frame) {
2945 // something wrong, mostly insufficient memory
2946 req->rpc_err = GARBAGE_ARGS; /* TODO */
2947 goto out;
2948 }
2949 frame->root->op = GF_FOP_STAT;
2950
2951 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
2952 if (!state->conn->bound_xl) {
2953 /* auth failure, request on subvolume without setvolume */
2954 req->rpc_err = GARBAGE_ARGS;
2955 goto out;
2956 }
2957
2958 state->resolve.type = RESOLVE_MUST;
2959 memcpy (state->resolve.gfid, args.gfid, 16);
2960
2961 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 2964, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 2964, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
2962 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 2964, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 2964, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
2963 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 2964, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 2964, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
2964 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 2964, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 2964, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
2965
2966
2967 ret = 0;
2968 resolve_and_resume (frame, server_stat_resume);
2969
2970out:
2971 free (args.xdata.xdata_val);
2972
2973 if (op_errno)
2974 req->rpc_err = GARBAGE_ARGS;
2975
2976 return ret;
2977}
2978
2979
2980int
2981server3_3_setattr (rpcsvc_request_t *req)
2982{
2983 server_state_t *state = NULL((void*)0);
2984 call_frame_t *frame = NULL((void*)0);
2985 gfs3_setattr_req args = {{0,},};
2986 int ret = -1;
2987 int op_errno = 0;
2988
2989 if (!req)
2990 return 0;
2991
2992 ret = xdr_to_generic (req->msg[0], &args,
2993 (xdrproc_t)xdr_gfs3_setattr_req);
2994 if (ret < 0) {
2995 //failed to decode msg;
2996 req->rpc_err = GARBAGE_ARGS;
2997 goto out;
2998 }
2999
3000 frame = get_frame_from_request (req);
3001 if (!frame) {
3002 // something wrong, mostly insufficient memory
3003 req->rpc_err = GARBAGE_ARGS; /* TODO */
3004 goto out;
3005 }
3006 frame->root->op = GF_FOP_SETATTR;
3007
3008 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3009 if (!state->conn->bound_xl) {
3010 /* auth failure, request on subvolume without setvolume */
3011 req->rpc_err = GARBAGE_ARGS;
3012 goto out;
3013 }
3014
3015 state->resolve.type = RESOLVE_MUST;
3016 memcpy (state->resolve.gfid, args.gfid, 16);
3017
3018 gf_stat_to_iatt (&args.stbuf, &state->stbuf);
3019 state->valid = args.valid;
3020
3021 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3024, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3024, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3022 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3024, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3024, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3023 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3024, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3024, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3024 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3024, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3024, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3025
3026 ret = 0;
3027 resolve_and_resume (frame, server_setattr_resume);
3028
3029out:
3030 if (op_errno)
3031 req->rpc_err = GARBAGE_ARGS;
3032
3033 free (args.xdata.xdata_val);
3034
3035 return ret;
3036}
3037
3038
3039int
3040server3_3_fsetattr (rpcsvc_request_t *req)
3041{
3042 server_state_t *state = NULL((void*)0);
3043 call_frame_t *frame = NULL((void*)0);
3044 gfs3_fsetattr_req args = {0,};
3045 int ret = -1;
3046 int op_errno = 0;
3047
3048 if (!req)
3049 return ret;
3050
3051 ret = xdr_to_generic (req->msg[0], &args,
3052 (xdrproc_t)xdr_gfs3_fsetattr_req);
3053 if (ret < 0) {
3054 //failed to decode msg;
3055 req->rpc_err = GARBAGE_ARGS;
3056 goto out;
3057 }
3058
3059 frame = get_frame_from_request (req);
3060 if (!frame) {
3061 // something wrong, mostly insufficient memory
3062 req->rpc_err = GARBAGE_ARGS; /* TODO */
3063 goto out;
3064 }
3065 frame->root->op = GF_FOP_FSETATTR;
3066
3067 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3068 if (!state->conn->bound_xl) {
3069 /* auth failure, request on subvolume without setvolume */
3070 req->rpc_err = GARBAGE_ARGS;
3071 goto out;
3072 }
3073
3074 state->resolve.type = RESOLVE_MUST;
3075 state->resolve.fd_no = args.fd;
3076
3077 gf_stat_to_iatt (&args.stbuf, &state->stbuf);
3078 state->valid = args.valid;
3079
3080 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3083, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3083, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3081 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3083, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3083, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3082 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3083, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3083, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3083 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3083, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3083, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3084
3085 ret = 0;
3086 resolve_and_resume (frame, server_fsetattr_resume);
3087
3088out:
3089 free (args.xdata.xdata_val);
3090
3091 if (op_errno)
3092 req->rpc_err = GARBAGE_ARGS;
3093
3094 return ret;
3095}
3096
3097
3098int
3099server3_3_readlink (rpcsvc_request_t *req)
3100{
3101 server_state_t *state = NULL((void*)0);
3102 call_frame_t *frame = NULL((void*)0);
3103 gfs3_readlink_req args = {{0,},};
3104 int ret = -1;
3105 int op_errno = 0;
3106
3107 if (!req)
3108 return ret;
3109
3110 ret = xdr_to_generic (req->msg[0], &args,
3111 (xdrproc_t)xdr_gfs3_readlink_req);
3112 if (ret < 0) {
3113 //failed to decode msg;
3114 req->rpc_err = GARBAGE_ARGS;
3115 goto out;
3116 }
3117
3118 frame = get_frame_from_request (req);
3119 if (!frame) {
3120 // something wrong, mostly insufficient memory
3121 req->rpc_err = GARBAGE_ARGS; /* TODO */
3122 goto out;
3123 }
3124 frame->root->op = GF_FOP_READLINK;
3125
3126 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3127 if (!state->conn->bound_xl) {
3128 /* auth failure, request on subvolume without setvolume */
3129 req->rpc_err = GARBAGE_ARGS;
3130 goto out;
3131 }
3132
3133 state->resolve.type = RESOLVE_MUST;
3134 memcpy (state->resolve.gfid, args.gfid, 16);
3135
3136 state->size = args.size;
3137
3138 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3141, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3141, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3139 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3141, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3141, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3140 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3141, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3141, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3141 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3141, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3141, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3142
3143 ret = 0;
3144 resolve_and_resume (frame, server_readlink_resume);
3145
3146out:
3147 free (args.xdata.xdata_val);
3148
3149 if (op_errno)
3150 req->rpc_err = GARBAGE_ARGS;
3151
3152 return ret;
3153}
3154
3155
3156int
3157server3_3_create (rpcsvc_request_t *req)
3158{
3159 server_state_t *state = NULL((void*)0);
3160 call_frame_t *frame = NULL((void*)0);
3161 gfs3_create_req args = {{0,},};
3162 int ret = -1;
3163 int op_errno = 0;
3164
3165 if (!req)
3166 return ret;
3167
3168 args.bname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
3169
3170 ret = xdr_to_generic (req->msg[0], &args,
3171 (xdrproc_t)xdr_gfs3_create_req);
3172 if (ret < 0) {
3173 //failed to decode msg;
3174 req->rpc_err = GARBAGE_ARGS;
3175 goto out;
3176 }
3177
3178 frame = get_frame_from_request (req);
3179 if (!frame) {
3180 // something wrong, mostly insufficient memory
3181 req->rpc_err = GARBAGE_ARGS; /* TODO */
3182 goto out;
3183 }
3184 frame->root->op = GF_FOP_CREATE;
3185
3186 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3187 if (!state->conn->bound_xl) {
3188 /* auth failure, request on subvolume without setvolume */
3189 req->rpc_err = GARBAGE_ARGS;
3190 goto out;
3191 }
3192
3193
3194 state->resolve.bname = gf_strdup (args.bname);
3195 state->mode = args.mode;
3196 state->umask = args.umask;
3197 state->flags = gf_flags_to_flags (args.flags);
3198 memcpy (state->resolve.pargfid, args.pargfid, 16);
3199
3200 if (state->flags & O_EXCL0200) {
3201 state->resolve.type = RESOLVE_NOT;
3202 } else {
3203 state->resolve.type = RESOLVE_DONTCARE;
3204 }
3205
3206 /* TODO: can do alloca for xdata field instead of stdalloc */
3207 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3210, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3210, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3208 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3210, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3210, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3209 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3210, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3210, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3210 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3210, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3210, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3211
3212 ret = 0;
3213 resolve_and_resume (frame, server_create_resume);
3214
3215out:
3216 /* memory allocated by libc, don't use GF_FREE */
3217 free (args.xdata.xdata_val);
3218
3219 if (op_errno)
3220 req->rpc_err = GARBAGE_ARGS;
3221
3222 return ret;
3223}
3224
3225
3226int
3227server3_3_open (rpcsvc_request_t *req)
3228{
3229 server_state_t *state = NULL((void*)0);
3230 call_frame_t *frame = NULL((void*)0);
3231 gfs3_open_req args = {{0,},};
3232 int ret = -1;
3233 int op_errno = 0;
3234
3235 if (!req)
3236 return ret;
3237
3238 ret = xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_open_req);
3239 if (ret < 0) {
3240 //failed to decode msg;
3241 req->rpc_err = GARBAGE_ARGS;
3242 goto out;
3243 }
3244
3245 frame = get_frame_from_request (req);
3246 if (!frame) {
3247 // something wrong, mostly insufficient memory
3248 req->rpc_err = GARBAGE_ARGS; /* TODO */
3249 goto out;
3250 }
3251 frame->root->op = GF_FOP_OPEN;
3252
3253 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3254 if (!state->conn->bound_xl) {
3255 /* auth failure, request on subvolume without setvolume */
3256 req->rpc_err = GARBAGE_ARGS;
3257 goto out;
3258 }
3259
3260 state->resolve.type = RESOLVE_MUST;
3261 memcpy (state->resolve.gfid, args.gfid, 16);
3262
3263 state->flags = gf_flags_to_flags (args.flags);
3264
3265 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3268, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3268, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3266 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3268, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3268, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3267 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3268, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3268, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3268 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3268, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3268, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3269
3270 ret = 0;
3271 resolve_and_resume (frame, server_open_resume);
3272out:
3273 if (op_errno)
3274 req->rpc_err = GARBAGE_ARGS;
3275
3276 free (args.xdata.xdata_val);
3277
3278 return ret;
3279}
3280
3281
3282int
3283server3_3_readv (rpcsvc_request_t *req)
3284{
3285 server_state_t *state = NULL((void*)0);
3286 call_frame_t *frame = NULL((void*)0);
3287 gfs3_read_req args = {{0,},};
3288 int ret = -1;
3289 int op_errno = 0;
3290
3291 if (!req)
3292 goto out;
3293
3294 ret = xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_read_req);
3295 if (ret < 0) {
3296 //failed to decode msg;
3297 req->rpc_err = GARBAGE_ARGS;
3298 goto out;
3299 }
3300
3301 frame = get_frame_from_request (req);
3302 if (!frame) {
3303 // something wrong, mostly insufficient memory
3304 req->rpc_err = GARBAGE_ARGS; /* TODO */
3305 goto out;
3306 }
3307 frame->root->op = GF_FOP_READ;
3308
3309 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3310 if (!state->conn->bound_xl) {
3311 /* auth failure, request on subvolume without setvolume */
3312 req->rpc_err = GARBAGE_ARGS;
3313 goto out;
3314 }
3315
3316 state->resolve.type = RESOLVE_MUST;
3317 state->resolve.fd_no = args.fd;
3318 state->size = args.size;
3319 state->offset = args.offset;
3320 state->flags = args.flag;
3321
3322 memcpy (state->resolve.gfid, args.gfid, 16);
3323
3324 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3327, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3327, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3325 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3327, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3327, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3326 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3327, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3327, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3327 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3327, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3327, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3328
3329 ret = 0;
3330 resolve_and_resume (frame, server_readv_resume);
3331out:
3332 /* memory allocated by libc, don't use GF_FREE */
3333 free (args.xdata.xdata_val);
3334
3335 if (op_errno)
3336 req->rpc_err = GARBAGE_ARGS;
3337
3338 return ret;
3339}
3340
3341
3342int
3343server3_3_writev (rpcsvc_request_t *req)
3344{
3345 server_state_t *state = NULL((void*)0);
3346 call_frame_t *frame = NULL((void*)0);
3347 gfs3_write_req args = {{0,},};
3348 ssize_t len = 0;
3349 int i = 0;
3350 int ret = -1;
3351 int op_errno = 0;
3352
3353 if (!req)
3354 return ret;
3355
3356 len = xdr_to_generic (req->msg[0], &args,
3357 (xdrproc_t)xdr_gfs3_write_req);
3358 if (len < 0) {
3359 //failed to decode msg;
3360 req->rpc_err = GARBAGE_ARGS;
3361 goto out;
3362 }
3363
3364 frame = get_frame_from_request (req);
3365 if (!frame) {
3366 // something wrong, mostly insufficient memory
3367 req->rpc_err = GARBAGE_ARGS; /* TODO */
3368 goto out;
3369 }
3370 frame->root->op = GF_FOP_WRITE;
3371
3372 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3373 if (!state->conn->bound_xl) {
3374 /* auth failure, request on subvolume without setvolume */
3375 req->rpc_err = GARBAGE_ARGS;
3376 goto out;
3377 }
3378
3379 state->resolve.type = RESOLVE_MUST;
3380 state->resolve.fd_no = args.fd;
3381 state->offset = args.offset;
3382 state->flags = args.flag;
3383 state->iobref = iobref_ref (req->iobref);
3384 memcpy (state->resolve.gfid, args.gfid, 16);
3385
3386 if (len < req->msg[0].iov_len) {
3387 state->payload_vector[0].iov_base
3388 = (req->msg[0].iov_base + len);
3389 state->payload_vector[0].iov_len
3390 = req->msg[0].iov_len - len;
3391 state->payload_count = 1;
3392 }
3393
3394 for (i = 1; i < req->count; i++) {
3395 state->payload_vector[state->payload_count++]
3396 = req->msg[i];
3397 }
3398
3399 for (i = 0; i < state->payload_count; i++) {
3400 state->size += state->payload_vector[i].iov_len;
3401 }
3402
3403 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3406, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3406, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3404 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3406, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3406, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3405 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3406, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3406, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3406 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3406, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3406, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3407
3408#ifdef GF_TESTING_IO_XDATA
3409 dict_dump (state->xdata);
3410#endif
3411
3412 ret = 0;
3413 resolve_and_resume (frame, server_writev_resume);
3414out:
3415 free (args.xdata.xdata_val);
3416
3417 if (op_errno)
3418 req->rpc_err = GARBAGE_ARGS;
3419
3420 return ret;
3421}
3422
3423
3424#define SERVER3_3_VECWRITE_START0 0
3425#define SERVER3_3_VECWRITE_READING_HDR1 1
3426#define SERVER3_3_VECWRITE_READING_OPAQUE2 2
3427
3428int
3429server3_3_writev_vecsizer (int state, ssize_t *readsize, char *base_addr,
3430 char *curr_addr)
3431{
3432 ssize_t size = 0;
3433 int nextstate = 0;
3434 gfs3_write_req write_req = {{0,},};
3435 XDR xdr;
3436
3437 switch (state) {
3438 case SERVER3_3_VECWRITE_START0:
3439 size = xdr_sizeof ((xdrproc_t) xdr_gfs3_write_req,
3440 &write_req);
3441 *readsize = size;
3442 nextstate = SERVER3_3_VECWRITE_READING_HDR1;
3443 break;
3444 case SERVER3_3_VECWRITE_READING_HDR1:
3445 size = xdr_sizeof ((xdrproc_t) xdr_gfs3_write_req,
3446 &write_req);
3447
3448 xdrmem_create (&xdr, base_addr, size, XDR_DECODE);
3449
3450 /* This will fail if there is xdata sent from client, if not,
3451 well and good */
3452 xdr_gfs3_write_req (&xdr, &write_req);
3453
3454 /* need to round off to proper roof (%4), as XDR packing pads
3455 the end of opaque object with '0' */
3456 size = roof (write_req.xdata.xdata_len, 4)((((write_req.xdata.xdata_len)+(4)-1)/((4)?(4):1))*(4));
3457
3458 *readsize = size;
3459
3460 if (!size)
3461 nextstate = SERVER3_3_VECWRITE_START0;
3462 else
3463 nextstate = SERVER3_3_VECWRITE_READING_OPAQUE2;
3464
3465 free (write_req.xdata.xdata_val);
3466
3467 break;
3468
3469 case SERVER3_3_VECWRITE_READING_OPAQUE2:
3470 *readsize = 0;
3471 nextstate = SERVER3_3_VECWRITE_START0;
3472 break;
3473 default:
3474 gf_log ("server", GF_LOG_ERROR, "wrong state: %d", state)do { do { if (0) printf ("wrong state: %d", state); } while (
0); _gf_log ("server", "server-rpc-fops.c", __FUNCTION__, 3474
, GF_LOG_ERROR, "wrong state: %d", state); } while (0)
;
3475 }
3476
3477 return nextstate;
3478}
3479
3480
3481int
3482server3_3_release (rpcsvc_request_t *req)
3483{
3484 server_connection_t *conn = NULL((void*)0);
3485 gfs3_release_req args = {{0,},};
3486 gf_common_rsp rsp = {0,};
3487 int ret = -1;
3488
3489 ret = xdr_to_generic (req->msg[0], &args,
3490 (xdrproc_t)xdr_gfs3_release_req);
3491 if (ret < 0) {
3492 //failed to decode msg;
3493 req->rpc_err = GARBAGE_ARGS;
3494 goto out;
3495 }
3496
3497 conn = req->trans->xl_private;
3498 if (!conn) {
3499 /* Handshake is not complete yet. */
3500 req->rpc_err = SYSTEM_ERR;
3501 goto out;
3502 }
3503 gf_fd_put (conn->fdtable, args.fd);
3504
3505 server_submit_reply (NULL((void*)0), req, &rsp, NULL((void*)0), 0, NULL((void*)0),
3506 (xdrproc_t)xdr_gf_common_rsp);
3507
3508 ret = 0;
3509out:
3510 return ret;
3511}
3512
3513int
3514server3_3_releasedir (rpcsvc_request_t *req)
3515{
3516 server_connection_t *conn = NULL((void*)0);
3517 gfs3_releasedir_req args = {{0,},};
3518 gf_common_rsp rsp = {0,};
3519 int ret = -1;
3520
3521 ret = xdr_to_generic (req->msg[0], &args,
3522 (xdrproc_t)xdr_gfs3_release_req);
3523 if (ret < 0) {
3524 //failed to decode msg;
3525 req->rpc_err = GARBAGE_ARGS;
3526 goto out;
3527 }
3528
3529 conn = req->trans->xl_private;
3530 if (!conn) {
3531 req->rpc_err = GARBAGE_ARGS;
3532 goto out;
3533 }
3534
3535 gf_fd_put (conn->fdtable, args.fd);
3536
3537 server_submit_reply (NULL((void*)0), req, &rsp, NULL((void*)0), 0, NULL((void*)0),
3538 (xdrproc_t)xdr_gf_common_rsp);
3539
3540 ret = 0;
3541out:
3542 return ret;
3543}
3544
3545
3546int
3547server3_3_fsync (rpcsvc_request_t *req)
3548{
3549 server_state_t *state = NULL((void*)0);
3550 call_frame_t *frame = NULL((void*)0);
3551 gfs3_fsync_req args = {{0,},};
3552 int ret = -1;
3553 int op_errno = 0;
3554
3555 if (!req)
3556 return ret;
3557
3558 ret = xdr_to_generic (req->msg[0], &args,
3559 (xdrproc_t)xdr_gfs3_fsync_req);
3560 if (ret < 0) {
3561 //failed to decode msg;
3562 req->rpc_err = GARBAGE_ARGS;
3563 goto out;
3564 }
3565
3566 frame = get_frame_from_request (req);
3567 if (!frame) {
3568 // something wrong, mostly insufficient memory
3569 req->rpc_err = GARBAGE_ARGS; /* TODO */
3570 goto out;
3571 }
3572 frame->root->op = GF_FOP_FSYNC;
3573
3574 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3575 if (!state->conn->bound_xl) {
3576 /* auth failure, request on subvolume without setvolume */
3577 req->rpc_err = GARBAGE_ARGS;
3578 goto out;
3579 }
3580
3581 state->resolve.type = RESOLVE_MUST;
3582 state->resolve.fd_no = args.fd;
3583 state->flags = args.data;
3584 memcpy (state->resolve.gfid, args.gfid, 16);
3585
3586 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3589, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3589, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3587 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3589, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3589, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3588 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3589, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3589, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3589 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3589, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3589, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3590
3591 ret = 0;
3592 resolve_and_resume (frame, server_fsync_resume);
3593out:
3594 free (args.xdata.xdata_val);
3595
3596 if (op_errno)
3597 req->rpc_err = GARBAGE_ARGS;
3598
3599 return ret;
3600}
3601
3602
3603
3604int
3605server3_3_flush (rpcsvc_request_t *req)
3606{
3607 server_state_t *state = NULL((void*)0);
3608 call_frame_t *frame = NULL((void*)0);
3609 gfs3_flush_req args = {{0,},};
3610 int ret = -1;
3611 int op_errno = 0;
3612
3613 if (!req)
3614 return ret;
3615
3616 ret = xdr_to_generic (req->msg[0], &args,
3617 (xdrproc_t)xdr_gfs3_flush_req);
3618 if (ret < 0) {
3619 //failed to decode msg;
3620 req->rpc_err = GARBAGE_ARGS;
3621 goto out;
3622 }
3623
3624 frame = get_frame_from_request (req);
3625 if (!frame) {
3626 // something wrong, mostly insufficient memory
3627 req->rpc_err = GARBAGE_ARGS; /* TODO */
3628 goto out;
3629 }
3630 frame->root->op = GF_FOP_FLUSH;
3631
3632 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3633 if (!state->conn->bound_xl) {
3634 /* auth failure, request on subvolume without setvolume */
3635 req->rpc_err = GARBAGE_ARGS;
3636 goto out;
3637 }
3638
3639 state->resolve.type = RESOLVE_MUST;
3640 state->resolve.fd_no = args.fd;
3641 memcpy (state->resolve.gfid, args.gfid, 16);
3642
3643 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3646, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3646, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3644 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3646, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3646, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3645 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3646, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3646, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3646 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3646, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3646, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3647
3648 ret = 0;
3649 resolve_and_resume (frame, server_flush_resume);
3650out:
3651 free (args.xdata.xdata_val);
3652
3653 if (op_errno)
3654 req->rpc_err = GARBAGE_ARGS;
3655
3656 return ret;
3657}
3658
3659
3660
3661int
3662server3_3_ftruncate (rpcsvc_request_t *req)
3663{
3664 server_state_t *state = NULL((void*)0);
3665 call_frame_t *frame = NULL((void*)0);
3666 gfs3_ftruncate_req args = {{0,},};
3667 int ret = -1;
3668 int op_errno = 0;
3669
3670 if (!req)
3671 return ret;
3672
3673 ret = xdr_to_generic (req->msg[0], &args,
3674 (xdrproc_t)xdr_gfs3_ftruncate_req);
3675 if (ret < 0) {
3676 //failed to decode msg;
3677 req->rpc_err = GARBAGE_ARGS;
3678 goto out;
3679 }
3680
3681 frame = get_frame_from_request (req);
3682 if (!frame) {
3683 // something wrong, mostly insufficient memory
3684 req->rpc_err = GARBAGE_ARGS; /* TODO */
3685 goto out;
3686 }
3687 frame->root->op = GF_FOP_FTRUNCATE;
3688
3689 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3690 if (!state->conn->bound_xl) {
3691 /* auth failure, request on subvolume without setvolume */
3692 req->rpc_err = GARBAGE_ARGS;
3693 goto out;
3694 }
3695
3696 state->resolve.type = RESOLVE_MUST;
3697 state->resolve.fd_no = args.fd;
3698 state->offset = args.offset;
3699 memcpy (state->resolve.gfid, args.gfid, 16);
3700
3701 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3704, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3704, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3702 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3704, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3704, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3703 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3704, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3704, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3704 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3704, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3704, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3705
3706 ret = 0;
3707 resolve_and_resume (frame, server_ftruncate_resume);
3708out:
3709 free (args.xdata.xdata_val);
3710
3711 if (op_errno)
3712 req->rpc_err = GARBAGE_ARGS;
3713
3714 return ret;
3715}
3716
3717
3718int
3719server3_3_fstat (rpcsvc_request_t *req)
3720{
3721 server_state_t *state = NULL((void*)0);
3722 call_frame_t *frame = NULL((void*)0);
3723 gfs3_fstat_req args = {{0,},};
3724 int ret = -1;
3725 int op_errno = 0;
3726
3727 if (!req)
3728 return ret;
3729
3730 ret = xdr_to_generic (req->msg[0], &args,
3731 (xdrproc_t)xdr_gfs3_fstat_req);
3732 if (ret < 0) {
3733 //failed to decode msg;
3734 req->rpc_err = GARBAGE_ARGS;
3735 goto out;
3736 }
3737
3738 frame = get_frame_from_request (req);
3739 if (!frame) {
3740 // something wrong, mostly insufficient memory
3741 req->rpc_err = GARBAGE_ARGS; /* TODO */
3742 goto out;
3743 }
3744 frame->root->op = GF_FOP_FSTAT;
3745
3746 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3747 if (!state->conn->bound_xl) {
3748 /* auth failure, request on subvolume without setvolume */
3749 req->rpc_err = GARBAGE_ARGS;
3750 goto out;
3751 }
3752
3753 state->resolve.type = RESOLVE_MUST;
3754 state->resolve.fd_no = args.fd;
3755 memcpy (state->resolve.gfid, args.gfid, 16);
3756
3757 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3760, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3760, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3758 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3760, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3760, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3759 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3760, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3760, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3760 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3760, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3760, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3761
3762 ret = 0;
3763 resolve_and_resume (frame, server_fstat_resume);
3764out:
3765 free (args.xdata.xdata_val);
3766
3767 if (op_errno)
3768 req->rpc_err = GARBAGE_ARGS;
3769
3770 return ret;
3771}
3772
3773
3774int
3775server3_3_truncate (rpcsvc_request_t *req)
3776{
3777 server_state_t *state = NULL((void*)0);
3778 call_frame_t *frame = NULL((void*)0);
3779 gfs3_truncate_req args = {{0,},};
3780 int ret = -1;
3781 int op_errno = 0;
3782
3783 if (!req)
3784 return ret;
3785
3786 ret = xdr_to_generic (req->msg[0], &args,
3787 (xdrproc_t)xdr_gfs3_truncate_req);
3788 if (ret < 0) {
3789 //failed to decode msg;
3790 req->rpc_err = GARBAGE_ARGS;
3791 goto out;
3792 }
3793
3794 frame = get_frame_from_request (req);
3795 if (!frame) {
3796 // something wrong, mostly insufficient memory
3797 req->rpc_err = GARBAGE_ARGS; /* TODO */
3798 goto out;
3799 }
3800 frame->root->op = GF_FOP_TRUNCATE;
3801
3802 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3803 if (!state->conn->bound_xl) {
3804 /* auth failure, request on subvolume without setvolume */
3805 req->rpc_err = GARBAGE_ARGS;
3806 goto out;
3807 }
3808
3809 state->resolve.type = RESOLVE_MUST;
3810 memcpy (state->resolve.gfid, args.gfid, 16);
3811 state->offset = args.offset;
3812
3813 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3816, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3816, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3814 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3816, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3816, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3815 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3816, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3816, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3816 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3816, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3816, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3817
3818 ret = 0;
3819 resolve_and_resume (frame, server_truncate_resume);
3820out:
3821 free (args.xdata.xdata_val);
3822
3823 if (op_errno)
3824 req->rpc_err = GARBAGE_ARGS;
3825
3826 return ret;
3827}
3828
3829
3830
3831int
3832server3_3_unlink (rpcsvc_request_t *req)
3833{
3834 server_state_t *state = NULL((void*)0);
3835 call_frame_t *frame = NULL((void*)0);
3836 gfs3_unlink_req args = {{0,},};
3837 int ret = -1;
3838 int op_errno = 0;
3839
3840 if (!req)
3841 return ret;
3842
3843 args.bname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
3844
3845 ret = xdr_to_generic (req->msg[0], &args,
3846 (xdrproc_t)xdr_gfs3_unlink_req);
3847 if (ret < 0) {
3848 //failed to decode msg;
3849 req->rpc_err = GARBAGE_ARGS;
3850 goto out;
3851 }
3852
3853 frame = get_frame_from_request (req);
3854 if (!frame) {
3855 // something wrong, mostly insufficient memory
3856 req->rpc_err = GARBAGE_ARGS; /* TODO */
3857 goto out;
3858 }
3859 frame->root->op = GF_FOP_UNLINK;
3860
3861 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3862 if (!state->conn->bound_xl) {
3863 /* auth failure, request on subvolume without setvolume */
3864 req->rpc_err = GARBAGE_ARGS;
3865 goto out;
3866 }
3867
3868 state->resolve.type = RESOLVE_MUST;
3869 state->resolve.bname = gf_strdup (args.bname);
3870 memcpy (state->resolve.pargfid, args.pargfid, 16);
3871
3872 state->flags = args.xflags;
3873
3874 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3877, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3877, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3875 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3877, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3877, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3876 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3877, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3877, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3877 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3877, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3877, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3878
3879 ret = 0;
3880 resolve_and_resume (frame, server_unlink_resume);
3881out:
3882 free (args.xdata.xdata_val);
3883
3884 if (op_errno)
3885 req->rpc_err = GARBAGE_ARGS;
3886
3887 return ret;
3888}
3889
3890
3891int
3892server3_3_setxattr (rpcsvc_request_t *req)
3893{
3894 server_state_t *state = NULL((void*)0);
3895 dict_t *dict = NULL((void*)0);
3896 call_frame_t *frame = NULL((void*)0);
3897 gfs3_setxattr_req args = {{0,},};
3898 int32_t ret = -1;
3899 int32_t op_errno = 0;
3900
3901 if (!req)
3902 return ret;
3903
3904 args.dict.dict_val = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
3905
3906 ret = xdr_to_generic (req->msg[0], &args,
3907 (xdrproc_t)xdr_gfs3_setxattr_req);
3908 if (ret < 0) {
3909 //failed to decode msg;
3910 req->rpc_err = GARBAGE_ARGS;
3911 goto out;
3912 }
3913
3914 frame = get_frame_from_request (req);
3915 if (!frame) {
3916 // something wrong, mostly insufficient memory
3917 req->rpc_err = GARBAGE_ARGS; /* TODO */
3918 goto out;
3919 }
3920 frame->root->op = GF_FOP_SETXATTR;
3921
3922 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3923 if (!state->conn->bound_xl) {
3924 /* auth failure, request on subvolume without setvolume */
3925 req->rpc_err = GARBAGE_ARGS;
3926 goto out;
3927 }
3928
3929 state->resolve.type = RESOLVE_MUST;
3930 state->flags = args.flags;
3931 memcpy (state->resolve.gfid, args.gfid, 16);
3932
3933 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, dict,do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 3936, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3936, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
3934 (args.dict.dict_val),do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 3936, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3936, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
3935 (args.dict.dict_len), ret,do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 3936, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3936, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
3936 op_errno, out)do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 3936, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3936, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
;
3937
3938 state->dict = dict;
3939
3940 /* There can be some commands hidden in key, check and proceed */
3941 gf_server_check_setxattr_cmd (frame, dict);
3942
3943 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3946, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3946, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3944 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3946, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3946, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3945 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3946, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3946, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
3946 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 3946, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 3946, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
3947
3948 ret = 0;
3949 resolve_and_resume (frame, server_setxattr_resume);
3950
3951 return ret;
3952out:
3953 free (args.xdata.xdata_val);
3954
3955 if (op_errno)
3956 req->rpc_err = GARBAGE_ARGS;
3957
3958 if (dict)
3959 dict_unref (dict);
3960
3961 return ret;
3962}
3963
3964
3965
3966int
3967server3_3_fsetxattr (rpcsvc_request_t *req)
3968{
3969 server_state_t *state = NULL((void*)0);
3970 dict_t *dict = NULL((void*)0);
3971 call_frame_t *frame = NULL((void*)0);
3972 gfs3_fsetxattr_req args = {{0,},};
3973 int32_t ret = -1;
3974 int32_t op_errno = 0;
3975
3976 if (!req)
3977 return ret;
3978
3979 args.dict.dict_val = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
3980 ret = xdr_to_generic (req->msg[0], &args,
3981 (xdrproc_t)xdr_gfs3_fsetxattr_req);
3982 if (ret < 0) {
3983 //failed to decode msg;
3984 req->rpc_err = GARBAGE_ARGS;
3985 goto out;
3986 }
3987
3988 frame = get_frame_from_request (req);
3989 if (!frame) {
3990 // something wrong, mostly insufficient memory
3991 req->rpc_err = GARBAGE_ARGS; /* TODO */
3992 goto out;
3993 }
3994 frame->root->op = GF_FOP_FSETXATTR;
3995
3996 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
3997 if (!state->conn->bound_xl) {
3998 /* auth failure, request on subvolume without setvolume */
3999 req->rpc_err = GARBAGE_ARGS;
4000 goto out;
4001 }
4002
4003 state->resolve.type = RESOLVE_MUST;
4004 state->resolve.fd_no = args.fd;
4005 state->flags = args.flags;
4006 memcpy (state->resolve.gfid, args.gfid, 16);
4007
4008 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, dict,do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4011, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4011, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4009 (args.dict.dict_val),do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4011, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4011, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4010 (args.dict.dict_len), ret,do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4011, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4011, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4011 op_errno, out)do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4011, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4011, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
;
4012
4013 state->dict = dict;
4014
4015 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4018, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4018, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4016 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4018, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4018, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4017 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4018, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4018, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4018 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4018, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4018, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4019
4020 ret = 0;
4021 resolve_and_resume (frame, server_fsetxattr_resume);
4022
4023 return ret;
4024out:
4025 free (args.xdata.xdata_val);
4026
4027 if (op_errno)
4028 req->rpc_err = GARBAGE_ARGS;
4029
4030 if (dict)
4031 dict_unref (dict);
4032
4033 return ret;
4034}
4035
4036
4037
4038int
4039server3_3_fxattrop (rpcsvc_request_t *req)
4040{
4041 dict_t *dict = NULL((void*)0);
4042 server_state_t *state = NULL((void*)0);
4043 call_frame_t *frame = NULL((void*)0);
4044 gfs3_fxattrop_req args = {{0,},};
4045 int32_t ret = -1;
4046 int32_t op_errno = 0;
4047
4048 if (!req)
4049 return ret;
4050
4051 args.dict.dict_val = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
4052 ret = xdr_to_generic (req->msg[0], &args,
4053 (xdrproc_t)xdr_gfs3_fxattrop_req);
4054 if (ret < 0) {
4055 //failed to decode msg;
4056 req->rpc_err = GARBAGE_ARGS;
4057 goto out;
4058 }
4059
4060 frame = get_frame_from_request (req);
4061 if (!frame) {
4062 // something wrong, mostly insufficient memory
4063 req->rpc_err = GARBAGE_ARGS; /* TODO */
4064 goto out;
4065 }
4066 frame->root->op = GF_FOP_FXATTROP;
4067
4068 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
4069 if (!state->conn->bound_xl) {
4070 /* auth failure, request on subvolume without setvolume */
4071 req->rpc_err = GARBAGE_ARGS;
4072 goto out;
4073 }
4074
4075 state->resolve.type = RESOLVE_MUST;
4076 state->resolve.fd_no = args.fd;
4077 state->flags = args.flags;
4078 memcpy (state->resolve.gfid, args.gfid, 16);
4079
4080 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, dict,do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4083, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4083, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4081 (args.dict.dict_val),do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4083, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4083, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4082 (args.dict.dict_len), ret,do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4083, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4083, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4083 op_errno, out)do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4083, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4083, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
;
4084
4085 state->dict = dict;
4086
4087 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4090, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4090, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4088 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4090, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4090, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4089 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4090, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4090, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4090 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4090, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4090, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4091
4092 ret = 0;
4093 resolve_and_resume (frame, server_fxattrop_resume);
4094
4095 return ret;
4096
4097out:
4098 free (args.xdata.xdata_val);
4099
4100 if (op_errno)
4101 req->rpc_err = GARBAGE_ARGS;
4102
4103 if (dict)
4104 dict_unref (dict);
4105
4106 return ret;
4107}
4108
4109
4110
4111int
4112server3_3_xattrop (rpcsvc_request_t *req)
4113{
4114 dict_t *dict = NULL((void*)0);
4115 server_state_t *state = NULL((void*)0);
4116 call_frame_t *frame = NULL((void*)0);
4117 gfs3_xattrop_req args = {{0,},};
4118 int32_t ret = -1;
4119 int32_t op_errno = 0;
4120
4121 if (!req)
4122 return ret;
4123
4124 args.dict.dict_val = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
4125
4126 ret = xdr_to_generic (req->msg[0], &args,
4127 (xdrproc_t)xdr_gfs3_xattrop_req);
4128 if (ret < 0) {
4129 //failed to decode msg;
4130 req->rpc_err = GARBAGE_ARGS;
4131 goto out;
4132 }
4133
4134 frame = get_frame_from_request (req);
4135 if (!frame) {
4136 // something wrong, mostly insufficient memory
4137 req->rpc_err = GARBAGE_ARGS; /* TODO */
4138 goto out;
4139 }
4140 frame->root->op = GF_FOP_XATTROP;
4141
4142 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
4143 if (!state->conn->bound_xl) {
4144 /* auth failure, request on subvolume without setvolume */
4145 req->rpc_err = GARBAGE_ARGS;
4146 goto out;
4147 }
4148
4149 state->resolve.type = RESOLVE_MUST;
4150 state->flags = args.flags;
4151 memcpy (state->resolve.gfid, args.gfid, 16);
4152
4153 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, dict,do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4156, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4156, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4154 (args.dict.dict_val),do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4156, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4156, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4155 (args.dict.dict_len), ret,do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4156, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4156, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
4156 op_errno, out)do { if (!(args.dict.dict_len)) break; dict = dict_new(); do {
if (!dict) { (*__errno_location ()) = 22; do { do { if (0) printf
("invalid argument: " "dict"); } while (0); _gf_log_callingfn
(state->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 4156, GF_LOG_ERROR, "invalid argument: " "dict"); } while (
0); goto out; } } while (0); ret = dict_unserialize ((args.dict
.dict_val), (args.dict.dict_len), &dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("dict")); } while (0); _gf_log (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4156, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("dict")); } while
(0); op_errno = 22; goto out; } } while (0)
;
4157
4158 state->dict = dict;
4159
4160 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4163, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4163, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4161 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4163, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4163, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4162 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4163, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4163, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4163 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4163, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4163, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4164
4165 ret = 0;
4166 resolve_and_resume (frame, server_xattrop_resume);
4167
4168 return ret;
4169out:
4170 free (args.xdata.xdata_val);
4171
4172 if (op_errno)
4173 req->rpc_err = GARBAGE_ARGS;
4174
4175 if (dict)
4176 dict_unref (dict);
4177
4178 return ret;
4179}
4180
4181
4182int
4183server3_3_getxattr (rpcsvc_request_t *req)
4184{
4185 server_state_t *state = NULL((void*)0);
4186 call_frame_t *frame = NULL((void*)0);
4187 gfs3_getxattr_req args = {{0,},};
4188 int ret = -1;
4189 int op_errno = 0;
4190
4191 if (!req)
4192 return ret;
4193
4194 args.name = alloca (256)__builtin_alloca (256);
4195
4196 ret = xdr_to_generic (req->msg[0], &args,
4197 (xdrproc_t)xdr_gfs3_getxattr_req);
4198 if (ret < 0) {
4199 //failed to decode msg;
4200 req->rpc_err = GARBAGE_ARGS;
4201 goto out;
4202 }
4203
4204 frame = get_frame_from_request (req);
4205 if (!frame) {
4206 // something wrong, mostly insufficient memory
4207 req->rpc_err = GARBAGE_ARGS; /* TODO */
4208 goto out;
4209 }
4210 frame->root->op = GF_FOP_GETXATTR;
4211
4212 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4213 if (!state->conn->bound_xl) {
4214 /* auth failure, request on subvolume without setvolume */
4215 req->rpc_err = GARBAGE_ARGS;
4216 goto out;
4217 }
4218
4219 state->resolve.type = RESOLVE_MUST;
4220 memcpy (state->resolve.gfid, args.gfid, 16);
4221
4222 if (args.namelen) {
4223 state->name = gf_strdup (args.name);
4224 /* There can be some commands hidden in key, check and proceed */
4225 gf_server_check_getxattr_cmd (frame, state->name);
4226 }
4227
4228 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4231, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4231, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4229 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4231, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4231, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4230 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4231, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4231, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4231 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4231, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4231, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4232
4233 ret = 0;
4234 resolve_and_resume (frame, server_getxattr_resume);
4235out:
4236 free (args.xdata.xdata_val);
4237
4238 if (op_errno)
4239 req->rpc_err = GARBAGE_ARGS;
4240
4241 return ret;
4242}
4243
4244
4245int
4246server3_3_fgetxattr (rpcsvc_request_t *req)
4247{
4248 server_state_t *state = NULL((void*)0);
4249 call_frame_t *frame = NULL((void*)0);
4250 gfs3_fgetxattr_req args = {{0,},};
4251 int ret = -1;
4252 int op_errno = 0;
4253
4254 if (!req)
4255 return ret;
4256
4257 args.name = alloca (256)__builtin_alloca (256);
4258 ret = xdr_to_generic (req->msg[0], &args,
4259 (xdrproc_t)xdr_gfs3_fgetxattr_req);
4260 if (ret < 0) {
4261 //failed to decode msg;
4262 req->rpc_err = GARBAGE_ARGS;
4263 goto out;
4264 }
4265
4266 frame = get_frame_from_request (req);
4267 if (!frame) {
4268 // something wrong, mostly insufficient memory
4269 req->rpc_err = GARBAGE_ARGS; /* TODO */
4270 goto out;
4271 }
4272 frame->root->op = GF_FOP_FGETXATTR;
4273
4274 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4275 if (!state->conn->bound_xl) {
4276 /* auth failure, request on subvolume without setvolume */
4277 req->rpc_err = GARBAGE_ARGS;
4278 goto out;
4279 }
4280
4281 state->resolve.type = RESOLVE_MUST;
4282 state->resolve.fd_no = args.fd;
4283 memcpy (state->resolve.gfid, args.gfid, 16);
4284
4285 if (args.namelen)
4286 state->name = gf_strdup (args.name);
4287
4288 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4291, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4291, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4289 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4291, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4291, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4290 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4291, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4291, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4291 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4291, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4291, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4292
4293 ret = 0;
4294 resolve_and_resume (frame, server_fgetxattr_resume);
4295out:
4296 free (args.xdata.xdata_val);
4297
4298 if (op_errno)
4299 req->rpc_err = GARBAGE_ARGS;
4300
4301 return ret;
4302}
4303
4304
4305
4306int
4307server3_3_removexattr (rpcsvc_request_t *req)
4308{
4309 server_state_t *state = NULL((void*)0);
4310 call_frame_t *frame = NULL((void*)0);
4311 gfs3_removexattr_req args = {{0,},};
4312 int ret = -1;
4313 int op_errno = 0;
4314
4315 if (!req)
4316 return ret;
4317
4318 args.name = alloca (256)__builtin_alloca (256);
4319
4320 ret = xdr_to_generic (req->msg[0], &args,
4321 (xdrproc_t)xdr_gfs3_removexattr_req);
4322 if (ret < 0) {
4323 //failed to decode msg;
4324 req->rpc_err = GARBAGE_ARGS;
4325 goto out;
4326 }
4327
4328 frame = get_frame_from_request (req);
4329 if (!frame) {
4330 // something wrong, mostly insufficient memory
4331 req->rpc_err = GARBAGE_ARGS; /* TODO */
4332 goto out;
4333 }
4334 frame->root->op = GF_FOP_REMOVEXATTR;
4335
4336 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4337 if (!state->conn->bound_xl) {
4338 /* auth failure, request on subvolume without setvolume */
4339 req->rpc_err = GARBAGE_ARGS;
4340 goto out;
4341 }
4342
4343 state->resolve.type = RESOLVE_MUST;
4344 memcpy (state->resolve.gfid, args.gfid, 16);
4345 state->name = gf_strdup (args.name);
4346
4347 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4350, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4350, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4348 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4350, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4350, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4349 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4350, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4350, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4350 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4350, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4350, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4351
4352 ret = 0;
4353 resolve_and_resume (frame, server_removexattr_resume);
4354out:
4355 free (args.xdata.xdata_val);
4356
4357 if (op_errno)
4358 req->rpc_err = GARBAGE_ARGS;
4359
4360 return ret;
4361}
4362
4363int
4364server3_3_fremovexattr (rpcsvc_request_t *req)
4365{
4366 server_state_t *state = NULL((void*)0);
4367 call_frame_t *frame = NULL((void*)0);
4368 gfs3_fremovexattr_req args = {{0,},};
4369 int ret = -1;
4370 int op_errno = 0;
4371
4372 if (!req)
4373 return ret;
4374
4375 args.name = alloca (4096)__builtin_alloca (4096);
4376
4377 ret = xdr_to_generic (req->msg[0], &args,
4378 (xdrproc_t)xdr_gfs3_fremovexattr_req);
4379 if (ret < 0) {
4380 //failed to decode msg;
4381 req->rpc_err = GARBAGE_ARGS;
4382 goto out;
4383 }
4384
4385 frame = get_frame_from_request (req);
4386 if (!frame) {
4387 // something wrong, mostly insufficient memory
4388 req->rpc_err = GARBAGE_ARGS; /* TODO */
4389 goto out;
4390 }
4391 frame->root->op = GF_FOP_FREMOVEXATTR;
4392
4393 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4394 if (!state->conn->bound_xl) {
4395 /* auth failure, request on subvolume without setvolume */
4396 req->rpc_err = GARBAGE_ARGS;
4397 goto out;
4398 }
4399
4400 state->resolve.type = RESOLVE_MUST;
4401 state->resolve.fd_no = args.fd;
4402 memcpy (state->resolve.gfid, args.gfid, 16);
4403 state->name = gf_strdup (args.name);
4404
4405 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4408, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4408, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4406 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4408, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4408, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4407 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4408, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4408, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4408 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4408, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4408, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4409
4410 ret = 0;
4411 resolve_and_resume (frame, server_fremovexattr_resume);
4412out:
4413 free (args.xdata.xdata_val);
4414
4415 if (op_errno)
4416 req->rpc_err = GARBAGE_ARGS;
4417
4418 return ret;
4419}
4420
4421
4422
4423
4424int
4425server3_3_opendir (rpcsvc_request_t *req)
4426{
4427 server_state_t *state = NULL((void*)0);
4428 call_frame_t *frame = NULL((void*)0);
4429 gfs3_opendir_req args = {{0,},};
4430 int ret = -1;
4431 int op_errno = 0;
4432
4433 if (!req)
4434 return ret;
4435
4436 ret = xdr_to_generic (req->msg[0], &args,
4437 (xdrproc_t)xdr_gfs3_opendir_req);
4438 if (ret < 0) {
4439 //failed to decode msg;
4440 req->rpc_err = GARBAGE_ARGS;
4441 goto out;
4442 }
4443
4444 frame = get_frame_from_request (req);
4445 if (!frame) {
4446 // something wrong, mostly insufficient memory
4447 req->rpc_err = GARBAGE_ARGS; /* TODO */
4448 goto out;
4449 }
4450 frame->root->op = GF_FOP_OPENDIR;
4451
4452 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4453 if (!state->conn->bound_xl) {
4454 /* auth failure, request on subvolume without setvolume */
4455 req->rpc_err = GARBAGE_ARGS;
4456 goto out;
4457 }
4458
4459 state->resolve.type = RESOLVE_MUST;
4460 memcpy (state->resolve.gfid, args.gfid, 16);
4461
4462 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4465, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4465, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4463 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4465, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4465, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4464 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4465, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4465, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4465 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4465, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4465, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4466
4467 ret = 0;
4468 resolve_and_resume (frame, server_opendir_resume);
4469out:
4470 free (args.xdata.xdata_val);
4471
4472 if (op_errno)
4473 req->rpc_err = GARBAGE_ARGS;
4474
4475 return ret;
4476}
4477
4478
4479int
4480server3_3_readdirp (rpcsvc_request_t *req)
4481{
4482 server_state_t *state = NULL((void*)0);
4483 call_frame_t *frame = NULL((void*)0);
4484 gfs3_readdirp_req args = {{0,},};
4485 size_t headers_size = 0;
4486 int ret = -1;
4487 int op_errno = 0;
4488
4489 if (!req)
4490 return ret;
4491
4492 ret = xdr_to_generic (req->msg[0], &args,
4493 (xdrproc_t)xdr_gfs3_readdirp_req);
4494 if (ret < 0) {
4495 //failed to decode msg;
4496 req->rpc_err = GARBAGE_ARGS;
4497 goto out;
4498 }
4499
4500 frame = get_frame_from_request (req);
4501 if (!frame) {
4502 // something wrong, mostly insufficient memory
4503 req->rpc_err = GARBAGE_ARGS; /* TODO */
4504 goto out;
4505 }
4506 frame->root->op = GF_FOP_READDIRP;
4507
4508 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
4509 if (!state->conn->bound_xl) {
4510 /* auth failure, request on subvolume without setvolume */
4511 req->rpc_err = GARBAGE_ARGS;
4512 goto out;
4513 }
4514
4515 /* FIXME: this should go away when variable sized iobufs are introduced
4516 * and transport layer can send msgs bigger than current page-size.
4517 */
4518 headers_size = sizeof (struct rpc_msg) + sizeof (gfs3_readdir_rsp);
4519 if ((frame->this->ctx->page_size < args.size)
4520 || ((frame->this->ctx->page_size - args.size) < headers_size)) {
4521 state->size = frame->this->ctx->page_size - headers_size;
4522 } else {
4523 state->size = args.size;
4524 }
4525
4526 state->resolve.type = RESOLVE_MUST;
4527 state->resolve.fd_no = args.fd;
4528 state->offset = args.offset;
4529 memcpy (state->resolve.gfid, args.gfid, 16);
4530
4531 /* here, dict itself works as xdata */
4532 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->dict,do { if (!(args.dict.dict_len)) break; state->dict = dict_new
(); do { if (!state->dict) { (*__errno_location ()) = 22; do
{ do { if (0) printf ("invalid argument: " "state->dict")
; } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4535, GF_LOG_ERROR
, "invalid argument: " "state->dict"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.dict.dict_val)
, (args.dict.dict_len), &state->dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->dict")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4535, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->dict")
); } while (0); op_errno = 22; goto out; } } while (0)
4533 (args.dict.dict_val),do { if (!(args.dict.dict_len)) break; state->dict = dict_new
(); do { if (!state->dict) { (*__errno_location ()) = 22; do
{ do { if (0) printf ("invalid argument: " "state->dict")
; } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4535, GF_LOG_ERROR
, "invalid argument: " "state->dict"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.dict.dict_val)
, (args.dict.dict_len), &state->dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->dict")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4535, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->dict")
); } while (0); op_errno = 22; goto out; } } while (0)
4534 (args.dict.dict_len), ret,do { if (!(args.dict.dict_len)) break; state->dict = dict_new
(); do { if (!state->dict) { (*__errno_location ()) = 22; do
{ do { if (0) printf ("invalid argument: " "state->dict")
; } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4535, GF_LOG_ERROR
, "invalid argument: " "state->dict"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.dict.dict_val)
, (args.dict.dict_len), &state->dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->dict")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4535, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->dict")
); } while (0); op_errno = 22; goto out; } } while (0)
4535 op_errno, out)do { if (!(args.dict.dict_len)) break; state->dict = dict_new
(); do { if (!state->dict) { (*__errno_location ()) = 22; do
{ do { if (0) printf ("invalid argument: " "state->dict")
; } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4535, GF_LOG_ERROR
, "invalid argument: " "state->dict"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.dict.dict_val)
, (args.dict.dict_len), &state->dict); if (ret < 0)
{ do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->dict")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4535, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->dict")
); } while (0); op_errno = 22; goto out; } } while (0)
;
4536
4537
4538 ret = 0;
4539 resolve_and_resume (frame, server_readdirp_resume);
4540out:
4541 if (op_errno)
4542 req->rpc_err = GARBAGE_ARGS;
4543
4544 free (args.dict.dict_val);
4545
4546 return ret;
4547}
4548
4549int
4550server3_3_readdir (rpcsvc_request_t *req)
4551{
4552 server_state_t *state = NULL((void*)0);
4553 call_frame_t *frame = NULL((void*)0);
4554 gfs3_readdir_req args = {{0,},};
4555 size_t headers_size = 0;
4556 int ret = -1;
4557 int op_errno = 0;
4558
4559 if (!req)
4560 return ret;
4561
4562 ret = xdr_to_generic (req->msg[0], &args,
4563 (xdrproc_t)xdr_gfs3_readdir_req);
4564 if (ret < 0) {
4565 //failed to decode msg;
4566 req->rpc_err = GARBAGE_ARGS;
4567 goto out;
4568 }
4569
4570 frame = get_frame_from_request (req);
4571 if (!frame) {
4572 // something wrong, mostly insufficient memory
4573 req->rpc_err = GARBAGE_ARGS; /* TODO */
4574 goto out;
4575 }
4576 frame->root->op = GF_FOP_READDIR;
4577
4578 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
4579 if (!state->conn->bound_xl) {
4580 /* auth failure, request on subvolume without setvolume */
4581 req->rpc_err = GARBAGE_ARGS;
4582 goto out;
4583 }
4584
4585 /* FIXME: this should go away when variable sized iobufs are introduced
4586 * and transport layer can send msgs bigger than current page-size.
4587 */
4588 headers_size = sizeof (struct rpc_msg) + sizeof (gfs3_readdir_rsp);
4589 if ((frame->this->ctx->page_size < args.size)
4590 || ((frame->this->ctx->page_size - args.size) < headers_size)) {
4591 state->size = frame->this->ctx->page_size - headers_size;
4592 } else {
4593 state->size = args.size;
4594 }
4595
4596 state->resolve.type = RESOLVE_MUST;
4597 state->resolve.fd_no = args.fd;
4598 state->offset = args.offset;
4599 memcpy (state->resolve.gfid, args.gfid, 16);
4600
4601 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4604, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4604, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4602 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4604, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4604, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4603 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4604, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4604, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4604 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4604, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4604, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4605
4606 ret = 0;
4607 resolve_and_resume (frame, server_readdir_resume);
4608out:
4609 free (args.xdata.xdata_val);
4610
4611 if (op_errno)
4612 req->rpc_err = GARBAGE_ARGS;
4613
4614 return ret;
4615}
4616
4617int
4618server3_3_fsyncdir (rpcsvc_request_t *req)
4619{
4620 server_state_t *state = NULL((void*)0);
4621 call_frame_t *frame = NULL((void*)0);
4622 gfs3_fsyncdir_req args = {{0,},};
4623 int ret = -1;
4624 int op_errno = 0;
4625
4626 if (!req)
4627 return ret;
4628
4629 ret = xdr_to_generic (req->msg[0], &args,
4630 (xdrproc_t)xdr_gfs3_fsyncdir_req);
4631 if (ret < 0) {
4632 //failed to decode msg;
4633 req->rpc_err = GARBAGE_ARGS;
4634 goto out;
4635 }
4636
4637 frame = get_frame_from_request (req);
4638 if (!frame) {
4639 // something wrong, mostly insufficient memory
4640 req->rpc_err = GARBAGE_ARGS; /* TODO */
4641 goto out;
4642 }
4643 frame->root->op = GF_FOP_FSYNCDIR;
4644
4645 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
4646 if (!state->conn->bound_xl) {
4647 /* auth failure, request on subvolume without setvolume */
4648 req->rpc_err = GARBAGE_ARGS;
4649 goto out;
4650 }
4651
4652 state->resolve.type = RESOLVE_MUST;
4653 state->resolve.fd_no = args.fd;
4654 state->flags = args.data;
4655 memcpy (state->resolve.gfid, args.gfid, 16);
4656
4657 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4660, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4660, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4658 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4660, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4660, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4659 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4660, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4660, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4660 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4660, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4660, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4661
4662 ret = 0;
4663 resolve_and_resume (frame, server_fsyncdir_resume);
4664out:
4665 free (args.xdata.xdata_val);
4666
4667 if (op_errno)
4668 req->rpc_err = GARBAGE_ARGS;
4669
4670 return ret;
4671}
4672
4673
4674
4675int
4676server3_3_mknod (rpcsvc_request_t *req)
4677{
4678 server_state_t *state = NULL((void*)0);
4679 call_frame_t *frame = NULL((void*)0);
4680 gfs3_mknod_req args = {{0,},};
4681 int ret = -1;
4682 int op_errno = 0;
4683
4684 if (!req)
4685 return ret;
4686
4687 args.bname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
4688
4689 ret = xdr_to_generic (req->msg[0], &args,
4690 (xdrproc_t)xdr_gfs3_mknod_req);
4691 if (ret < 0) {
4692 //failed to decode msg;
4693 req->rpc_err = GARBAGE_ARGS;
4694 goto out;
4695 }
4696
4697 frame = get_frame_from_request (req);
4698 if (!frame) {
4699 // something wrong, mostly insufficient memory
4700 req->rpc_err = GARBAGE_ARGS; /* TODO */
4701 goto out;
4702 }
4703 frame->root->op = GF_FOP_MKNOD;
4704
4705 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4706 if (!state->conn->bound_xl) {
4707 /* auth failure, request on subvolume without setvolume */
4708 req->rpc_err = GARBAGE_ARGS;
4709 goto out;
4710 }
4711
4712 state->resolve.type = RESOLVE_NOT;
4713 memcpy (state->resolve.pargfid, args.pargfid, 16);
4714 state->resolve.bname = gf_strdup (args.bname);
4715
4716 state->mode = args.mode;
4717 state->dev = args.dev;
4718 state->umask = args.umask;
4719
4720 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4723, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4723, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4721 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4723, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4723, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4722 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4723, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4723, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4723 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4723, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4723, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4724
4725 ret = 0;
4726 resolve_and_resume (frame, server_mknod_resume);
4727
4728out:
4729 if (op_errno)
4730 req->rpc_err = GARBAGE_ARGS;
4731
4732 /* memory allocated by libc, don't use GF_FREE */
4733 free (args.xdata.xdata_val);
4734
4735 return ret;
4736
4737}
4738
4739
4740int
4741server3_3_mkdir (rpcsvc_request_t *req)
4742{
4743 server_state_t *state = NULL((void*)0);
4744 call_frame_t *frame = NULL((void*)0);
4745 gfs3_mkdir_req args = {{0,},};
4746 int ret = -1;
4747 int op_errno = 0;
4748
4749 if (!req)
4750 return ret;
4751
4752 args.bname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
4753
4754 ret = xdr_to_generic (req->msg[0], &args,
4755 (xdrproc_t)xdr_gfs3_mkdir_req);
4756 if (ret < 0) {
4757 //failed to decode msg;
4758 req->rpc_err = GARBAGE_ARGS;
4759 goto out;
4760 }
4761
4762 frame = get_frame_from_request (req);
4763 if (!frame) {
4764 // something wrong, mostly insufficient memory
4765 req->rpc_err = GARBAGE_ARGS; /* TODO */
4766 goto out;
4767 }
4768 frame->root->op = GF_FOP_MKDIR;
4769
4770 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4771 if (!state->conn->bound_xl) {
4772 /* auth failure, request on subvolume without setvolume */
4773 req->rpc_err = GARBAGE_ARGS;
4774 goto out;
4775 }
4776
4777 state->resolve.type = RESOLVE_NOT;
4778 memcpy (state->resolve.pargfid, args.pargfid, 16);
4779 state->resolve.bname = gf_strdup (args.bname);
4780
4781 state->mode = args.mode;
4782 state->umask = args.umask;
4783
4784 /* TODO: can do alloca for xdata field instead of stdalloc */
4785 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4788, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4788, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4786 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4788, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4788, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4787 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4788, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4788, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4788 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4788, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4788, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4789
4790 ret = 0;
4791 resolve_and_resume (frame, server_mkdir_resume);
4792
4793out:
4794 if (op_errno)
4795 req->rpc_err = GARBAGE_ARGS;
4796
4797 free (args.xdata.xdata_val);
4798
4799 return ret;
4800}
4801
4802
4803int
4804server3_3_rmdir (rpcsvc_request_t *req)
4805{
4806 server_state_t *state = NULL((void*)0);
4807 call_frame_t *frame = NULL((void*)0);
4808 gfs3_rmdir_req args = {{0,},};
4809 int ret = -1;
4810 int op_errno = 0;
4811
4812 if (!req)
4813 return ret;
4814
4815 args.bname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
4816
4817 ret = xdr_to_generic (req->msg[0], &args,
4818 (xdrproc_t)xdr_gfs3_rmdir_req);
4819 if (ret < 0) {
4820 //failed to decode msg;
4821 req->rpc_err = GARBAGE_ARGS;
4822 goto out;
4823 }
4824
4825 frame = get_frame_from_request (req);
4826 if (!frame) {
4827 // something wrong, mostly insufficient memory
4828 req->rpc_err = GARBAGE_ARGS; /* TODO */
4829 goto out;
4830 }
4831 frame->root->op = GF_FOP_RMDIR;
4832
4833 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4834 if (!state->conn->bound_xl) {
4835 /* auth failure, request on subvolume without setvolume */
4836 req->rpc_err = GARBAGE_ARGS;
4837 goto out;
4838 }
4839
4840 state->resolve.type = RESOLVE_MUST;
4841 memcpy (state->resolve.pargfid, args.pargfid, 16);
4842 state->resolve.bname = gf_strdup (args.bname);
4843
4844 state->flags = args.xflags;
4845
4846 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4849, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4849, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4847 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4849, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4849, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4848 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4849, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4849, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4849 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4849, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4849, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4850
4851 ret = 0;
4852 resolve_and_resume (frame, server_rmdir_resume);
4853out:
4854 free (args.xdata.xdata_val);
4855
4856 if (op_errno)
4857 req->rpc_err = GARBAGE_ARGS;
4858
4859 return ret;
4860}
4861
4862
4863
4864int
4865server3_3_inodelk (rpcsvc_request_t *req)
4866{
4867 server_state_t *state = NULL((void*)0);
4868 call_frame_t *frame = NULL((void*)0);
4869 gfs3_inodelk_req args = {{0,},};
4870 int cmd = 0;
4871 int ret = -1;
4872 int op_errno = 0;
4873
4874 if (!req)
4875 return ret;
4876
4877 args.volume = alloca (256)__builtin_alloca (256);
4878
4879 ret = xdr_to_generic (req->msg[0], &args,
4880 (xdrproc_t)xdr_gfs3_inodelk_req);
4881 if (ret < 0) {
4882 //failed to decode msg;
4883 req->rpc_err = GARBAGE_ARGS;
4884 goto out;
4885 }
4886
4887 frame = get_frame_from_request (req);
4888 if (!frame) {
4889 // something wrong, mostly insufficient memory
4890 req->rpc_err = GARBAGE_ARGS; /* TODO */
4891 goto out;
4892 }
4893 frame->root->op = GF_FOP_INODELK;
4894
4895 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
4896 if (!state->conn->bound_xl) {
4897 /* auth failure, request on subvolume without setvolume */
4898 req->rpc_err = GARBAGE_ARGS;
4899 goto out;
4900 }
4901
4902 state->resolve.type = RESOLVE_EXACT;
4903 memcpy (state->resolve.gfid, args.gfid, 16);
4904
4905 cmd = args.cmd;
4906 switch (cmd) {
4907 case GF_LK_GETLK:
4908 state->cmd = F_GETLK12;
4909 break;
4910 case GF_LK_SETLK:
4911 state->cmd = F_SETLK13;
4912 break;
4913 case GF_LK_SETLKW:
4914 state->cmd = F_SETLKW14;
4915 break;
4916 }
4917
4918 state->type = args.type;
4919 state->volume = gf_strdup (args.volume);
4920
4921 gf_proto_flock_to_flock (&args.flock, &state->flock);
4922
4923 switch (state->type) {
4924 case GF_LK_F_RDLCK:
4925 state->flock.l_type = F_RDLCK0;
4926 break;
4927 case GF_LK_F_WRLCK:
4928 state->flock.l_type = F_WRLCK1;
4929 break;
4930 case GF_LK_F_UNLCK:
4931 state->flock.l_type = F_UNLCK2;
4932 break;
4933 }
4934
4935 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4938, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4938, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4936 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4938, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4938, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4937 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4938, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4938, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
4938 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 4938, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 4938, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
4939
4940 ret = 0;
4941 resolve_and_resume (frame, server_inodelk_resume);
4942out:
4943 free (args.xdata.xdata_val);
4944
4945 free (args.flock.lk_owner.lk_owner_val);
4946
4947 if (op_errno)
4948 req->rpc_err = GARBAGE_ARGS;
4949
4950 return ret;
4951}
4952
4953int
4954server3_3_finodelk (rpcsvc_request_t *req)
4955{
4956 server_state_t *state = NULL((void*)0);
4957 call_frame_t *frame = NULL((void*)0);
4958 gfs3_finodelk_req args = {{0,},};
4959 int ret = -1;
4960 int op_errno = 0;
4961
4962 if (!req)
4963 return ret;
4964
4965 args.volume = alloca (256)__builtin_alloca (256);
4966 ret = xdr_to_generic (req->msg[0], &args,
4967 (xdrproc_t)xdr_gfs3_finodelk_req);
4968 if (ret < 0) {
4969 //failed to decode msg;
4970 req->rpc_err = GARBAGE_ARGS;
4971 goto out;
4972 }
4973
4974 frame = get_frame_from_request (req);
4975 if (!frame) {
4976 // something wrong, mostly insufficient memory
4977 req->rpc_err = GARBAGE_ARGS; /* TODO */
4978 goto out;
4979 }
4980 frame->root->op = GF_FOP_FINODELK;
4981
4982 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
4983 if (!state->conn->bound_xl) {
4984 /* auth failure, request on subvolume without setvolume */
4985 req->rpc_err = GARBAGE_ARGS;
4986 goto out;
4987 }
4988
4989 state->resolve.type = RESOLVE_EXACT;
4990 state->volume = gf_strdup (args.volume);
4991 state->resolve.fd_no = args.fd;
4992 state->cmd = args.cmd;
4993 memcpy (state->resolve.gfid, args.gfid, 16);
4994
4995 switch (state->cmd) {
4996 case GF_LK_GETLK:
4997 state->cmd = F_GETLK12;
4998 break;
4999 case GF_LK_SETLK:
5000 state->cmd = F_SETLK13;
5001 break;
5002 case GF_LK_SETLKW:
5003 state->cmd = F_SETLKW14;
5004 break;
5005 }
5006
5007 state->type = args.type;
5008
5009 gf_proto_flock_to_flock (&args.flock, &state->flock);
5010
5011 switch (state->type) {
5012 case GF_LK_F_RDLCK:
5013 state->flock.l_type = F_RDLCK0;
5014 break;
5015 case GF_LK_F_WRLCK:
5016 state->flock.l_type = F_WRLCK1;
5017 break;
5018 case GF_LK_F_UNLCK:
5019 state->flock.l_type = F_UNLCK2;
5020 break;
5021 }
5022
5023 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5026, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5026, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5024 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5026, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5026, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5025 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5026, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5026, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5026 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5026, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5026, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5027
5028 ret = 0;
5029 resolve_and_resume (frame, server_finodelk_resume);
5030out:
5031 free (args.xdata.xdata_val);
5032
5033 free (args.flock.lk_owner.lk_owner_val);
5034
5035 if (op_errno)
5036 req->rpc_err = GARBAGE_ARGS;
5037
5038 return ret;
5039}
5040
5041
5042int
5043server3_3_entrylk (rpcsvc_request_t *req)
5044{
5045 server_state_t *state = NULL((void*)0);
5046 call_frame_t *frame = NULL((void*)0);
5047 gfs3_entrylk_req args = {{0,},};
5048 int ret = -1;
5049 int op_errno = 0;
5050
5051 if (!req)
5052 return ret;
5053
5054 args.volume = alloca (256)__builtin_alloca (256);
5055 args.name = alloca (256)__builtin_alloca (256);
5056
5057 ret = xdr_to_generic (req->msg[0], &args,
5058 (xdrproc_t)xdr_gfs3_entrylk_req);
5059 if (ret < 0) {
5060 //failed to decode msg;
5061 req->rpc_err = GARBAGE_ARGS;
5062 goto out;
5063 }
5064
5065 frame = get_frame_from_request (req);
5066 if (!frame) {
5067 // something wrong, mostly insufficient memory
5068 req->rpc_err = GARBAGE_ARGS; /* TODO */
5069 goto out;
5070 }
5071 frame->root->op = GF_FOP_ENTRYLK;
5072
5073 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
5074 if (!state->conn->bound_xl) {
5075 /* auth failure, request on subvolume without setvolume */
5076 req->rpc_err = GARBAGE_ARGS;
5077 goto out;
5078 }
5079
5080 state->resolve.type = RESOLVE_EXACT;
5081 memcpy (state->resolve.gfid, args.gfid, 16);
5082
5083 if (args.namelen)
5084 state->name = gf_strdup (args.name);
5085 state->volume = gf_strdup (args.volume);
5086
5087 state->cmd = args.cmd;
5088 state->type = args.type;
5089
5090 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5093, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5093, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5091 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5093, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5093, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5092 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5093, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5093, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5093 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5093, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5093, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5094
5095 ret = 0;
5096 resolve_and_resume (frame, server_entrylk_resume);
5097out:
5098 free (args.xdata.xdata_val);
5099
5100 if (op_errno)
5101 req->rpc_err = GARBAGE_ARGS;
5102
5103 return ret;
5104}
5105
5106int
5107server3_3_fentrylk (rpcsvc_request_t *req)
5108{
5109 server_state_t *state = NULL((void*)0);
5110 call_frame_t *frame = NULL((void*)0);
5111 gfs3_fentrylk_req args = {{0,},};
5112 int ret = -1;
5113 int op_errno = 0;
5114
5115 if (!req)
5116 return ret;
5117
5118 args.name = alloca (256)__builtin_alloca (256);
5119 args.volume = alloca (256)__builtin_alloca (256);
5120
5121 ret = xdr_to_generic (req->msg[0], &args,
5122 (xdrproc_t)xdr_gfs3_fentrylk_req);
5123 if (ret < 0) {
5124 //failed to decode msg;
5125 req->rpc_err = GARBAGE_ARGS;
5126 goto out;
5127 }
5128
5129 frame = get_frame_from_request (req);
5130 if (!frame) {
5131 // something wrong, mostly insufficient memory
5132 req->rpc_err = GARBAGE_ARGS; /* TODO */
5133 goto out;
5134 }
5135 frame->root->op = GF_FOP_FENTRYLK;
5136
5137 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
5138 if (!state->conn->bound_xl) {
5139 /* auth failure, request on subvolume without setvolume */
5140 req->rpc_err = GARBAGE_ARGS;
5141 goto out;
5142 }
5143
5144 state->resolve.type = RESOLVE_EXACT;
5145 state->resolve.fd_no = args.fd;
5146 state->cmd = args.cmd;
5147 state->type = args.type;
5148 memcpy (state->resolve.gfid, args.gfid, 16);
5149
5150 if (args.namelen)
5151 state->name = gf_strdup (args.name);
5152 state->volume = gf_strdup (args.volume);
5153
5154 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5157, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5157, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5155 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5157, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5157, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5156 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5157, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5157, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5157 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5157, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5157, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5158
5159 ret = 0;
5160 resolve_and_resume (frame, server_fentrylk_resume);
5161out:
5162 free (args.xdata.xdata_val);
5163
5164 if (op_errno)
5165 req->rpc_err = GARBAGE_ARGS;
5166
5167 return ret;
5168}
5169
5170int
5171server3_3_access (rpcsvc_request_t *req)
5172{
5173 server_state_t *state = NULL((void*)0);
5174 call_frame_t *frame = NULL((void*)0);
5175 gfs3_access_req args = {{0,},};
5176 int ret = -1;
5177 int op_errno = 0;
5178
5179 if (!req)
5180 return ret;
5181
5182 ret = xdr_to_generic (req->msg[0], &args,
5183 (xdrproc_t)xdr_gfs3_access_req);
5184 if (ret < 0) {
5185 //failed to decode msg;
5186 req->rpc_err = GARBAGE_ARGS;
5187 goto out;
5188 }
5189
5190 frame = get_frame_from_request (req);
5191 if (!frame) {
5192 // something wrong, mostly insufficient memory
5193 req->rpc_err = GARBAGE_ARGS; /* TODO */
5194 goto out;
5195 }
5196 frame->root->op = GF_FOP_ACCESS;
5197
5198 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
5199 if (!state->conn->bound_xl) {
5200 /* auth failure, request on subvolume without setvolume */
5201 req->rpc_err = GARBAGE_ARGS;
5202 goto out;
5203 }
5204
5205 state->resolve.type = RESOLVE_MUST;
5206 memcpy (state->resolve.gfid, args.gfid, 16);
5207 state->mask = args.mask;
5208
5209 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5212, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5212, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5210 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5212, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5212, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5211 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5212, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5212, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5212 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5212, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5212, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5213
5214 ret = 0;
5215 resolve_and_resume (frame, server_access_resume);
5216out:
5217 free (args.xdata.xdata_val);
5218
5219 if (op_errno)
5220 req->rpc_err = GARBAGE_ARGS;
5221
5222 return ret;
5223}
5224
5225
5226
5227int
5228server3_3_symlink (rpcsvc_request_t *req)
5229{
5230 server_state_t *state = NULL((void*)0);
5231 call_frame_t *frame = NULL((void*)0);
5232 gfs3_symlink_req args = {{0,},};
5233 int ret = -1;
5234 int op_errno = 0;
5235
5236 if (!req)
5237 return ret;
5238
5239 args.bname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
5240 args.linkname = alloca (4096)__builtin_alloca (4096);
5241
5242 ret = xdr_to_generic (req->msg[0], &args,
5243 (xdrproc_t)xdr_gfs3_symlink_req);
5244 if (ret < 0) {
5245 //failed to decode msg;
5246 req->rpc_err = GARBAGE_ARGS;
5247 goto out;
5248 }
5249
5250 frame = get_frame_from_request (req);
5251 if (!frame) {
5252 // something wrong, mostly insufficient memory
5253 req->rpc_err = GARBAGE_ARGS; /* TODO */
5254 goto out;
5255 }
5256 frame->root->op = GF_FOP_SYMLINK;
5257
5258 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
5259 if (!state->conn->bound_xl) {
5260 /* auth failure, request on subvolume without setvolume */
5261 req->rpc_err = GARBAGE_ARGS;
5262 goto out;
5263 }
5264
5265 state->resolve.type = RESOLVE_NOT;
5266 memcpy (state->resolve.pargfid, args.pargfid, 16);
5267 state->resolve.bname = gf_strdup (args.bname);
5268 state->name = gf_strdup (args.linkname);
5269 state->umask = args.umask;
5270
5271 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5274, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5274, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5272 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5274, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5274, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5273 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5274, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5274, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5274 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5274, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5274, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5275
5276 ret = 0;
5277 resolve_and_resume (frame, server_symlink_resume);
5278
5279out:
5280 if (op_errno)
5281 req->rpc_err = GARBAGE_ARGS;
5282
5283 /* memory allocated by libc, don't use GF_FREE */
5284 free (args.xdata.xdata_val);
5285
5286 return ret;
5287}
5288
5289
5290
5291int
5292server3_3_link (rpcsvc_request_t *req)
5293{
5294 server_state_t *state = NULL((void*)0);
5295 call_frame_t *frame = NULL((void*)0);
5296 gfs3_link_req args = {{0,},};
5297 int ret = -1;
5298 int op_errno = 0;
5299
5300 if (!req)
5301 return ret;
5302
5303 args.newbname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
5304
5305 ret = xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_link_req);
5306 if (ret < 0) {
5307 //failed to decode msg;
5308 req->rpc_err = GARBAGE_ARGS;
5309 goto out;
5310 }
5311
5312 frame = get_frame_from_request (req);
5313 if (!frame) {
5314 // something wrong, mostly insufficient memory
5315 req->rpc_err = GARBAGE_ARGS; /* TODO */
5316 goto out;
5317 }
5318 frame->root->op = GF_FOP_LINK;
5319
5320 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
5321 if (!state->conn->bound_xl) {
5322 /* auth failure, request on subvolume without setvolume */
5323 req->rpc_err = GARBAGE_ARGS;
5324 goto out;
5325 }
5326
5327 state->resolve.type = RESOLVE_MUST;
5328 memcpy (state->resolve.gfid, args.oldgfid, 16);
5329
5330 state->resolve2.type = RESOLVE_NOT;
5331 state->resolve2.bname = gf_strdup (args.newbname);
5332 memcpy (state->resolve2.pargfid, args.newgfid, 16);
5333
5334 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5337, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5337, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5335 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5337, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5337, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5336 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5337, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5337, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5337 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5337, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5337, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5338
5339 ret = 0;
5340 resolve_and_resume (frame, server_link_resume);
5341out:
5342 free (args.xdata.xdata_val);
5343
5344 if (op_errno)
5345 req->rpc_err = GARBAGE_ARGS;
5346
5347 return ret;
5348}
5349
5350
5351int
5352server3_3_rename (rpcsvc_request_t *req)
5353{
5354 server_state_t *state = NULL((void*)0);
5355 call_frame_t *frame = NULL((void*)0);
5356 gfs3_rename_req args = {{0,},};
5357 int ret = -1;
5358 int op_errno = 0;
5359
5360 if (!req)
5361 return ret;
5362
5363 args.oldbname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
5364 args.newbname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
5365
5366 ret = xdr_to_generic (req->msg[0], &args,
5367 (xdrproc_t)xdr_gfs3_rename_req);
5368 if (ret < 0) {
5369 //failed to decode msg;
5370 req->rpc_err = GARBAGE_ARGS;
5371 goto out;
5372 }
5373
5374 frame = get_frame_from_request (req);
5375 if (!frame) {
5376 // something wrong, mostly insufficient memory
5377 req->rpc_err = GARBAGE_ARGS; /* TODO */
5378 goto out;
5379 }
5380 frame->root->op = GF_FOP_RENAME;
5381
5382 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
5383 if (!state->conn->bound_xl) {
5384 /* auth failure, request on subvolume without setvolume */
5385 req->rpc_err = GARBAGE_ARGS;
5386 goto out;
5387 }
5388
5389 state->resolve.type = RESOLVE_MUST;
5390 state->resolve.bname = gf_strdup (args.oldbname);
5391 memcpy (state->resolve.pargfid, args.oldgfid, 16);
5392
5393 state->resolve2.type = RESOLVE_MAY;
5394 state->resolve2.bname = gf_strdup (args.newbname);
5395 memcpy (state->resolve2.pargfid, args.newgfid, 16);
5396
5397 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5400, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5400, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5398 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5400, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5400, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5399 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5400, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5400, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5400 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5400, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5400, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5401
5402 ret = 0;
5403 resolve_and_resume (frame, server_rename_resume);
5404out:
5405 free (args.xdata.xdata_val);
5406
5407 if (op_errno)
5408 req->rpc_err = GARBAGE_ARGS;
5409
5410 return ret;
5411}
5412
5413int
5414server3_3_lk (rpcsvc_request_t *req)
5415{
5416 server_state_t *state = NULL((void*)0);
5417 call_frame_t *frame = NULL((void*)0);
5418 gfs3_lk_req args = {{0,},};
5419 int ret = -1;
5420 int op_errno = 0;
5421
5422 if (!req)
5423 return ret;
5424
5425 ret = xdr_to_generic (req->msg[0], &args, (xdrproc_t)xdr_gfs3_lk_req);
5426 if (ret < 0) {
5427 //failed to decode msg;
5428 req->rpc_err = GARBAGE_ARGS;
5429 goto out;
5430 }
5431
5432 frame = get_frame_from_request (req);
5433 if (!frame) {
5434 // something wrong, mostly insufficient memory
5435 req->rpc_err = GARBAGE_ARGS; /* TODO */
5436 goto out;
5437 }
5438 frame->root->op = GF_FOP_LK;
5439
5440 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
5441 if (!state->conn->bound_xl) {
5442 /* auth failure, request on subvolume without setvolume */
5443 req->rpc_err = GARBAGE_ARGS;
5444 goto out;
5445 }
5446
5447 state->resolve.fd_no = args.fd;
5448 state->cmd = args.cmd;
5449 state->type = args.type;
5450 memcpy (state->resolve.gfid, args.gfid, 16);
5451
5452 switch (state->cmd) {
5453 case GF_LK_GETLK:
5454 state->cmd = F_GETLK12;
5455 break;
5456 case GF_LK_SETLK:
5457 state->cmd = F_SETLK13;
5458 break;
5459 case GF_LK_SETLKW:
5460 state->cmd = F_SETLKW14;
5461 break;
5462 case GF_LK_RESLK_LCK:
5463 state->cmd = F_RESLK_LCK;
5464 break;
5465 case GF_LK_RESLK_LCKW:
5466 state->cmd = F_RESLK_LCKW;
5467 break;
5468 case GF_LK_RESLK_UNLCK:
5469 state->cmd = F_RESLK_UNLCK;
5470 break;
5471 case GF_LK_GETLK_FD:
5472 state->cmd = F_GETLK_FD;
5473 break;
5474
5475 }
5476
5477
5478 gf_proto_flock_to_flock (&args.flock, &state->flock);
5479
5480 switch (state->type) {
5481 case GF_LK_F_RDLCK:
5482 state->flock.l_type = F_RDLCK0;
5483 break;
5484 case GF_LK_F_WRLCK:
5485 state->flock.l_type = F_WRLCK1;
5486 break;
5487 case GF_LK_F_UNLCK:
5488 state->flock.l_type = F_UNLCK2;
5489 break;
5490 default:
5491 gf_log (state->conn->bound_xl->name, GF_LOG_ERROR,do { do { if (0) printf ("fd - %""ll" "d"" (%s): Unknown lock type: %"
"d""!", state->resolve.fd_no, uuid_utoa (state->fd->
inode->gfid), state->type); } while (0); _gf_log (state
->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 5494, GF_LOG_ERROR, "fd - %""ll" "d"" (%s): Unknown lock type: %"
"d""!", state->resolve.fd_no, uuid_utoa (state->fd->
inode->gfid), state->type); } while (0)
5492 "fd - %"PRId64" (%s): Unknown lock type: %"PRId32"!",do { do { if (0) printf ("fd - %""ll" "d"" (%s): Unknown lock type: %"
"d""!", state->resolve.fd_no, uuid_utoa (state->fd->
inode->gfid), state->type); } while (0); _gf_log (state
->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 5494, GF_LOG_ERROR, "fd - %""ll" "d"" (%s): Unknown lock type: %"
"d""!", state->resolve.fd_no, uuid_utoa (state->fd->
inode->gfid), state->type); } while (0)
5493 state->resolve.fd_no,do { do { if (0) printf ("fd - %""ll" "d"" (%s): Unknown lock type: %"
"d""!", state->resolve.fd_no, uuid_utoa (state->fd->
inode->gfid), state->type); } while (0); _gf_log (state
->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 5494, GF_LOG_ERROR, "fd - %""ll" "d"" (%s): Unknown lock type: %"
"d""!", state->resolve.fd_no, uuid_utoa (state->fd->
inode->gfid), state->type); } while (0)
5494 uuid_utoa (state->fd->inode->gfid), state->type)do { do { if (0) printf ("fd - %""ll" "d"" (%s): Unknown lock type: %"
"d""!", state->resolve.fd_no, uuid_utoa (state->fd->
inode->gfid), state->type); } while (0); _gf_log (state
->conn->bound_xl->name, "server-rpc-fops.c", __FUNCTION__
, 5494, GF_LOG_ERROR, "fd - %""ll" "d"" (%s): Unknown lock type: %"
"d""!", state->resolve.fd_no, uuid_utoa (state->fd->
inode->gfid), state->type); } while (0)
;
5495 break;
5496 }
5497
5498
5499 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5502, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5502, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5500 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5502, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5502, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5501 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5502, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5502, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5502 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5502, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5502, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5503
5504 ret = 0;
5505 resolve_and_resume (frame, server_lk_resume);
5506out:
5507 free (args.xdata.xdata_val);
5508
5509 free (args.flock.lk_owner.lk_owner_val);
5510
5511 if (op_errno)
5512 req->rpc_err = GARBAGE_ARGS;
5513
5514 return ret;
5515}
5516
5517
5518int
5519server3_3_rchecksum (rpcsvc_request_t *req)
5520{
5521 server_state_t *state = NULL((void*)0);
5522 call_frame_t *frame = NULL((void*)0);
5523 gfs3_rchecksum_req args = {0,};
5524 int ret = -1;
5525 int op_errno = 0;
5526
5527 if (!req)
5528 return ret;
5529
5530 ret = xdr_to_generic (req->msg[0], &args,
5531 (xdrproc_t)xdr_gfs3_rchecksum_req);
5532 if (ret < 0) {
5533 //failed to decode msg;
5534 req->rpc_err = GARBAGE_ARGS;
5535 goto out;
5536 }
5537
5538 frame = get_frame_from_request (req);
5539 if (!frame) {
5540 // something wrong, mostly insufficient memory
5541 req->rpc_err = GARBAGE_ARGS; /* TODO */
5542 goto out;
5543 }
5544 frame->root->op = GF_FOP_RCHECKSUM;
5545
5546 state = CALL_STATE(frame)((server_state_t *)frame->root->state);
5547 if (!state->conn->bound_xl) {
5548 /* auth failure, request on subvolume without setvolume */
5549 req->rpc_err = GARBAGE_ARGS;
5550 goto out;
5551 }
5552
5553 state->resolve.type = RESOLVE_MAY;
5554 state->resolve.fd_no = args.fd;
5555 state->offset = args.offset;
5556 state->size = args.len;
5557
5558 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5561, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5561, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5559 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5561, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5561, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5560 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5561, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5561, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5561 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5561, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5561, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5562
5563 ret = 0;
5564 resolve_and_resume (frame, server_rchecksum_resume);
5565out:
5566 free (args.xdata.xdata_val);
5567
5568 if (op_errno)
5569 req->rpc_err = GARBAGE_ARGS;
5570
5571 return ret;
5572}
5573
5574int
5575server_null (rpcsvc_request_t *req)
5576{
5577 gf_common_rsp rsp = {0,};
5578
5579 /* Accepted */
5580 rsp.op_ret = 0;
5581
5582 server_submit_reply (NULL((void*)0), req, &rsp, NULL((void*)0), 0, NULL((void*)0),
5583 (xdrproc_t)xdr_gf_common_rsp);
5584
5585 return 0;
5586}
5587
5588int
5589server3_3_lookup (rpcsvc_request_t *req)
5590{
5591 call_frame_t *frame = NULL((void*)0);
5592 server_state_t *state = NULL((void*)0);
5593 gfs3_lookup_req args = {{0,},};
5594 int ret = -1;
5595 int op_errno = 0;
5596
5597 GF_VALIDATE_OR_GOTO ("server", req, err)do { if (!req) { (*__errno_location ()) = 22; do { do { if (0
) printf ("invalid argument: " "req"); } while (0); _gf_log_callingfn
("server", "server-rpc-fops.c", __FUNCTION__, 5597, GF_LOG_ERROR
, "invalid argument: " "req"); } while (0); goto err; } } while
(0)
;
5598
5599 args.bname = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
5600 args.xdata.xdata_val = alloca (req->msg[0].iov_len)__builtin_alloca (req->msg[0].iov_len);
5601
5602 ret = xdr_to_generic (req->msg[0], &args,
5603 (xdrproc_t)xdr_gfs3_lookup_req);
5604 if (ret < 0) {
5605 //failed to decode msg;
5606 req->rpc_err = GARBAGE_ARGS;
5607 goto err;
5608 }
5609
5610 frame = get_frame_from_request (req);
5611 if (!frame) {
5612 // something wrong, mostly insufficient memory
5613 req->rpc_err = GARBAGE_ARGS;
5614 goto err;
5615 }
5616 frame->root->op = GF_FOP_LOOKUP;
5617
5618 /* NOTE: lookup() uses req->ino only to identify if a lookup()
5619 * is requested for 'root' or not
5620 */
5621
5622 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
5623 if (!state->conn->bound_xl) {
5624 /* auth failure, request on subvolume without setvolume */
5625 req->rpc_err = GARBAGE_ARGS;
5626 goto out;
5627 }
5628
5629 state->resolve.type = RESOLVE_DONTCARE;
5630
5631 if (args.bname && strcmp (args.bname, "")) {
5632 memcpy (state->resolve.pargfid, args.pargfid, 16);
5633 state->resolve.bname = gf_strdup (args.bname);
5634 } else {
5635 memcpy (state->resolve.gfid, args.gfid, 16);
5636 }
5637
5638 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5641, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5641, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5639 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5641, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5641, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5640 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5641, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5641, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5641 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5641, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5641, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5642
5643 ret = 0;
5644 resolve_and_resume (frame, server_lookup_resume);
5645
5646 return ret;
5647out:
5648
5649 server_lookup_cbk (frame, NULL((void*)0), frame->this, -1, EINVAL22, NULL((void*)0), NULL((void*)0),
5650 NULL((void*)0), NULL((void*)0));
5651 ret = 0;
5652err:
5653 return ret;
5654}
5655
5656int
5657server3_3_statfs (rpcsvc_request_t *req)
5658{
5659 server_state_t *state = NULL((void*)0);
5660 call_frame_t *frame = NULL((void*)0);
5661 gfs3_statfs_req args = {{0,},};
5662 int ret = -1;
5663 int op_errno = 0;
5664
5665 if (!req)
5666 return ret;
5667
5668 ret = xdr_to_generic (req->msg[0], &args,
5669 (xdrproc_t)xdr_gfs3_statfs_req);
5670 if (ret < 0) {
5671 //failed to decode msg;
5672 req->rpc_err = GARBAGE_ARGS;
5673 goto out;
5674 }
5675
5676 frame = get_frame_from_request (req);
5677 if (!frame) {
5678 // something wrong, mostly insufficient memory
5679 req->rpc_err = GARBAGE_ARGS; /* TODO */
5680 goto out;
5681 }
5682 frame->root->op = GF_FOP_STATFS;
5683
5684 state = CALL_STATE (frame)((server_state_t *)frame->root->state);
5685 if (!state->conn->bound_xl) {
5686 /* auth failure, request on subvolume without setvolume */
5687 req->rpc_err = GARBAGE_ARGS;
5688 goto out;
5689 }
5690
5691 state->resolve.type = RESOLVE_MUST;
5692 memcpy (state->resolve.gfid, args.gfid, 16);
5693
5694 GF_PROTOCOL_DICT_UNSERIALIZE (state->conn->bound_xl, state->xdata,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5697, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5697, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5695 (args.xdata.xdata_val),do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5697, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5697, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5696 (args.xdata.xdata_len), ret,do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5697, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5697, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
5697 op_errno, out)do { if (!(args.xdata.xdata_len)) break; state->xdata = dict_new
(); do { if (!state->xdata) { (*__errno_location ()) = 22;
do { do { if (0) printf ("invalid argument: " "state->xdata"
); } while (0); _gf_log_callingfn (state->conn->bound_xl
->name, "server-rpc-fops.c", __FUNCTION__, 5697, GF_LOG_ERROR
, "invalid argument: " "state->xdata"); } while (0); goto out
; } } while (0); ret = dict_unserialize ((args.xdata.xdata_val
), (args.xdata.xdata_len), &state->xdata); if (ret <
0) { do { do { if (0) printf ("failed to unserialize dictionary (%s)"
, ("state->xdata")); } while (0); _gf_log (state->conn->
bound_xl->name, "server-rpc-fops.c", __FUNCTION__, 5697, GF_LOG_WARNING
, "failed to unserialize dictionary (%s)", ("state->xdata"
)); } while (0); op_errno = 22; goto out; } } while (0)
;
5698
5699 ret = 0;
5700 resolve_and_resume (frame, server_statfs_resume);
5701out:
5702 if (op_errno)
5703 req->rpc_err = GARBAGE_ARGS;
5704
5705 return ret;
5706}
5707
5708
5709rpcsvc_actor_t glusterfs3_3_fop_actors[] = {
5710 [GFS3_OP_NULL] = { "NULL", GFS3_OP_NULL, server_null, NULL((void*)0), 0},
5711 [GFS3_OP_STAT] = { "STAT", GFS3_OP_STAT, server3_3_stat, NULL((void*)0), 0},
5712 [GFS3_OP_READLINK] = { "READLINK", GFS3_OP_READLINK, server3_3_readlink, NULL((void*)0), 0},
5713 [GFS3_OP_MKNOD] = { "MKNOD", GFS3_OP_MKNOD, server3_3_mknod, NULL((void*)0), 0},
5714 [GFS3_OP_MKDIR] = { "MKDIR", GFS3_OP_MKDIR, server3_3_mkdir, NULL((void*)0), 0},
5715 [GFS3_OP_UNLINK] = { "UNLINK", GFS3_OP_UNLINK, server3_3_unlink, NULL((void*)0), 0},
5716 [GFS3_OP_RMDIR] = { "RMDIR", GFS3_OP_RMDIR, server3_3_rmdir, NULL((void*)0), 0},
5717 [GFS3_OP_SYMLINK] = { "SYMLINK", GFS3_OP_SYMLINK, server3_3_symlink, NULL((void*)0), 0},
5718 [GFS3_OP_RENAME] = { "RENAME", GFS3_OP_RENAME, server3_3_rename, NULL((void*)0), 0},
5719 [GFS3_OP_LINK] = { "LINK", GFS3_OP_LINK, server3_3_link, NULL((void*)0), 0},
5720 [GFS3_OP_TRUNCATE] = { "TRUNCATE", GFS3_OP_TRUNCATE, server3_3_truncate, NULL((void*)0), 0},
5721 [GFS3_OP_OPEN] = { "OPEN", GFS3_OP_OPEN, server3_3_open, NULL((void*)0), 0},
5722 [GFS3_OP_READ] = { "READ", GFS3_OP_READ, server3_3_readv, NULL((void*)0), 0},
5723 [GFS3_OP_WRITE] = { "WRITE", GFS3_OP_WRITE, server3_3_writev, server3_3_writev_vecsizer, 0},
5724 [GFS3_OP_STATFS] = { "STATFS", GFS3_OP_STATFS, server3_3_statfs, NULL((void*)0), 0},
5725 [GFS3_OP_FLUSH] = { "FLUSH", GFS3_OP_FLUSH, server3_3_flush, NULL((void*)0), 0},
5726 [GFS3_OP_FSYNC] = { "FSYNC", GFS3_OP_FSYNC, server3_3_fsync, NULL((void*)0), 0},
5727 [GFS3_OP_SETXATTR] = { "SETXATTR", GFS3_OP_SETXATTR, server3_3_setxattr, NULL((void*)0), 0},
5728 [GFS3_OP_GETXATTR] = { "GETXATTR", GFS3_OP_GETXATTR, server3_3_getxattr, NULL((void*)0), 0},
5729 [GFS3_OP_REMOVEXATTR] = { "REMOVEXATTR", GFS3_OP_REMOVEXATTR, server3_3_removexattr, NULL((void*)0), 0},
5730 [GFS3_OP_OPENDIR] = { "OPENDIR", GFS3_OP_OPENDIR, server3_3_opendir, NULL((void*)0), 0},
5731 [GFS3_OP_FSYNCDIR] = { "FSYNCDIR", GFS3_OP_FSYNCDIR, server3_3_fsyncdir, NULL((void*)0), 0},
5732 [GFS3_OP_ACCESS] = { "ACCESS", GFS3_OP_ACCESS, server3_3_access, NULL((void*)0), 0},
5733 [GFS3_OP_CREATE] = { "CREATE", GFS3_OP_CREATE, server3_3_create, NULL((void*)0), 0},
5734 [GFS3_OP_FTRUNCATE] = { "FTRUNCATE", GFS3_OP_FTRUNCATE, server3_3_ftruncate, NULL((void*)0), 0},
5735 [GFS3_OP_FSTAT] = { "FSTAT", GFS3_OP_FSTAT, server3_3_fstat, NULL((void*)0), 0},
5736 [GFS3_OP_LK] = { "LK", GFS3_OP_LK, server3_3_lk, NULL((void*)0), 0},
5737 [GFS3_OP_LOOKUP] = { "LOOKUP", GFS3_OP_LOOKUP, server3_3_lookup, NULL((void*)0), 0},
5738 [GFS3_OP_READDIR] = { "READDIR", GFS3_OP_READDIR, server3_3_readdir, NULL((void*)0), 0},
5739 [GFS3_OP_INODELK] = { "INODELK", GFS3_OP_INODELK, server3_3_inodelk, NULL((void*)0), 0},
5740 [GFS3_OP_FINODELK] = { "FINODELK", GFS3_OP_FINODELK, server3_3_finodelk, NULL((void*)0), 0},
5741 [GFS3_OP_ENTRYLK] = { "ENTRYLK", GFS3_OP_ENTRYLK, server3_3_entrylk, NULL((void*)0), 0},
5742 [GFS3_OP_FENTRYLK] = { "FENTRYLK", GFS3_OP_FENTRYLK, server3_3_fentrylk, NULL((void*)0), 0},
5743 [GFS3_OP_XATTROP] = { "XATTROP", GFS3_OP_XATTROP, server3_3_xattrop, NULL((void*)0), 0},
5744 [GFS3_OP_FXATTROP] = { "FXATTROP", GFS3_OP_FXATTROP, server3_3_fxattrop, NULL((void*)0), 0},
5745 [GFS3_OP_FGETXATTR] = { "FGETXATTR", GFS3_OP_FGETXATTR, server3_3_fgetxattr, NULL((void*)0), 0},
5746 [GFS3_OP_FSETXATTR] = { "FSETXATTR", GFS3_OP_FSETXATTR, server3_3_fsetxattr, NULL((void*)0), 0},
5747 [GFS3_OP_RCHECKSUM] = { "RCHECKSUM", GFS3_OP_RCHECKSUM, server3_3_rchecksum, NULL((void*)0), 0},
5748 [GFS3_OP_SETATTR] = { "SETATTR", GFS3_OP_SETATTR, server3_3_setattr, NULL((void*)0), 0},
5749 [GFS3_OP_FSETATTR] = { "FSETATTR", GFS3_OP_FSETATTR, server3_3_fsetattr, NULL((void*)0), 0},
5750 [GFS3_OP_READDIRP] = { "READDIRP", GFS3_OP_READDIRP, server3_3_readdirp, NULL((void*)0), 0},
5751 [GFS3_OP_RELEASE] = { "RELEASE", GFS3_OP_RELEASE, server3_3_release, NULL((void*)0), 0},
5752 [GFS3_OP_RELEASEDIR] = { "RELEASEDIR", GFS3_OP_RELEASEDIR, server3_3_releasedir, NULL((void*)0), 0},
5753 [GFS3_OP_FREMOVEXATTR] = { "FREMOVEXATTR", GFS3_OP_FREMOVEXATTR, server3_3_fremovexattr, NULL((void*)0), 0},
5754};
5755
5756
5757struct rpcsvc_program glusterfs3_3_fop_prog = {
5758 .progname = "GlusterFS 3.3",
5759 .prognum = GLUSTER_FOP_PROGRAM1298437,
5760 .progver = GLUSTER_FOP_VERSION330,
5761 .numactors = GLUSTER_FOP_PROCCNTGFS3_OP_MAXVALUE,
5762 .actors = glusterfs3_3_fop_actors,
5763};