[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180205012754.23615-16-dbueso@wotan.suse.de>
Date: Mon, 5 Feb 2018 02:27:05 +0100
From: Davidlohr Bueso <dbueso@...e.de>
To: akpm@...ux-foundation.org, mingo@...nel.org
Cc: peterz@...radead.org, ldufour@...ux.vnet.ibm.com, jack@...e.cz,
mhocko@...nel.org, kirill.shutemov@...ux.intel.com,
mawilcox@...rosoft.com, mgorman@...hsingularity.net,
dave@...olabs.net, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Davidlohr Bueso <dbueso@...e.de>
Subject: [PATCH 15/64] ipc: use mm locking wrappers
From: Davidlohr Bueso <dave@...olabs.net>
This is straightforward as the necessary syscalls already
know about mmrange. No change in semantics.
Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
---
ipc/shm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ipc/shm.c b/ipc/shm.c
index 6c29c791c7f2..4ab752647ca9 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -1398,7 +1398,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg,
if (err)
goto out_fput;
- if (down_write_killable(¤t->mm->mmap_sem)) {
+ if (mm_write_lock_killable(current->mm, &mmrange)) {
err = -EINTR;
goto out_fput;
}
@@ -1419,7 +1419,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg,
if (IS_ERR_VALUE(addr))
err = (long)addr;
invalid:
- up_write(¤t->mm->mmap_sem);
+ mm_write_unlock(current->mm, &mmrange);
if (populate)
mm_populate(addr, populate);
@@ -1494,7 +1494,7 @@ SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
if (addr & ~PAGE_MASK)
return retval;
- if (down_write_killable(&mm->mmap_sem))
+ if (mm_write_lock_killable(mm, &mmrange))
return -EINTR;
/*
@@ -1585,7 +1585,7 @@ SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
#endif
- up_write(&mm->mmap_sem);
+ mm_write_unlock(mm, &mmrange);
return retval;
}
--
2.13.6
Powered by blists - more mailing lists