linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-fsdevel@vger.kernel.org, jack@suse.cz
Subject: Re: [PATCH 2/3] quota: introduce  get_id callback
Date: Tue, 2 Feb 2010 17:05:09 +0100	[thread overview]
Message-ID: <20100202160509.GI7056@quack.suse.cz> (raw)
In-Reply-To: <1265122826-5370-3-git-send-email-dmonakhov@openvz.org>

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 <jack@suse.cz>
SUSE Labs, CR

  parent reply	other threads:[~2010-02-02 16:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 15:00 [PATCH 0/3] quota: RFC add extend quota types Dmitry Monakhov
2010-02-02 15:00 ` [PATCH 1/3] quota: generalize quota transfer interface Dmitry Monakhov
2010-02-02 15:00   ` [PATCH 2/3] quota: introduce get_id callback Dmitry Monakhov
2010-02-02 15:00     ` [PATCH 3/3] quota: add generic treeid quota support Dmitry Monakhov
2010-02-02 16:10       ` Jan Kara
2010-02-02 16:05     ` Jan Kara [this message]
2010-02-03  5:38       ` [PATCH 2/3] quota: introduce get_id callback Dmitry Monakhov
2010-02-03 10:47         ` Jan Kara
2010-02-03 19:54           ` Dmitry Monakhov
2010-02-02 15:48   ` [PATCH 1/3] quota: generalize quota transfer interface Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100202160509.GI7056@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=dmonakhov@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).