We can't use the internal utime_t type here.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
ObjectReadOperation() {}
~ObjectReadOperation() {}
- void stat(uint64_t *psize, int *prval);
+ void stat(uint64_t *psize, time_t *pmtime, int *prval);
void getxattr(const char *name, bufferlist *pbl, int *prval);
void getxattrs(std::map<std::string, bufferlist> *pattrs, int *prval);
void read(size_t off, uint64_t len, bufferlist *pbl, int *prval);
o->call(cls, method, inbl);
}
-void librados::ObjectReadOperation::stat(uint64_t *psize, int *prval)
+void librados::ObjectReadOperation::stat(uint64_t *psize, time_t *pmtime, int *prval)
{
::ObjectOperation *o = (::ObjectOperation *)impl;
- o->stat(psize, NULL, prval);
+ o->stat(psize, pmtime, prval);
}
void librados::ObjectReadOperation::read(size_t off, uint64_t len, bufferlist *pbl, int *prval)
bufferlist bl;
uint64_t *psize;
utime_t *pmtime;
- C_ObjectOperation_stat(uint64_t *ps, utime_t *pm) : psize(ps), pmtime(pm) {}
+ time_t *ptime;
+ C_ObjectOperation_stat(uint64_t *ps, utime_t *pm, time_t *pt) : psize(ps), pmtime(pm), ptime(pt) {}
void finish(int r) {
if (r >= 0) {
bufferlist::iterator p = bl.begin();
*psize = size;
if (pmtime)
*pmtime = mtime;
+ if (ptime)
+ *ptime = mtime.sec();
}
catch (buffer::error& e) {
r = -EIO;
};
void stat(uint64_t *psize, utime_t *pmtime, int *prval) {
unsigned p = ops.size() - 1;
- C_ObjectOperation_stat *h = new C_ObjectOperation_stat(psize, pmtime);
+ C_ObjectOperation_stat *h = new C_ObjectOperation_stat(psize, pmtime, NULL);
+ out_bl[p] = &h->bl;
+ out_handler[p] = h;
+ out_rval[p] = prval;
+ }
+ void stat(uint64_t *psize, time_t *ptime, int *prval) {
+ unsigned p = ops.size() - 1;
+ C_ObjectOperation_stat *h = new C_ObjectOperation_stat(psize, NULL, ptime);
out_bl[p] = &h->bl;
out_handler[p] = h;
out_rval[p] = prval;
ObjectReadOperation op;
op.getxattrs(&attrset, NULL);
- op.stat(&size, NULL);
+ op.stat(&size, &mtime, NULL);
if (first_chunk) {
op.read(0, RGW_MAX_CHUNK_SIZE, first_chunk, NULL);
}