Patchwork [BUG:2240] performance/quick-read: disable caching for fds opened with GF_OPEN_NOWB flags.

login
register
Submitter Raghavendra G
Date 2011-02-03 07:26:28
Message ID <20110203072628.GA13011@dev.gluster.com>
Download mbox | patch
Permalink /patch/6115/
State Accepted
Delegated to: Anand Avati
Headers show

Comments

Raghavendra G - 2011-02-03 07:26:28
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
---
 xlators/performance/quick-read/src/quick-read.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Shehjar Tikoo - 2011-02-10 09:39:22
Reviewed OK.

Raghavendra G wrote:
> Signed-off-by: Raghavendra G <raghavendra@gluster.com>
> ---
>  xlators/performance/quick-read/src/quick-read.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
> index dd87114..6f56a64 100644
> --- a/xlators/performance/quick-read/src/quick-read.c
> +++ b/xlators/performance/quick-read/src/quick-read.c
> @@ -645,7 +645,8 @@ qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
>  
>          if (!content_cached || ((flags & O_ACCMODE) == O_WRONLY)
>              || ((flags & O_TRUNC) == O_TRUNC)
> -            || ((flags & O_DIRECT) == O_DIRECT)) {
> +            || ((flags & O_DIRECT) == O_DIRECT)
> +            || ((wbflags & GF_OPEN_NOWB) != 0)) {
>                  LOCK (&qr_fd_ctx->lock);
>                  {
>                          /*
> @@ -654,7 +655,8 @@ qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
>                           */
>  
>                          qr_fd_ctx->open_in_transit = 1;
> -                        if ((flags & O_DIRECT) == O_DIRECT) {
> +                        if (((flags & O_DIRECT) == O_DIRECT)
> +                            || ((wbflags & GF_OPEN_NOWB)) != 0) {
>                                  qr_fd_ctx->disabled = 1;
>                          }
>                  }

Patch

diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index dd87114..6f56a64 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -645,7 +645,8 @@  qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
 
         if (!content_cached || ((flags & O_ACCMODE) == O_WRONLY)
             || ((flags & O_TRUNC) == O_TRUNC)
-            || ((flags & O_DIRECT) == O_DIRECT)) {
+            || ((flags & O_DIRECT) == O_DIRECT)
+            || ((wbflags & GF_OPEN_NOWB) != 0)) {
                 LOCK (&qr_fd_ctx->lock);
                 {
                         /*
@@ -654,7 +655,8 @@  qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
                          */
 
                         qr_fd_ctx->open_in_transit = 1;
-                        if ((flags & O_DIRECT) == O_DIRECT) {
+                        if (((flags & O_DIRECT) == O_DIRECT)
+                            || ((wbflags & GF_OPEN_NOWB)) != 0) {
                                 qr_fd_ctx->disabled = 1;
                         }
                 }