On Fri, Oct 13, 2017 at 04:55:58PM +0300, Nikolay Borisov wrote: > > > > > The outstanding_extents accounting is consistent with only the items needed > > to > > handle the outstanding extent items. However since changing the inode > > requires > > updating the inode item as well we have to keep this floating reservation > > for > > the inode item until we have 0 outstanding extents. The way we do this is > > with > > the BTRFS_INODE_DELALLOC_META_RESERVED flag. So if it isn't set we will > > allocate nr_exntents + 1 in btrfs_delalloc_reserve_metadata() and then set > > our > > bit. If we ever steal this reservation we make sure to clear the flag so we > > know we don't have to clean it up when outstanding_extents goes to 0. It's > > not > > super intuitive but needs to be done under the BTRFS_I(inode)->lock so this > > was > > the best place to put it. I suppose we could move the logic out of here > > and put > > it somewhere else to make it more clear. > > I think defining this logic in its own, discrete block of code would be > best w.r.t readibility. It's not super obvious. >
I went to do this and realized that I rip all of this out when we switch to per-inode block rsvs, so I'm just going to leave this patch as is. Thanks, Josef -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html