"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xlators/features/shard/src/shard.c" between
glusterfs-9.2.tar.gz and glusterfs-9.3.tar.gz

About: GlusterFS is a network/cluster filesystem. The storage server (or each in a cluster) runs glusterfsd and the clients use mount command or glusterfs client to mount the exported filesystem. Release series 9.x (latest version).

shard.c  (glusterfs-9.2):shard.c  (glusterfs-9.3)
skipping to change at line 879 skipping to change at line 879
SHARD_STACK_UNWIND(setattr, frame, op_ret, op_errno, NULL, NULL, SHARD_STACK_UNWIND(setattr, frame, op_ret, op_errno, NULL, NULL,
NULL); NULL);
break; break;
case GF_FOP_FSETATTR: case GF_FOP_FSETATTR:
SHARD_STACK_UNWIND(fsetattr, frame, op_ret, op_errno, NULL, NULL, SHARD_STACK_UNWIND(fsetattr, frame, op_ret, op_errno, NULL, NULL,
NULL); NULL);
break; break;
case GF_FOP_SEEK: case GF_FOP_SEEK:
SHARD_STACK_UNWIND(seek, frame, op_ret, op_errno, 0, NULL); SHARD_STACK_UNWIND(seek, frame, op_ret, op_errno, 0, NULL);
break; break;
case GF_FOP_OPENDIR:
SHARD_STACK_UNWIND(opendir, frame, op_ret, op_errno, 0, NULL);
break;
default: default:
gf_msg(THIS->name, GF_LOG_WARNING, 0, SHARD_MSG_INVALID_FOP, gf_msg(THIS->name, GF_LOG_WARNING, 0, SHARD_MSG_INVALID_FOP,
"Invalid fop id = %d", fop); "Invalid fop id = %d", fop);
break; break;
} }
return 0; return 0;
} }
int int
shard_common_inode_write_success_unwind(glusterfs_fop_t fop, shard_common_inode_write_success_unwind(glusterfs_fop_t fop,
skipping to change at line 956 skipping to change at line 959
"fsync failed on shard"); "fsync failed on shard");
goto out; goto out;
} }
shard_inode = anon_fd->inode; shard_inode = anon_fd->inode;
LOCK(&priv->lock); LOCK(&priv->lock);
LOCK(&shard_inode->lock); LOCK(&shard_inode->lock);
{ {
__shard_inode_ctx_get(shard_inode, this, &ctx); __shard_inode_ctx_get(shard_inode, this, &ctx);
if ((list_empty(&ctx->to_fsync_list)) && (list_empty(&ctx->ilist))) { if ((list_empty(&ctx->to_fsync_list)) && (list_empty(&ctx->ilist))) {
shard_make_block_bname(ctx->block_num, shard_inode->gfid, shard_make_block_bname(ctx->block_num, ctx->base_gfid, block_bname,
block_bname, sizeof(block_bname)); sizeof(block_bname));
inode_unlink(shard_inode, priv->dot_shard_inode, block_bname); inode_unlink(shard_inode, priv->dot_shard_inode, block_bname);
/* The following unref corresponds to the ref held by /* The following unref corresponds to the ref held by
* inode_link() at the time the shard was created or * inode_link() at the time the shard was created or
* looked up * looked up
*/ */
inode_unref(shard_inode); inode_unref(shard_inode);
inode_forget(shard_inode, 0); inode_forget(shard_inode, 0);
} }
} }
UNLOCK(&shard_inode->lock); UNLOCK(&shard_inode->lock);
skipping to change at line 4766 skipping to change at line 4769
int int
shard_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, shard_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
{ {
/* To-Do: Handle open with O_TRUNC under locks */ /* To-Do: Handle open with O_TRUNC under locks */
SHARD_STACK_UNWIND(open, frame, op_ret, op_errno, fd, xdata); SHARD_STACK_UNWIND(open, frame, op_ret, op_errno, fd, xdata);
return 0; return 0;
} }
static int
shard_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
{
SHARD_STACK_UNWIND(open, frame, op_ret, op_errno, fd, xdata);
return 0;
}
int int
shard_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, shard_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
fd_t *fd, dict_t *xdata) fd_t *fd, dict_t *xdata)
{ {
STACK_WIND(frame, shard_open_cbk, FIRST_CHILD(this), STACK_WIND(frame, shard_open_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->open, loc, flags, fd, xdata); FIRST_CHILD(this)->fops->open, loc, flags, fd, xdata);
return 0; return 0;
} }
static int
shard_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
dict_t *xdata)
{
int ret;
xdata = xdata ? dict_ref(xdata) : dict_new();
if (!xdata) {
ret = -1;
goto err;
}
/* if the file is sharded then server will return the below
* xattr as part of dict that is used to update the ia_size
* in d_stat. This is helpful incase readdir-ahead is enabled
*/
ret = dict_set_uint64(xdata, GF_XATTR_SHARD_FILE_SIZE, 8 * 4);
if (ret) {
gf_msg_debug(this->name, -ret,
"Unable to set GF_XATTR_SHARD_FILE_SIZE in the dict ");
goto err;
}
STACK_WIND(frame, shard_opendir_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->opendir, loc, fd, xdata);
dict_unref(xdata);
return 0;
err:
if (xdata)
dict_unref(xdata);
shard_common_failure_unwind(GF_FOP_OPENDIR, frame, -1, ENOMEM);
return 0;
}
int int
shard_readv_do_cbk(call_frame_t *frame, void *cookie, xlator_t *this, shard_readv_do_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iovec *vector, int32_t op_ret, int32_t op_errno, struct iovec *vector,
int32_t count, struct iatt *stbuf, struct iobref *iobref, int32_t count, struct iatt *stbuf, struct iobref *iobref,
dict_t *xdata) dict_t *xdata)
{ {
int i = 0; int i = 0;
int call_count = 0; int call_count = 0;
void *address = NULL; void *address = NULL;
uint64_t block_num = 0; uint64_t block_num = 0;
skipping to change at line 7279 skipping to change at line 7327
int int
shard_releasedir(xlator_t *this, fd_t *fd) shard_releasedir(xlator_t *this, fd_t *fd)
{ {
return 0; return 0;
} }
struct xlator_fops fops = { struct xlator_fops fops = {
.lookup = shard_lookup, .lookup = shard_lookup,
.open = shard_open, .open = shard_open,
.opendir = shard_opendir,
.flush = shard_flush, .flush = shard_flush,
.fsync = shard_fsync, .fsync = shard_fsync,
.stat = shard_stat, .stat = shard_stat,
.fstat = shard_fstat, .fstat = shard_fstat,
.getxattr = shard_getxattr, .getxattr = shard_getxattr,
.fgetxattr = shard_fgetxattr, .fgetxattr = shard_fgetxattr,
.readv = shard_readv, .readv = shard_readv,
.writev = shard_writev, .writev = shard_writev,
.truncate = shard_truncate, .truncate = shard_truncate,
.ftruncate = shard_ftruncate, .ftruncate = shard_ftruncate,
 End of changes. 5 change blocks. 
2 lines changed or deleted 51 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)