From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by kanga.kvack.org (Postfix) with ESMTP id 3DC3C6B0083 for ; Fri, 24 Oct 2014 18:06:47 -0400 (EDT) Received: by mail-pd0-f171.google.com with SMTP id r10so2183707pdi.16 for ; Fri, 24 Oct 2014 15:06:46 -0700 (PDT) Received: from homiemail-a38.g.dreamhost.com (homie.mail.dreamhost.com. [208.97.132.208]) by mx.google.com with ESMTP id b11si2991419pdj.220.2014.10.24.15.06.46 for ; Fri, 24 Oct 2014 15:06:46 -0700 (PDT) From: Davidlohr Bueso Subject: [PATCH 01/10] mm,fs: introduce helpers around the i_mmap_mutex Date: Fri, 24 Oct 2014 15:06:11 -0700 Message-Id: <1414188380-17376-2-git-send-email-dave@stgolabs.net> In-Reply-To: <1414188380-17376-1-git-send-email-dave@stgolabs.net> References: <1414188380-17376-1-git-send-email-dave@stgolabs.net> Sender: owner-linux-mm@kvack.org List-ID: To: akpm@linux-foundation.org Cc: hughd@google.com, riel@redhat.com, mgorman@suse.de, peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, dbueso@suse.de, linux-mm@kvack.org, Davidlohr Bueso Various parts of the kernel acquire and release this mutex, so add i_mmap_lock_write() and immap_unlock_write() helper functions that will encapsulate this logic. The next patch will make use of these. Signed-off-by: Davidlohr Bueso Reviewed-by: Rik van Riel --- include/linux/fs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index a957d43..042d5c6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -454,6 +454,16 @@ struct block_device { int mapping_tagged(struct address_space *mapping, int tag); +static inline void i_mmap_lock_write(struct address_space *mapping) +{ + mutex_lock(&mapping->i_mmap_mutex); +} + +static inline void i_mmap_unlock_write(struct address_space *mapping) +{ + mutex_unlock(&mapping->i_mmap_mutex); +} + /* * Might pages of this file be mapped into userspace? */ -- 1.8.4.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org