From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: [PATCH 12/16][cr][v3]: Add ->fl_break_notified field. Date: Tue, 3 Aug 2010 16:11:33 -0700 Message-ID: <1280877097-12377-13-git-send-email-sukadev@linux.vnet.ibm.com> References: <1280877097-12377-1-git-send-email-sukadev@linux.vnet.ibm.com> Cc: Serge Hallyn , Matt Helsley , Dan Smith , John Stultz , Matthew Wilcox , Jamie Lokier , , Containers To: Oren Laadan Return-path: Received: from e8.ny.us.ibm.com ([32.97.182.138]:43465 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757855Ab0HCXG2 (ORCPT ); Tue, 3 Aug 2010 19:06:28 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by e8.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o73N3uFx002962 for ; Tue, 3 Aug 2010 19:03:56 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o73N6RCv312044 for ; Tue, 3 Aug 2010 19:06:27 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o73N6MBf004384 for ; Tue, 3 Aug 2010 19:06:27 -0400 In-Reply-To: <1280877097-12377-1-git-send-email-sukadev@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: The file_lock->fl_break_notified field will be used when checkpointing and restarting a file-lease. It is needed if the application was checkpointed during the lease-break-protocol, to "remember" if the application was notified of the lease-break. This patch just initializes the ->fl_break_notified field. It will be used in a follow-on patch, when checkpoint/restart of file-leases are implemented. Signed-off-by: Sukadev Bhattiprolu --- fs/locks.c | 7 +++++++ include/linux/fs.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 9a00876..b5eb4c0 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -185,6 +185,7 @@ void locks_init_lock(struct file_lock *fl) fl->fl_flags = 0; fl->fl_type = 0; fl->fl_type_prev = 0; + fl->fl_break_notified = 0; fl->fl_start = fl->fl_end = 0; fl->fl_break_time = 0UL; fl->fl_ops = NULL; @@ -230,6 +231,7 @@ void __locks_copy_lock(struct file_lock *new, const struct file_lock *fl) new->fl_type = fl->fl_type; new->fl_type_prev = fl->fl_type_prev; new->fl_start = fl->fl_start; + new->fl_break_notified = fl->fl_break_notified; new->fl_end = fl->fl_end; new->fl_break_time = 0UL; new->fl_ops = NULL; @@ -458,6 +460,7 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl) fl->fl_file = filp; fl->fl_flags = FL_LEASE; + fl->fl_break_notified = 0; fl->fl_start = 0; fl->fl_end = OFFSET_MAX; fl->fl_ops = NULL; @@ -1141,6 +1144,8 @@ int lease_modify(struct file_lock **before, int arg) struct file_lock *fl = *before; int error = assign_type(fl, arg); + fl->fl_break_notified = 0; + if (error) return error; locks_wake_up_blocks(fl); @@ -1234,8 +1239,10 @@ int __break_lease(struct inode *inode, unsigned int mode) fl->fl_type_prev = fl->fl_type; fl->fl_type = future; fl->fl_break_time = break_time; + /* lease must have lmops break callback */ fl->fl_lmops->fl_break(fl); + fl->fl_break_notified = 1; } } diff --git a/include/linux/fs.h b/include/linux/fs.h index 299cc09..c21f002 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1067,6 +1067,7 @@ struct file_lock { unsigned char fl_flags; unsigned char fl_type; unsigned char fl_type_prev; + unsigned char fl_break_notified; unsigned int fl_pid; struct pid *fl_nspid; wait_queue_head_t fl_wait; -- 1.6.0.4