lkml.org 
[lkml]   [2006]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 11/16] GFS2: Quota and LVB handling
From
Date
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.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-05 16:21    [W:0.130 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site