Re: [PATCH 11/16] GFS2: Quota and LVB handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux