On Thu 17-12-09 03:35:25, Dmitry Monakhov wrote: > Hi, Jan. > I've prepared additional patch for quota reserved space management. > Initially I've overlooked case when quota is not active, but in fact > it seems reasonable to generalize reservation to that case as we do > for i_block/i_bytes reservation. > Possibly it should be folded in to c35fc5af93955aa22efc6568e5ae5b2cadbc086f > > CHANGE_LOG: > quota: manage reserved space even when quota is not active > Since we implemented generic reserved space management interface, > then it is possible to account reserved space even quota when quota > is not active (similar to i_blocks/i_bytes). Yes, that's reasonable. I'll fold the patch into your "quota: decouple fs reserved space from quota reservation" but please fix things I write below. > diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c > index dea86ab..de7e7de 100644 > --- a/fs/quota/dquot.c > +++ b/fs/quota/dquot.c > @@ -1351,15 +1351,14 @@ static qsize_t *inode_reserved_space(struct inode * inode) > return inode->i_sb->dq_op->get_reserved_space(inode); > } > > -static void inode_add_rsv_space(struct inode *inode, qsize_t number) > +void inode_add_rsv_space(struct inode *inode, qsize_t number) > { > spin_lock(&inode->i_lock); > *inode_reserved_space(inode) += number; > spin_unlock(&inode->i_lock); > } > > - > -static void inode_claim_rsv_space(struct inode *inode, qsize_t number) > +void inode_claim_rsv_space(struct inode *inode, qsize_t number) > { > spin_lock(&inode->i_lock); > *inode_reserved_space(inode) -= number; > @@ -1367,14 +1366,14 @@ static void inode_claim_rsv_space(struct inode *inode, qsize_t number) > spin_unlock(&inode->i_lock); > } > > -static void inode_sub_rsv_space(struct inode *inode, qsize_t number) > +void inode_sub_rsv_space(struct inode *inode, qsize_t number) > { > spin_lock(&inode->i_lock); > *inode_reserved_space(inode) -= number; > spin_unlock(&inode->i_lock); > } The above three functions need to be exported (needed when ext4 is a module). > -static qsize_t inode_get_rsv_space(struct inode *inode) > +qsize_t inode_get_rsv_space(struct inode *inode) I think this does not need to be visible outside. Honza -- Jan Kara <jack@xxxxxxx> SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html