From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752491Ab3FYAWO (ORCPT ); Mon, 24 Jun 2013 20:22:14 -0400 Received: from g4t0014.houston.hp.com ([15.201.24.17]:14417 "EHLO g4t0014.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751044Ab3FYAVr (ORCPT ); Mon, 24 Jun 2013 20:21:47 -0400 From: Davidlohr Bueso To: mingo@kernel.org, akpm@linux-foundation.org Cc: walken@google.com, alex.shi@intel.com, tim.c.chen@linux.intel.com, a.p.zijlstra@chello.nl, riel@redhat.com, peter@hurleysoftware.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Davidlohr Bueso Subject: [PATCH 1/5] mm,fs: introduce helpers around i_mmap_mutex Date: Mon, 24 Jun 2013 17:21:34 -0700 Message-Id: <1372119698-13147-2-git-send-email-davidlohr.bueso@hp.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1372119698-13147-1-git-send-email-davidlohr.bueso@hp.com> References: <1372119698-13147-1-git-send-email-davidlohr.bueso@hp.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- include/linux/fs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 65c2be2..1ea6c68 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -475,6 +475,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.7.11.7