From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 2/3] quota: introduce get_id callback Date: Tue, 2 Feb 2010 17:05:09 +0100 Message-ID: <20100202160509.GI7056@quack.suse.cz> References: <1265122826-5370-1-git-send-email-dmonakhov@openvz.org> <1265122826-5370-2-git-send-email-dmonakhov@openvz.org> <1265122826-5370-3-git-send-email-dmonakhov@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, jack@suse.cz To: Dmitry Monakhov Return-path: Received: from cantor2.suse.de ([195.135.220.15]:54000 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295Ab0BBQFB (ORCPT ); Tue, 2 Feb 2010 11:05:01 -0500 Content-Disposition: inline In-Reply-To: <1265122826-5370-3-git-send-email-dmonakhov@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue 02-02-10 18:00:24, Dmitry Monakhov wrote: > During some quota oparations we have to determine quota_id for given inode > according to quota_type. But only USRQUOTA/GRPQUOTA id are intermediately > accessible from generic vfs-inode. This patch introduce new per_sb quota > operation for this purpose. Hmm, but you do not intend to ever change what is returned for USRQUOTA and GRPQUOTA, do you? So we could just have something like static qid_t generic_get_id(struct inode *inode, int qtype) { switch (qtype) { case USRQUOTA: return inode->i_uid; case GRPQUOTA: return inode->i_gid; default: return inode->i_sb->dq_op->get_id(inode, qtype); } } It's not as elegant as your solution but doing an indirect call to read a value directly accessible (which will be a common case) just seems lame... Honza -- Jan Kara SUSE Labs, CR