Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 70910
b: refs/heads/master
c: b1a8c17
h: refs/heads/master
v: v3
  • Loading branch information
Dhaval Giani authored and Ingo Molnar committed Oct 17, 2007
1 parent 85a465e commit 233576b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 908a7c1b9b80d06708177432020c80d147754691
refs/heads/master: b1a8c172c318534b96d0f0f1aecdad3898118b98
2 changes: 2 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,12 @@ struct user_struct {

#ifdef CONFIG_FAIR_USER_SCHED
struct task_group *tg;
#ifdef CONFIG_SYSFS
struct kset kset;
struct subsys_attribute user_attr;
struct work_struct work;
#endif
#endif
};

#ifdef CONFIG_FAIR_USER_SCHED
Expand Down
23 changes: 15 additions & 8 deletions trunk/kernel/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ static inline struct user_struct *uid_hash_find(uid_t uid,

#ifdef CONFIG_FAIR_USER_SCHED

static struct kobject uids_kobject; /* represents /sys/kernel/uids directory */
static DEFINE_MUTEX(uids_mutex);

static void sched_destroy_user(struct user_struct *up)
{
sched_destroy_group(up->tg);
Expand All @@ -111,6 +108,19 @@ static void sched_switch_user(struct task_struct *p)
sched_move_task(p);
}

#else /* CONFIG_FAIR_USER_SCHED */

static void sched_destroy_user(struct user_struct *up) { }
static int sched_create_user(struct user_struct *up) { return 0; }
static void sched_switch_user(struct task_struct *p) { }

#endif /* CONFIG_FAIR_USER_SCHED */

#if defined(CONFIG_FAIR_USER_SCHED) && defined(CONFIG_SYSFS)

static struct kobject uids_kobject; /* represents /sys/kernel/uids directory */
static DEFINE_MUTEX(uids_mutex);

static inline void uids_mutex_lock(void)
{
mutex_lock(&uids_mutex);
Expand Down Expand Up @@ -257,11 +267,8 @@ static inline void free_user(struct user_struct *up, unsigned long flags)
schedule_work(&up->work);
}

#else /* CONFIG_FAIR_USER_SCHED */
#else /* CONFIG_FAIR_USER_SCHED && CONFIG_SYSFS */

static void sched_destroy_user(struct user_struct *up) { }
static int sched_create_user(struct user_struct *up) { return 0; }
static void sched_switch_user(struct task_struct *p) { }
static inline int user_kobject_create(struct user_struct *up) { return 0; }
static inline void uids_mutex_lock(void) { }
static inline void uids_mutex_unlock(void) { }
Expand All @@ -280,7 +287,7 @@ static inline void free_user(struct user_struct *up, unsigned long flags)
kmem_cache_free(uid_cachep, up);
}

#endif /* CONFIG_FAIR_USER_SCHED */
#endif

/*
* Locate the user_struct for the passed UID. If found, take a ref on it. The
Expand Down

0 comments on commit 233576b

Please sign in to comment.