- optimize remove wrt recovery pushes?
uclient
+- fix client_lock vs other mutex with C_SafeCond
- clean up check_caps to more closely mirror kclient logic
- readdir from cache
- fix readdir vs fragment race by keeping a separate frag pos, and ignoring dentries below it
ceph_statfs stats;
+ Mutex lock("Client::statfs::lock");
Cond cond;
bool done;
+ int rval;
- objecter->get_fs_stats(stats, new C_Cond(&cond, &done));
+ objecter->get_fs_stats(stats, new C_SafeCond(&lock, &cond, &done, &rval));
- while(!done)
- cond.Wait(client_lock);
+ client_lock.Unlock();
+ lock.Lock();
+ while (!done)
+ cond.Wait(lock);
+ lock.Unlock();
+ client_lock.Lock();
memset(stbuf, 0, sizeof(*stbuf));
//divide the results by 4 to give them as Posix expects
stbuf->f_flag = 0; // ??
stbuf->f_namemax = PAGE_SIZE; // ??
- return 0;
+ return rval;
}
int Client::ll_statfs(vinodeno_t vino, struct statvfs *stbuf)
}
};
-class C_Cond : public Context {
- Cond *cond;
- bool *done;
- int *rval;
-public:
- C_Cond(Cond *c, bool *d, int *r=0) : cond(c), done(d), rval(r) {
- *done = false;
- }
- void finish(int r) {
- if (rval) *rval = r;
- *done = true;
- cond->Signal();
- }
-};
-
class C_SafeCond : public Context {
Mutex *lock;
Cond *cond;