From: Steven Whitehouse <swhiteho@redhat.com>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: linux-kernel@vger.kernel.org,
Russell Cattelan <cattelan@redhat.com>,
David Teigland <teigland@redhat.com>, Ingo Molnar <mingo@elte.hu>,
hch@infradead.org
Subject: Re: [PATCH 11/16] GFS2: Quota and LVB handling
Date: Tue, 05 Sep 2006 15:23:42 +0100 [thread overview]
Message-ID: <1157466222.3384.1019.camel@quoit.chygwyn.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0609051142550.32409@yvahk01.tjqt.qr>
Hi,
On Tue, 2006-09-05 at 11:56 +0200, Jan Engelhardt wrote:
> >+static uint64_t qd2offset(struct gfs2_quota_data *qd)
> >+{
> >+ uint64_t offset;
> >+
> >+ offset = 2 * (uint64_t)qd->qd_id + !test_bit(QDF_USER, &qd->qd_flags);
>
> At the moment this (test_bit) might work, because the only other quota besides
> USER is GROUP. But think of XFS, it has a third quota type. With !test_bit, +1
> would be added for GROUP and PROJECT (3rd xfs quota type), although PROJECT
> would likely need +2 by then.
>
Yes, I think that might have to go on the todo list for now though as
its a more invasive change.
>
> >+static int sort_qd(const void *a, const void *b)
> >+{
Now with early returns and const.
> >+ x = qc->qc_change;
> >+ x = be64_to_cpu(x) + change;
> >+ qc->qc_change = cpu_to_be64(x);
>
> There probably is a reason (apart from styling, Ingo) why it's not
>
> qc->qc_change = cpu_to_be64(be64_to_cpu(qc->qc_change) + change);
>
> Do some architectures do this conversion in more than one step? That is, is
> there risk of having undefined behavior in the expression evaluation of above
> statement like there is in ..?
>
> printf("%d\n", c, modify_int(&c));
>
I've left this as it is for the time being, but I can't see a reason why
that should be a problem myself.
> >+static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
> >+ int64_t change, struct gfs2_quota_data *qd)
> >+{
> >+ unsigned offset = loc & (PAGE_CACHE_SHIFT - 1);
> >+ void *kaddr;
> >+ __be64 *ptr;
> >+
> >+ kaddr = kmap_atomic(page, KM_USER0);
> >+ ptr = (__be64 *)(kaddr + offset);
>
> Nocast I'd say.
>
ok.
> >+#if 0
> >+ qd->qd_qb.qb_limit = cpu_to_be64(q.qu_limit);
> >+ qd->qd_qb.qb_warn = cpu_to_be64(q.qu_warn);
> >+#endif
>
> Enable or disable.
>
> >+#if 0
>
> Yes or no. :)
>
All removed now. The patch is:
http://www.kernel.org/git/?p=linux/kernel/git/steve/gfs2-2.6.git;a=commitdiff;h=48fac1790935ef2f9548d92e7c8ba604d1b80c12
Steve.
next prev parent reply other threads:[~2006-09-05 14:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-31 13:38 Steven Whitehouse
2006-09-05 9:56 ` Jan Engelhardt
2006-09-05 14:23 ` Steven Whitehouse [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-04-21 16:20 Steven Whitehouse
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=1157466222.3384.1019.camel@quoit.chygwyn.com \
--to=swhiteho@redhat.com \
--cc=cattelan@redhat.com \
--cc=hch@infradead.org \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=teigland@redhat.com \
/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
all inboxes | Powered by JetHome®