From: Nikolay Borisov <nborisov@suse.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 1/2] btrfs: Implement DRW lock
Date: Thu, 30 Jan 2020 16:11:55 +0200 [thread overview]
Message-ID: <2218f3ee-a6ad-ad02-ed19-07a00b88cd2e@suse.com> (raw)
In-Reply-To: <20200130140657.GT3929@twin.jikos.cz>
On 30.01.20 г. 16:06 ч., David Sterba wrote:
> On Thu, Jan 30, 2020 at 03:37:26PM +0200, Nikolay Borisov wrote:
>>> +int btrfs_drw_lock_init(struct btrfs_drw_lock *lock)
>>> +{
>>> + int ret;
>>> +
>>> + ret = percpu_counter_init(&lock->writers, 0, GFP_KERNEL);
>>> + if (ret)
>>> + return ret;
>>> +
>>> + atomic_set(&lock->readers, 0);
>>> + init_waitqueue_head(&lock->pending_readers);
>>> + init_waitqueue_head(&lock->pending_writers);
>>> +
>>> + return 0;
>>> +}
>>> +EXPORT_SYMBOL(btrfs_drw_lock_init);
>>
>> I have the functions EXPORT_SYMBOL since I have an internal patch which
>> is hooking this code to locktorture. SO they can be removed.
>
> You can make the exports conditional, #ifdef LOCKTORTURE.
>
I don't think I will be submitting that patch unless the lock is moved
to lib/. I guess I will just remove it in v3 after review.
next prev parent reply other threads:[~2020-01-30 14:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-30 12:59 [PATCH 0/2] Refactor snapshot vs nocow writers locking Nikolay Borisov
2020-01-30 12:59 ` [PATCH 1/2] btrfs: Implement DRW lock Nikolay Borisov
2020-01-30 13:41 ` Christoph Hellwig
2020-01-30 13:42 ` Nikolay Borisov
2020-01-30 13:43 ` Christoph Hellwig
2020-01-30 12:59 ` [PATCH 2/2] btrfs: convert snapshot/nocow exlcusion to drw lock Nikolay Borisov
2020-01-30 12:59 ` [RESEND PATCH v2 0/2] Refactor snapshot vs nocow writers locking Nikolay Borisov
2020-01-30 14:21 ` David Sterba
2020-02-21 14:51 ` David Sterba
2020-01-30 12:59 ` [PATCH v2 1/2] btrfs: Implement DRW lock Nikolay Borisov
2020-01-30 13:37 ` Nikolay Borisov
2020-01-30 14:06 ` David Sterba
2020-01-30 14:11 ` Nikolay Borisov [this message]
2020-01-30 12:59 ` [PATCH v2 2/2] btrfs: convert snapshot/nocow exlcusion to drw lock Nikolay Borisov
-- strict thread matches above, loose matches on Subject: below --
2019-07-19 8:39 [PATCH v2 0/2] Refactor snapshot vs nocow writers locking Nikolay Borisov
2019-07-19 8:39 ` [PATCH v2 1/2] btrfs: Implement DRW lock Nikolay Borisov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2218f3ee-a6ad-ad02-ed19-07a00b88cd2e@suse.com \
--to=nborisov@suse.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).