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