[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/6] ext2fs: use a seperate lock to protect nodehash
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 3/6] ext2fs: use a seperate lock to protect nodehash |
Date: |
Mon, 2 Jun 2014 10:19:09 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Mon 02 Jun 2014 07:24:59 +0200, a écrit :
> Quoting Samuel Thibault (2014-06-02 03:41:55)
> > Justus Winter, le Sun 01 Jun 2014 22:03:01 +0200, a écrit :
> > > @@ -46,8 +46,18 @@
> > > #define INOHASH(ino) (((unsigned)(ino))%INOHSZ)
> > > #endif
> > >
> > > +/* The nodehash is a cache of nodes.
> > > +
> > > + Access to nodehash and nodehash_nr_items is protected by
> > > + nodecache_lock.
> > > +
> > > + Every node in the nodehash carries a light reference. When we are
> > > + asked to give up that light reference, we reacquire our lock
> > > + momentarily to check whether someone else reacquired a reference
> > > + through the nodehash. */
> > > static struct node *nodehash[INOHSZ];
> > > static size_t nodehash_nr_items;
> > > +static pthread_rwlock_t nodecache_lock = PTHREAD_RWLOCK_INITIALIZER;
> >
> > Please also document that this is to be taken before
> > diskfs_node_refcnt_lock.
>
> Actually, the whole point of this excercise is to get rid of
> diskfs_node_refcnt_lock.
Ok :)
But in the meanwhile, please document it :)
Samuel