lkml.org 
[lkml]   [2012]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -V3 5/8] hugetlbfs: Add memcg control files for hugetlbfs
On Wed, 14 Mar 2012 16:40:58 +0530 "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> wrote:

> >
> > > +int mem_cgroup_hugetlb_file_init(struct hstate *h, int idx);
> >
> >
> > No, please put it in a header file. Always. Where both callers and
> > the implementation see the same propotype.
> >
> > > +#else
> > > +static int mem_cgroup_hugetlb_file_init(struct hstate *h, int idx)
> > > +{
> > > + return 0;
> > > +}
> > > +#endif
> >
> > So this will go into the same header file.
> >
>
> I was not sure whether i want to put mem_cgroup_hugetlb_file_init in
> linux/memcontrol.h .

The above is a declaration, not the definition (implementation).

> Ideally i want to have that in mm/hugetlb.c and in
> linux/hugetlb.h. That would require me to make mem_cgroup_read and
> others non static and move few #defines to memcontrol.h. That would
> involve larger code movement which i didn't want to do. ? What do you
> suggest ? Just move mem_cgroup_hugetlb_file_init to memcontrol.h ?

In memcontrol.h:

#ifdef CONFIG_FOO
extern int mem_cgroup_hugetlb_file_init(struct hstate *h, int idx);
#else
static inline int mem_cgroup_hugetlb_file_init(struct hstate *h, int idx)
{
return 0;
}
#endif

?


\
 
 \ /
  Last update: 2012-03-14 12:35    [W:0.718 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site