Re: [PATCH v1 05/10] Btrfs: add nested locking mode for paths

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

 



On Thu, Dec 22, 2011 at 05:03:19PM +0100, Jan Schmidt wrote:
> From: Arne Jansen <sensille@xxxxxxx>
> 
> This patch adds the possibilty to read-lock an extent even if it is already
> write-locked from the same thread. btrfs_find_all_roots() needs this
> capability.

I'd rather not add a nested flag to the locking code, lets just make the
nesting explicitly allowed.

You shouldn't need locks around lock->owner.  Either your process owns
the lock (and it won't change away from your pid), or you don't own it
and it won't be your pid.  Just make sure the owner field gets cleared
when you do your final unlock.

So, if you are the owner of a write lock, you can add more write locks
or a read lock as required.

Could you please describe the case where btrfs_find_all_roots needs
this?

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


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux