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