From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: [PATCH 05/17][cr][v4]: Move file_lock macros into linux/fs.h Date: Mon, 16 Aug 2010 12:43:09 -0700 Message-ID: <1281987801-1293-6-git-send-email-sukadev@linux.vnet.ibm.com> References: <1281987801-1293-1-git-send-email-sukadev@linux.vnet.ibm.com> Cc: Serge Hallyn , Matt Helsley , Dan Smith , John Stultz , Matthew Wilcox , Jamie Lokier , Steven Whitehouse , , Containers To: Oren Laadan Return-path: Received: from e4.ny.us.ibm.com ([32.97.182.144]:55275 "EHLO e4.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756103Ab0HPThw (ORCPT ); Mon, 16 Aug 2010 15:37:52 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o7GJNBHg008080 for ; Mon, 16 Aug 2010 15:23:11 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7GJboec308958 for ; Mon, 16 Aug 2010 15:37:50 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7GJbbiH015133 for ; Mon, 16 Aug 2010 13:37:38 -0600 In-Reply-To: <1281987801-1293-1-git-send-email-sukadev@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Move IS_POSIX(), IS_FLOCK(), IS_LEASE() and 'for_each_lock()' into include/linux/fs.h since these are also needed to checkpoint/restart file-locks. Signed-off-by: Sukadev Bhattiprolu --- fs/locks.c | 7 ------- include/linux/fs.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index ca0c7e2..741b8b7 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -130,16 +130,9 @@ #include -#define IS_POSIX(fl) (fl->fl_flags & FL_POSIX) -#define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) -#define IS_LEASE(fl) (fl->fl_flags & FL_LEASE) - int leases_enable = 1; int lease_break_time = 45; -#define for_each_lock(inode, lockp) \ - for (lockp = &inode->i_flock; *lockp != NULL; lockp = &(*lockp)->fl_next) - static LIST_HEAD(file_lock_list); static LIST_HEAD(blocked_list); diff --git a/include/linux/fs.h b/include/linux/fs.h index b4a6fb0..abd2267 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1088,6 +1088,13 @@ struct file_lock { } fl_u; }; +#define IS_POSIX(fl) (fl->fl_flags & FL_POSIX) +#define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) +#define IS_LEASE(fl) (fl->fl_flags & FL_LEASE) + +#define for_each_lock(inode, lockp) \ + for (lockp = &inode->i_flock; *lockp != NULL; lockp = &(*lockp)->fl_next) + /* The following constant reflects the upper bound of the file/locking space */ #ifndef OFFSET_MAX #define INT_LIMIT(x) (~((x)1 << (sizeof(x)*8 - 1))) -- 1.6.0.4