diff options
| author | Shehjar Tikoo <shehjart@gluster.com> | 2010-02-25 15:38:10 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2010-03-04 03:13:39 -0800 | 
| commit | 727fe837b8f7bfcdd59267f7745398934564543e (patch) | |
| tree | deb4becc3cd5280ea6332f262f330105a450cce9 | |
| parent | 4b2f769dcd18fbb855d7d11b82a61bcca64fc85c (diff) | |
quick-read: Store and propagate wbflags argument in open fop
..this is needed to ensure underlying translators like
write-behind, ioc, etc, do not return zero-filled stats
to NFSx.
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 597 (miscellaneous fixes for xlators to work well with NFS xlator)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=597
| -rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 33 | ||||
| -rw-r--r-- | xlators/performance/quick-read/src/quick-read.h | 1 | 
2 files changed, 22 insertions, 12 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index d3e3bb91d..5dd33486c 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -441,6 +441,7 @@ qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,          qr_fd_ctx->path = strdup (loc->path);          qr_fd_ctx->flags = flags; +        qr_fd_ctx->wbflags = wbflags;          ret = fd_ctx_set (fd, this, (uint64_t)(long)qr_fd_ctx);          if (ret == -1) { @@ -710,7 +711,7 @@ qr_validate_cache (call_frame_t *frame, xlator_t *this, fd_t *fd,                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this),                              FIRST_CHILD(this)->fops->open, -                            &loc, flags, fd, 0); +                            &loc, flags, fd, qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } else if (can_wind) { @@ -951,7 +952,7 @@ out:                          STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this),                                      FIRST_CHILD(this)->fops->open, -                                    &loc, flags, fd, 0); +                                    &loc, flags, fd, qr_fd_ctx->wbflags);                          qr_loc_wipe (&loc);                  } else if (can_wind) { @@ -1085,7 +1086,8 @@ out:                  }                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), -                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, 0); +                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, +                            qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } @@ -1178,7 +1180,8 @@ out:                  }                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), -                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, 0); +                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, +                            qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } @@ -1279,7 +1282,8 @@ out:                  }                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), -                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, 0); +                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, +                            qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } @@ -1377,7 +1381,7 @@ out:                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this),                              FIRST_CHILD(this)->fops->open, &loc, open_flags, -                            fd, 0); +                            fd, qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          }  @@ -1477,7 +1481,8 @@ out:                  }                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), -                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, 0); +                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, +                            qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } @@ -1648,7 +1653,8 @@ out:                  }                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), -                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, 0); +                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, +                            qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } @@ -1747,7 +1753,8 @@ out:                  }                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), -                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, 0); +                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, +                            qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } @@ -1841,7 +1848,7 @@ out:                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this),                              FIRST_CHILD(this)->fops->open, &loc, open_flags, -                            fd, 0); +                            fd, qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } @@ -1986,7 +1993,8 @@ out:                  }                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), -                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, 0); +                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, +                            qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } @@ -2082,7 +2090,8 @@ out:                  }                  STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), -                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, 0); +                            FIRST_CHILD(this)->fops->open, &loc, flags, fd, +                            qr_fd_ctx->wbflags);                  qr_loc_wipe (&loc);          } diff --git a/xlators/performance/quick-read/src/quick-read.h b/xlators/performance/quick-read/src/quick-read.h index 57a7e4d46..5ced44e1d 100644 --- a/xlators/performance/quick-read/src/quick-read.h +++ b/xlators/performance/quick-read/src/quick-read.h @@ -48,6 +48,7 @@ struct qr_fd_ctx {          char              open_in_transit;          char             *path;          int               flags; +        int               wbflags;          struct list_head  waiting_ops;          gf_lock_t         lock;  };  | 
