Merge 531af601a1
into b109925820
This commit is contained in:
commit
ac8f5063c7
|
@ -1816,31 +1816,15 @@ dnode_try_claim(objset_t *os, uint64_t object, int slots)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checks if the dnode itself is dirty, or is carrying any uncommitted records.
|
* Check if the dnode (including its data) is dirty on this or any future txg.
|
||||||
* It is important to check both conditions, as some operations (eg appending
|
|
||||||
* to a file) can dirty both as a single logical unit, but they are not synced
|
|
||||||
* out atomically, so checking one and not the other can result in an object
|
|
||||||
* appearing to be clean mid-way through a commit.
|
|
||||||
*
|
|
||||||
* Do not change this lightly! If you get it wrong, dmu_offset_next() can
|
|
||||||
* detect a hole where there is really data, leading to silent corruption.
|
|
||||||
*/
|
*/
|
||||||
boolean_t
|
boolean_t
|
||||||
dnode_is_dirty(dnode_t *dn)
|
dnode_is_dirty(dnode_t *dn)
|
||||||
{
|
{
|
||||||
mutex_enter(&dn->dn_mtx);
|
mutex_enter(&dn->dn_mtx);
|
||||||
|
boolean_t dirty = DNODE_IS_DIRTY(dn);
|
||||||
for (int i = 0; i < TXG_SIZE; i++) {
|
|
||||||
if (multilist_link_active(&dn->dn_dirty_link[i]) ||
|
|
||||||
!list_is_empty(&dn->dn_dirty_records[i])) {
|
|
||||||
mutex_exit(&dn->dn_mtx);
|
|
||||||
return (B_TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_exit(&dn->dn_mtx);
|
mutex_exit(&dn->dn_mtx);
|
||||||
|
return (dirty);
|
||||||
return (B_FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue