Re: [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Cedric Le Goater
Date: Saturday, August 2, 2008 - 12:38 am

Matt Helsley wrote:

I'm not sure the inline is really useful. In that case, we could probably do 
something like the following : 

include/linux/freezer.h :

	#ifdef CONFIG_CGROUP_FREEZER

	extern int cgroup_frozen(struct task_struct *task);

	#else /* !CONFIG_CGROUP_FREEZER */

	static inline int cgroup_frozen(struct task_struct *task)
	{
		return 0;
	}

	#endif /* !CONFIG_CGROUP_FREEZER */

and in kernel/cgroup_freezer.c:

	int cgroup_frozen(struct task_struct *task)
	{
		struct freezer *freezer;
		enum freezer_state state;

		task_lock(task);
		freezer = task_freezer(task);
		state = freezer->state;
		task_unlock(task);

		return state == STATE_FROZEN;
	}

and kill include/linux/cgroup_freezer.h ? 

Thanks Matt,

C.



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 3/6] Container Freezer: Implement freezer cgrou ..., Cedric Le Goater, (Sat Aug 2, 12:38 am)