lkml.org 
[lkml]   [2008]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] quota: Add a convenience macro for filesystems
On Wed 30-04-08 12:29:11, Andrew Morton wrote:
> On Wed, 30 Apr 2008 17:06:18 +0200
> Jan Kara <jack@suse.cz> wrote:
>
> > Note that it cannot be an inline function because we don't have struct
> > super_block prototype...
> >
>
> lame excuse ;)
Well, yes but since fs.h includes quota.h to be able to define struct
super_block (needs at least MAXQUOTAS constant) this is kind of chicken and
egg problem. Splitting quota.h into two files is probably the way to go...
I'll include it to my quotaops.h and quota.h cleanups I'm slowly working
on.

> > ---
> > include/linux/quota.h | 3 +++
> > 1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/linux/quota.h b/include/linux/quota.h
> > index 52e49dc..dcddfb2 100644
> > --- a/include/linux/quota.h
> > +++ b/include/linux/quota.h
> > @@ -347,6 +347,9 @@ struct quota_info {
> > ((type) == USRQUOTA ? (sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED) : \
> > (sb_dqopt(sb)->flags & DQUOT_GRP_SUSPENDED))
> >
> > +#define sb_any_quota_suspended(sb) (sb_has_quota_suspended(sb, USRQUOTA) | \
> > + sb_has_quota_suspended(sb, GRPQUOTA))
> > +
> > int register_quota_format(struct quota_format_type *fmt);
> > void unregister_quota_format(struct quota_format_type *fmt);
>
>
> Here's a fun exercise:
>
> sb = sb_orig;
> sb_any_quota_suspended(sb++);
> printk("%d\n", sb - sb_orig);
>
> afaict this will print 44 or thereabouts.
>
> ho hum.
;)

Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR


\
 
 \ /
  Last update: 2008-05-05 12:05    [W:0.105 / U:1.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site