"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xlators/cluster/afr/src/afr-dir-read.c" between
glusterfs-9.1.tar.gz and glusterfs-9.2.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).

afr-dir-read.c  (glusterfs-9.1):afr-dir-read.c  (glusterfs-9.2)
skipping to change at line 166 skipping to change at line 166
* read_subvol_args here. * read_subvol_args here.
*/ */
entry_read_subvol = afr_data_subvol_get(inode, this, NULL, NULL, NULL, entry_read_subvol = afr_data_subvol_get(inode, this, NULL, NULL, NULL,
NULL); NULL);
if (entry_read_subvol != par_read_subvol) if (entry_read_subvol != par_read_subvol)
return -1; return -1;
return 0; return 0;
} }
static void static int32_t
afr_readdir_transform_entries(call_frame_t *frame, gf_dirent_t *subvol_entries, afr_readdir_transform_entries(call_frame_t *frame, gf_dirent_t *subvol_entries,
int subvol, gf_dirent_t *entries, fd_t *fd) int subvol, gf_dirent_t *entries, fd_t *fd)
{ {
int ret = -1; int ret = -1;
gf_dirent_t *entry = NULL; gf_dirent_t *entry = NULL;
gf_dirent_t *tmp = NULL; gf_dirent_t *tmp = NULL;
xlator_t *this = NULL; xlator_t *this = NULL;
afr_private_t *priv = NULL; afr_private_t *priv = NULL;
gf_boolean_t need_heal = _gf_false; gf_boolean_t need_heal = _gf_false;
gf_boolean_t validate_subvol = _gf_false; gf_boolean_t validate_subvol = _gf_false;
int32_t count = 0;
this = THIS; this = THIS;
priv = this->private; priv = this->private;
need_heal = afr_get_need_heal(this); need_heal = afr_get_need_heal(this);
validate_subvol = need_heal | priv->consistent_metadata; validate_subvol = need_heal | priv->consistent_metadata;
list_for_each_entry_safe(entry, tmp, &subvol_entries->list, list) list_for_each_entry_safe(entry, tmp, &subvol_entries->list, list)
{ {
if (afr_is_private_directory(priv, fd->inode->gfid, entry->d_name, if (afr_is_private_directory(priv, fd->inode->gfid, entry->d_name,
frame->root->pid)) { frame->root->pid)) {
continue; continue;
} }
list_del_init(&entry->list); list_del_init(&entry->list);
list_add_tail(&entry->list, &entries->list); list_add_tail(&entry->list, &entries->list);
count++;
if (!validate_subvol) if (!validate_subvol)
continue; continue;
if (entry->inode) { if (entry->inode) {
ret = afr_validate_read_subvol(entry->inode, this, subvol); ret = afr_validate_read_subvol(entry->inode, this, subvol);
if (ret == -1) { if (ret == -1) {
inode_unref(entry->inode); inode_unref(entry->inode);
entry->inode = NULL; entry->inode = NULL;
continue; continue;
} }
} }
} }
return count;
} }
int32_t int32_t
afr_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, afr_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, gf_dirent_t *subvol_entries, int32_t op_ret, int32_t op_errno, gf_dirent_t *subvol_entries,
dict_t *xdata) dict_t *xdata)
{ {
afr_local_t *local = NULL; afr_local_t *local = NULL;
gf_dirent_t entries; gf_dirent_t entries;
skipping to change at line 231 skipping to change at line 235
/* failover only if this was first readdir, detected /* failover only if this was first readdir, detected
by offset == 0 */ by offset == 0 */
local->op_ret = op_ret; local->op_ret = op_ret;
local->op_errno = op_errno; local->op_errno = op_errno;
afr_read_txn_continue(frame, this, (long)cookie); afr_read_txn_continue(frame, this, (long)cookie);
return 0; return 0;
} }
if (op_ret >= 0) if (op_ret >= 0)
afr_readdir_transform_entries(frame, subvol_entries, (long)cookie, op_ret = afr_readdir_transform_entries(frame, subvol_entries,
&entries, local->fd); (long)cookie, &entries,
local->fd);
AFR_STACK_UNWIND(readdir, frame, op_ret, op_errno, &entries, xdata); AFR_STACK_UNWIND(readdir, frame, op_ret, op_errno, &entries, xdata);
gf_dirent_free(&entries); gf_dirent_free(&entries);
return 0; return 0;
} }
int int
afr_readdir_wind(call_frame_t *frame, xlator_t *this, int subvol) afr_readdir_wind(call_frame_t *frame, xlator_t *this, int subvol)
 End of changes. 5 change blocks. 
3 lines changed or deleted 8 lines changed or added

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