From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: Re: [PATCH 6/9][cr][v2]: Checkpoint file-locks Date: Wed, 28 Jul 2010 14:29:50 -0700 Message-ID: <20100728212950.GA10505@us.ibm.com> References: <1274238452-15382-1-git-send-email-sukadev@linux.vnet.ibm.com> <1274238452-15382-7-git-send-email-sukadev@linux.vnet.ibm.com> <4C16FDE7.7050709@cs.columbia.edu> <20100728192649.GB14570@us.ibm.com> <4C50882A.4000505@cs.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: serue@us.ibm.com, Matt Helsley , matthew@wil.cx, linux-fsdevel@vger.kernel.org, Containers To: Oren Laadan Return-path: Received: from e33.co.us.ibm.com ([32.97.110.151]:52551 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753085Ab0G1VYh (ORCPT ); Wed, 28 Jul 2010 17:24:37 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e33.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o6SLJvrX013037 for ; Wed, 28 Jul 2010 15:19:57 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o6SLONJQ161354 for ; Wed, 28 Jul 2010 15:24:23 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o6SLOMJb008515 for ; Wed, 28 Jul 2010 15:24:22 -0600 Content-Disposition: inline In-Reply-To: <4C50882A.4000505@cs.columbia.edu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Oren Laadan [orenl@cs.columbia.edu] wrote: > > > Sukadev Bhattiprolu wrote: >> Oren Laadan [orenl@cs.columbia.edu] wrote: >> | | | > + if (lock) { >> | > + h->fl_start = lock->fl_start; >> | > + h->fl_end = lock->fl_end; >> | > + h->fl_type = lock->fl_type; >> | > + h->fl_flags = lock->fl_flags; >> | > + } else { >> | > + /* Checkpoint a dummy lock as a marker */ >> | > + h->fl_start = -1; >> | | Maybe designate some constant for this ? e.g. CKPT_FLOCK_NONE ? >> | In any case, you need a (loff_t) -1 (like in the restore code). >> >> Ok. Defining macros CKPT_HDR_SET_MARKER_LOCK() and >> CKPT_HDR_CHECK_MARKER_LOCK(). Also added the missing (loff_t). > > The nice thing about #define CKPT_FLOCK_NONE -1 - see also > the CKPT_PID_NULL, when defined in checkpoint_hdr.h, is that > they are intentionally visible to userspace too. The problem is marker lock is currently identified by two fields: .fl_start = -1; .fl_type = FL_POSIX. so CKPT_FLOCK_NONE appears misleading if it only refers to one field. Should I say CKPT_FLOCK_NONE_START and CKPT_FLOCK_NONE_TYPE ? Or, can we make CKPT_CHECK_MARKER_LOCK() and CKPT_SET_MARKER_LOCK() available to user space ? Sukadev