From 15f7b4de1124a37a53c7ddb5635b005322b23025 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 2 Jun 2014 12:54:52 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/7946 Reviewed-by: Harshavardhana Reviewed-by: Emmanuel Dreyfus Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/snapview-server/src/snapview-server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/features/snapview-server') 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); -- cgit