diff --git a/kernel/lib_mapfree.h b/kernel/lib_mapfree.h index 3a484d2d..7b45551e 100644 --- a/kernel/lib_mapfree.h +++ b/kernel/lib_mapfree.h @@ -49,7 +49,7 @@ extern int mapfree_grace_keep_mb; enum dirty_stage { DIRTY_SUBMITTED, - DIRTY_COMPLETED, + DIRTY_COMPLETING, DIRTY_FINISHED, /* Keep this the last element */ DIRTY_MAX diff --git a/kernel/mars_aio.c b/kernel/mars_aio.c index 58d02fb5..57abdd74 100644 --- a/kernel/mars_aio.c +++ b/kernel/mars_aio.c @@ -187,7 +187,7 @@ loff_t get_total_size(struct aio_output *output) * appended by a write operation, but the data has not actually hit * the page cache, such that a concurrent read gets NULL blocks. */ - return mf_dirty_length(output->mf, DIRTY_COMPLETED); + return mf_dirty_length(output->mf, DIRTY_COMPLETING); } static int aio_ref_get(struct aio_output *output, struct mref_object *mref) @@ -294,7 +294,8 @@ void _complete(struct aio_output *output, struct aio_mref_aspect *mref_a, int er /* Needs to be done before callback, which might modify * mref->.+ */ - mf_dirty_append(output->mf, DIRTY_FINISHED, mref->ref_pos + mref->ref_len); + mf_dirty_append(output->mf, DIRTY_FINISHED, + mref->ref_pos + mref->ref_len); } CHECKED_CALLBACK(mref, err, err_found); @@ -737,7 +738,8 @@ static int aio_event_thread(void *data) mapfree_set(output->mf, mref->ref_pos, mref->ref_pos + mref->ref_len); if (mref->ref_flags & MREF_WRITE) - mf_dirty_append(output->mf, DIRTY_COMPLETED, mref->ref_pos + mref->ref_len); + mf_dirty_append(output->mf, DIRTY_COMPLETING, + mref->ref_pos + mref->ref_len); /* Workaround for never implemented aio_fsync operation, * see also upstream commit 723c038475b78edc9327eb952f95f9881cc9d7. @@ -1024,7 +1026,8 @@ static int aio_submit_thread(void *data) mapfree_set(output->mf, mref->ref_pos, -1); if (mref->ref_flags & MREF_WRITE) { - mf_dirty_append(output->mf, DIRTY_SUBMITTED, mref->ref_pos + mref->ref_len); + mf_dirty_append(output->mf, DIRTY_SUBMITTED, + mref->ref_pos + mref->ref_len); } mref->ref_total_size = get_total_size(output); diff --git a/kernel/mars_sio.c b/kernel/mars_sio.c index 5360737f..19de9a67 100644 --- a/kernel/mars_sio.c +++ b/kernel/mars_sio.c @@ -416,12 +416,14 @@ void _sio_ref_io(struct sio_threadinfo *tinfo, struct mref_object *mref) if (!(mref->ref_flags & MREF_WRITE)) { status = read_aops(output, mref); } else { - mf_dirty_append(output->mf, DIRTY_SUBMITTED, mref->ref_pos + mref->ref_len); + mf_dirty_append(output->mf, DIRTY_SUBMITTED, + mref->ref_pos + mref->ref_len); status = write_aops(output, mref); if (status >= 0) { if (barrier || output->brick->o_fdsync) sync_file(output); - mf_dirty_append(output->mf, DIRTY_COMPLETED, mref->ref_pos + mref->ref_len); + mf_dirty_append(output->mf, DIRTY_COMPLETING, + mref->ref_pos + mref->ref_len); } } diff --git a/kernel/sy_old/sy_generic.c b/kernel/sy_old/sy_generic.c index 847b0e28..6dd22d9f 100644 --- a/kernel/sy_old/sy_generic.c +++ b/kernel/sy_old/sy_generic.c @@ -1470,7 +1470,7 @@ int get_inode(char *newpath, struct mars_dent *dent, bool get_deleted) dent->d_corr_A = 0; dent->d_corr_B = 0; - min = mf_get_any_dirty(newpath, DIRTY_COMPLETED); + min = mf_get_any_dirty(newpath, DIRTY_COMPLETING); if (min < dent->new_stat.size) { MARS_DBG("file '%s' A size=%lld min=%lld\n", newpath, dent->new_stat.size, min); dent->d_corr_A = min;