if (in->cap_refs[CEPH_CAP_RDCACHE] == 0)
in->get_cap_ref(CEPH_CAP_RDCACHE);
- objectcacher->file_read(in->inode.ino, &in->inode.layout, offset, l, NULL, 0, 0);
+ // readahead?
+ if (f->nr_consec_read) {
+ loff_t l = f->consec_read_bytes * 2;
+ l = MAX(l, g_conf.client_readahead_min);
+ l = MIN(l, MIN(g_conf.client_readahead_max_bytes,
+ g_conf.client_readahead_max_periods
+ * ceph_file_layout_period(in->inode.layout)));
+ dout(10) << "readahead " << f->nr_consec_read << " reads "
+ << f->consec_read_bytes << " bytes ... readahead " << offset << "~" << l
+ << " (caller wants " << offset << "~" << size << ")" << dendl;
++ #warning bleh
++ //objectcacher->file_read(in->inode.ino, &in->inode.layout, offset, l, NULL, 0, 0);
+ dout(10) << "readahead initiated" << dendl;
+ }
+
// read (and possibly block)
- r = objectcacher->file_read(in->inode.ino, &in->inode.layout, offset, size, bl, 0, onfinish);
+ #warning bleh
+ //r = objectcacher->file_read(in->inode.ino, &in->inode.layout, offset, size, bl, 0, onfinish);
if (r == 0) {
while (!done)
int get_stripe_width(int fd);
int get_stripe_period(int fd);
int enumerate_layout(int fd, list<ObjectExtent>& result,
- off_t length, off_t offset);
+ loff_t length, loff_t offset);
+ int mksnap(const char *path, const char *name);
+ int rmsnap(const char *path, const char *name);
+
// low-level interface
int ll_lookup(inodeno_t parent, const char *name, struct stat *attr, int uid = -1, int gid = -1);
bool ll_forget(inodeno_t ino, int count);
map<object_t, bufferlist*> read_data; // bits of data as they come back
int flags;
- OSDRead(bufferlist *b, int f) : bl(b), onfinish(0), flags(f) {
+ OSDRead(vector<snapid_t> &s, bufferlist *b, int f) : OSDOp(s), bl(b), onfinish(0), flags(f) {
- bl->clear();
+ if (bl)
+ bl->clear();
}
};