Commit 858f0993 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

aio: ifdef fields in mm_struct

->ioctx_lock and ->ioctx_list are used only under CONFIG_AIO.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Cc: Zach Brown <zach.brown@oracle.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b873c2f3
...@@ -259,11 +259,10 @@ struct mm_struct { ...@@ -259,11 +259,10 @@ struct mm_struct {
unsigned long flags; /* Must use atomic bitops to access the bits */ unsigned long flags; /* Must use atomic bitops to access the bits */
struct core_state *core_state; /* coredumping support */ struct core_state *core_state; /* coredumping support */
#ifdef CONFIG_AIO
/* aio bits */
spinlock_t ioctx_lock; spinlock_t ioctx_lock;
struct hlist_head ioctx_list; struct hlist_head ioctx_list;
#endif
#ifdef CONFIG_MM_OWNER #ifdef CONFIG_MM_OWNER
/* /*
* "owner" points to a task that is regarded as the canonical * "owner" points to a task that is regarded as the canonical
......
...@@ -434,6 +434,14 @@ __setup("coredump_filter=", coredump_filter_setup); ...@@ -434,6 +434,14 @@ __setup("coredump_filter=", coredump_filter_setup);
#include <linux/init_task.h> #include <linux/init_task.h>
static void mm_init_aio(struct mm_struct *mm)
{
#ifdef CONFIG_AIO
spin_lock_init(&mm->ioctx_lock);
INIT_HLIST_HEAD(&mm->ioctx_list);
#endif
}
static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p) static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p)
{ {
atomic_set(&mm->mm_users, 1); atomic_set(&mm->mm_users, 1);
...@@ -447,10 +455,9 @@ static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p) ...@@ -447,10 +455,9 @@ static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p)
set_mm_counter(mm, file_rss, 0); set_mm_counter(mm, file_rss, 0);
set_mm_counter(mm, anon_rss, 0); set_mm_counter(mm, anon_rss, 0);
spin_lock_init(&mm->page_table_lock); spin_lock_init(&mm->page_table_lock);
spin_lock_init(&mm->ioctx_lock);
INIT_HLIST_HEAD(&mm->ioctx_list);
mm->free_area_cache = TASK_UNMAPPED_BASE; mm->free_area_cache = TASK_UNMAPPED_BASE;
mm->cached_hole_size = ~0UL; mm->cached_hole_size = ~0UL;
mm_init_aio(mm);
mm_init_owner(mm, p); mm_init_owner(mm, p);
if (likely(!mm_alloc_pgd(mm))) { if (likely(!mm_alloc_pgd(mm))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment