From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: [RFC][cr][PATCH 1/6] Move file_lock macros into linux/fs.h Date: Tue, 4 May 2010 22:30:49 -0700 Message-ID: <20100505053049.GA20993@us.ibm.com> References: <20100505053016.GA20483@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Containers , linux-fsdevel@vger.kernel.org, serue@us.ibm.com, matthltc@us.ibm.com, sukadev@us.ibm.com To: Oren Laadan Return-path: Received: from e37.co.us.ibm.com ([32.97.110.158]:60218 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755047Ab0EEFYl (ORCPT ); Wed, 5 May 2010 01:24:41 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e37.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o455N2oZ001869 for ; Tue, 4 May 2010 23:23:02 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o455Oewc148068 for ; Tue, 4 May 2010 23:24:40 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o455OdSs018460 for ; Tue, 4 May 2010 23:24:39 -0600 Content-Disposition: inline In-Reply-To: <20100505053016.GA20483@us.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: >>From 3c9fd11b0bdd12ba7b3f78e7fc810f1d83ca6986 Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Thu, 29 Apr 2010 23:33:39 -0700 Subject: [RFC][cr][PATCH 1/6] Move file_lock macros into linux/fs.h 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 9cd859e..da53795 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 ee725ff..909a535 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