Re: [PATCH 6/9][cr][v2]: Checkpoint file-locks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 05/18/2010 11:07 PM, Sukadev Bhattiprolu wrote:
> While checkpointing each file-descriptor, find all the locks on the
> file and save information about the lock in the checkpoint-image.
> A follow-on patch will use this informaiton to restore the file-locks.
> 
> Changelog[v2]:
> 	[Matt Helsley]: Use fixed sizes (__s64) instead of 'loff_t' in
> 		'struct ckpt_hdr_file_lock'.
> 	[Matt Helsley, Serge Hallyn]: Highlight new use of BKL (using
> 		lock_flocks() macros as suggested by Serge).
> 	[Matt Helsley]: Reorg code a bit to simplify error handling.
> 	[Matt Helsley]: Reorg code to initialize marker-lock (Pass a
> 		NULL lock to checkpoint_one_lock() to indicate marker).
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxxxxxxx>

[...]

>  
> +static int checkpoint_one_file_lock(struct ckpt_ctx *ctx, struct file *file,
> +		struct file_lock *lock)
> +{
> +	int rc;
> +	struct ckpt_hdr_file_lock *h;
> +
> +	h = ckpt_hdr_get_type(ctx, sizeof(*h), CKPT_HDR_FILE_LOCK);
> +	if (!h)
> +		return -ENOMEM;
> +
> +	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).

[...]

Oren.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux