summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2014-06-02 12:54:52 +0530
committerVijay Bellur <vbellur@redhat.com>2014-06-02 22:34:17 -0700
commit15f7b4de1124a37a53c7ddb5635b005322b23025 (patch)
treef520ffa0a5392d83eeb93a48e0c179106892427f
parent294b9548489c04b7ae30ed4706cc7176d8b8780b (diff)
snapview-server: use telldir api to get the offset of the dentry
* dirent structure (struct dirent) in NetBSD does not contain the offset member. Direct access of offset from struct dirent (used here to copy its contents to gf_dirent_t structure after making readdir call) causes glusterfs build failures on NetBSD. So like posix does, use telldir api to get the offset of the dentry (in this case glfs_telldir). Change-Id: I72472c16cbf55dd99ea80ba982b0a4205e6ebffb BUG: 1103591 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/7946 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/features/snapview-server/src/snapview-server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c
index 655372347fb..dcc62bd43b6 100644
--- a/xlators/features/snapview-server/src/snapview-server.c
+++ b/xlators/features/snapview-server/src/snapview-server.c
@@ -925,6 +925,8 @@ svs_revalidate (xlator_t *this, loc_t *loc, inode_t *parent,
*/
if (!loc->name || !parent_ctx) {
*op_errno = ESTALE;
+ gf_log (this->name, GF_LOG_ERROR, "%s is NULL",
+ loc->name?"parent context":"loc->name");
goto out;
}
@@ -936,8 +938,6 @@ svs_revalidate (xlator_t *this, loc_t *loc, inode_t *parent,
op_ret = svs_lookup_entry (this, loc, buf, postparent,
parent, parent_ctx,
op_errno);
- if (op_ret)
- *op_errno = ESTALE;
goto out;
}
@@ -1600,7 +1600,7 @@ svs_glfs_readdir (xlator_t *this, glfs_fd_t *glfd, gf_dirent_t *entries,
strerror (errno));
break;
}
- entry->d_off = de.d_off;
+ entry->d_off = glfs_telldir (glfd);
entry->d_ino = de.d_ino;
entry->d_type = de.d_type;
iatt_from_stat (buf, &statbuf);