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.