From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [PATCH 12/17][cr][v4]: Add ->fl_break_notified field. Date: Thu, 16 Sep 2010 20:07:35 -0400 Message-ID: <4C92B147.9040008@cs.columbia.edu> References: <1281987801-1293-1-git-send-email-sukadev@linux.vnet.ibm.com> <1281987801-1293-13-git-send-email-sukadev@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Serge Hallyn , Matt Helsley , Dan Smith , John Stultz , Matthew Wilcox , Jamie Lokier , Steven Whitehouse , linux-fsdevel@vger.kernel.org, Containers To: Sukadev Bhattiprolu Return-path: Received: from brinza.cc.columbia.edu ([128.59.29.8]:45507 "EHLO brinza.cc.columbia.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755183Ab0IQAIb (ORCPT ); Thu, 16 Sep 2010 20:08:31 -0400 In-Reply-To: <1281987801-1293-13-git-send-email-sukadev@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Same nit as for previous patch :) Oren. On 08/16/2010 03:43 PM, Sukadev Bhattiprolu wrote: > 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;