// ** fall-thru **
case TransContext::STATE_AIO_WAIT:
- if (!txc->fds.empty()) {
+ if (!txc->sync_items.empty()) {
txc->state = TransContext::STATE_FSYNC_WAIT;
if (!g_conf->newstore_sync_io) {
_txc_queue_fsync(txc);
{
dout(20) << __func__ << " txc " << txc << dendl;
fsync_wq.lock();
- for (list<fsync_item>::iterator p = txc->fds.begin();
- p != txc->fds.end();
+ for (list<fsync_item>::iterator p = txc->sync_items.begin();
+ p != txc->sync_items.end();
++p) {
fsync_wq._enqueue(&*p);
fsync_wq._wake();
void NewStore::_txc_do_sync_fsync(TransContext *txc)
{
dout(20) << __func__ << " txc " << txc << dendl;
- for (list<fsync_item>::iterator p = txc->fds.begin();
- p != txc->fds.end(); ++p) {
+ for (list<fsync_item>::iterator p = txc->sync_items.begin();
+ p != txc->sync_items.end(); ++p) {
dout(30) << __func__ << " fsync " << p->fd << dendl;
int r = ::fdatasync(p->fd);
if (r < 0) {
uint64_t ops, bytes;
- list<fsync_item> fds; ///< these fds need to be synced
+ list<fsync_item> sync_items; ///< these fds need to be synced
set<OnodeRef> onodes; ///< these onodes need to be updated/written
KeyValueDB::Transaction t; ///< then we will commit this
Context *oncommit; ///< signal on commit
}
void sync_fd(int f) {
- fds.push_back(fsync_item(f, this));
+ sync_items.push_back(fsync_item(f, this));
}
void write_onode(OnodeRef &o) {
onodes.insert(o);
bool finish_fsync() {
Mutex::Locker l(lock);
++num_fsyncs_completed;
- if (num_fsyncs_completed == fds.size()) {
+ if (num_fsyncs_completed == sync_items.size()) {
cond.Signal();
return true;
}
}
void wait_fsync() {
Mutex::Locker l(lock);
- while (num_fsyncs_completed < fds.size())
+ while (num_fsyncs_completed < sync_items.size())
cond.Wait(lock);
}
};