17b94a
From a3fd2c9d85bbd23131c985599d9c9d74f66f32d2 Mon Sep 17 00:00:00 2001
17b94a
From: Pranith Kumar K <pkarampu@redhat.com>
17b94a
Date: Thu, 10 Oct 2019 10:50:59 +0530
17b94a
Subject: [PATCH 520/526] performance/open-behind: seek fop should
17b94a
 open_and_resume
17b94a
17b94a
Upstream patch:
17b94a
> Upstream-patch-link: https://review.gluster.org/#/c/glusterfs/+/23530
17b94a
> fixes: bz#1760187
17b94a
> Change-Id: I4c6ad13194d4fc5c7705e35bf9a27fce504b51f9
17b94a
> Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
17b94a
17b94a
BUG: 1830713
17b94a
Change-Id: I4c6ad13194d4fc5c7705e35bf9a27fce504b51f9
17b94a
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/224484
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
17b94a
---
17b94a
 xlators/performance/open-behind/src/open-behind.c | 27 +++++++++++++++++++++++
17b94a
 1 file changed, 27 insertions(+)
17b94a
17b94a
diff --git a/xlators/performance/open-behind/src/open-behind.c b/xlators/performance/open-behind/src/open-behind.c
17b94a
index 268c717..3ee3c40 100644
17b94a
--- a/xlators/performance/open-behind/src/open-behind.c
17b94a
+++ b/xlators/performance/open-behind/src/open-behind.c
17b94a
@@ -711,6 +711,32 @@ err:
17b94a
 }
17b94a
 
17b94a
 int
17b94a
+ob_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
17b94a
+        gf_seek_what_t what, dict_t *xdata)
17b94a
+{
17b94a
+    call_stub_t *stub = NULL;
17b94a
+    fd_t *wind_fd = NULL;
17b94a
+
17b94a
+    wind_fd = ob_get_wind_fd(this, fd, NULL);
17b94a
+
17b94a
+    stub = fop_seek_stub(frame, default_seek_resume, wind_fd, offset, what,
17b94a
+                         xdata);
17b94a
+
17b94a
+    fd_unref(wind_fd);
17b94a
+
17b94a
+    if (!stub)
17b94a
+        goto err;
17b94a
+
17b94a
+    open_and_resume(this, wind_fd, stub);
17b94a
+
17b94a
+    return 0;
17b94a
+err:
17b94a
+    STACK_UNWIND_STRICT(fstat, frame, -1, ENOMEM, 0, 0);
17b94a
+
17b94a
+    return 0;
17b94a
+}
17b94a
+
17b94a
+int
17b94a
 ob_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
17b94a
 {
17b94a
     call_stub_t *stub = NULL;
17b94a
@@ -1276,6 +1302,7 @@ struct xlator_fops fops = {
17b94a
     .flush = ob_flush,
17b94a
     .fsync = ob_fsync,
17b94a
     .fstat = ob_fstat,
17b94a
+    .seek = ob_seek,
17b94a
     .ftruncate = ob_ftruncate,
17b94a
     .fsetxattr = ob_fsetxattr,
17b94a
     .setxattr = ob_setxattr,
17b94a
-- 
17b94a
1.8.3.1
17b94a