summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/server/src/server-common.c')
-rw-r--r--xlators/protocol/server/src/server-common.c53
1 files changed, 23 insertions, 30 deletions
diff --git a/xlators/protocol/server/src/server-common.c b/xlators/protocol/server/src/server-common.c
index b5d61edccfb..cd79cf4d930 100644
--- a/xlators/protocol/server/src/server-common.c
+++ b/xlators/protocol/server/src/server-common.c
@@ -1,13 +1,13 @@
#include "server.h"
-#include "defaults.h"
+#include <glusterfs/defaults.h>
#include "rpc-common-xdr.h"
#include "glusterfs3-xdr.h"
#include "glusterfs3.h"
-#include "compat-errno.h"
+#include <glusterfs/compat-errno.h>
#include "server-messages.h"
#include "server-helpers.h"
-#include "defaults.h"
-#include "fd.h"
+#include <glusterfs/defaults.h>
+#include <glusterfs/fd.h>
#include "xdr-nfs3.h"
void
@@ -21,11 +21,8 @@ server_post_stat(server_state_t *state, gfs3_stat_rsp *rsp, struct iatt *stbuf)
we use inode table which is shared by everyone, but
make sure we send fops only from subdir and below,
we have to alter inode gfid and send it to client */
- uuid_t gfid = {
- 0,
- };
+ static uuid_t gfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
- gfid[15] = 1;
stbuf->ia_ino = 1;
gf_uuid_copy(stbuf->ia_gfid, gfid);
}
@@ -182,11 +179,8 @@ server_post_fstat(server_state_t *state, gfs3_fstat_rsp *rsp,
we use inode table which is shared by everyone, but
make sure we send fops only from subdir and below,
we have to alter inode gfid and send it to client */
- uuid_t gfid = {
- 0,
- };
+ static uuid_t gfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
- gfid[15] = 1;
stbuf->ia_ino = 1;
gf_uuid_copy(stbuf->ia_gfid, gfid);
}
@@ -454,9 +448,7 @@ server_post_lookup(gfs3_lookup_rsp *rsp, call_frame_t *frame,
{
inode_t *root_inode = NULL;
inode_t *link_inode = NULL;
- uuid_t rootgfid = {
- 0,
- };
+ static uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
root_inode = frame->root->client->bound_xl->itable->root;
@@ -480,7 +472,6 @@ server_post_lookup(gfs3_lookup_rsp *rsp, call_frame_t *frame,
make sure we send fops only from subdir and below,
we have to alter inode gfid and send it to client */
stbuf->ia_ino = 1;
- rootgfid[15] = 1;
gf_uuid_copy(stbuf->ia_gfid, rootgfid);
if (inode->ia_type == 0)
inode->ia_type = stbuf->ia_type;
@@ -521,11 +512,8 @@ server4_post_common_3iatt(server_state_t *state, gfx_common_3iatt_rsp *rsp,
we use inode table which is shared by everyone, but
make sure we send fops only from subdir and below,
we have to alter inode gfid and send it to client */
- uuid_t gfid = {
- 0,
- };
+ static uuid_t gfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
- gfid[15] = 1;
preparent->ia_ino = 1;
postparent->ia_ino = 1;
gf_uuid_copy(preparent->ia_gfid, gfid);
@@ -541,6 +529,16 @@ server4_post_common_3iatt(server_state_t *state, gfx_common_3iatt_rsp *rsp,
}
void
+server4_post_common_3iatt_noinode(gfx_common_3iatt_rsp *rsp, struct iatt *stbuf,
+ struct iatt *prebuf_dst,
+ struct iatt *postbuf_dst)
+{
+ gfx_stat_from_iattx(&rsp->stat, stbuf);
+ gfx_stat_from_iattx(&rsp->preparent, prebuf_dst);
+ gfx_stat_from_iattx(&rsp->postparent, postbuf_dst);
+}
+
+void
server4_post_common_2iatt(gfx_common_2iatt_rsp *rsp, struct iatt *prebuf,
struct iatt *postbuf)
{
@@ -581,11 +579,8 @@ server4_post_common_iatt(server_state_t *state, gfx_common_iatt_rsp *rsp,
we use inode table which is shared by everyone, but
make sure we send fops only from subdir and below,
we have to alter inode gfid and send it to client */
- uuid_t gfid = {
- 0,
- };
+ static uuid_t gfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
- gfid[15] = 1;
stbuf->ia_ino = 1;
gf_uuid_copy(stbuf->ia_gfid, gfid);
}
@@ -646,7 +641,8 @@ server4_post_rchecksum(gfx_rchecksum_rsp *rsp, uint32_t weak_checksum,
uint8_t *strong_checksum)
{
rsp->weak_checksum = weak_checksum;
-
+ /* When the length encoding changes, update the change
+ in posix code also. */
rsp->strong_checksum.strong_checksum_val = (char *)strong_checksum;
rsp->strong_checksum.strong_checksum_len = SHA256_DIGEST_LENGTH;
rsp->flags = 1; /* Indicates SHA256 TYPE */
@@ -791,9 +787,7 @@ server4_post_lookup(gfx_common_2iatt_rsp *rsp, call_frame_t *frame,
{
inode_t *root_inode = NULL;
inode_t *link_inode = NULL;
- uuid_t rootgfid = {
- 0,
- };
+ static uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
root_inode = frame->root->client->bound_xl->itable->root;
@@ -817,7 +811,6 @@ server4_post_lookup(gfx_common_2iatt_rsp *rsp, call_frame_t *frame,
make sure we send fops only from subdir and below,
we have to alter inode gfid and send it to client */
stbuf->ia_ino = 1;
- rootgfid[15] = 1;
gf_uuid_copy(stbuf->ia_gfid, rootgfid);
if (inode->ia_type == 0)
inode->ia_type = stbuf->ia_type;
@@ -835,7 +828,7 @@ server4_post_lease(gfx_lease_rsp *rsp, struct gf_lease *lease)
void
server4_post_link(server_state_t *state, gfx_common_3iatt_rsp *rsp,
inode_t *inode, struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata)
+ struct iatt *postparent)
{
inode_t *link_inode = NULL;