Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-23 Thread Serge E. Hallyn
Quoting Paul Dickson ([EMAIL PROTECTED]): > On Mon, 14 May 2007 13:23:06 -0700, Badari Pulavarty wrote: > > > > + while (fs) { > > > + locked = union_trylock(fs->root); > > > + if (!locked) > > > + goto loop1; > > > + locked = union_trylock(fs->altroot); >

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-23 Thread Serge E. Hallyn
Quoting Paul Dickson ([EMAIL PROTECTED]): On Mon, 14 May 2007 13:23:06 -0700, Badari Pulavarty wrote: + while (fs) { + locked = union_trylock(fs-root); + if (!locked) + goto loop1; + locked = union_trylock(fs-altroot); + if

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-22 Thread Jan Engelhardt
On May 19 2007 03:18, Paul Dickson wrote: > >How about getting rid of the gotos: > > while (fs) { > locked = union_trylock(fs->root); > if (locked) { > locked = union_trylock(fs->altroot); > if (locked) { >

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-22 Thread Jan Engelhardt
On May 19 2007 03:18, Paul Dickson wrote: How about getting rid of the gotos: while (fs) { locked = union_trylock(fs-root); if (locked) { locked = union_trylock(fs-altroot); if (locked) {

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-19 Thread Paul Dickson
On Mon, 14 May 2007 13:23:06 -0700, Badari Pulavarty wrote: > > + while (fs) { > > + locked = union_trylock(fs->root); > > + if (!locked) > > + goto loop1; > > + locked = union_trylock(fs->altroot); > > + if (!locked) > > +

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-19 Thread Paul Dickson
On Mon, 14 May 2007 13:23:06 -0700, Badari Pulavarty wrote: + while (fs) { + locked = union_trylock(fs-root); + if (!locked) + goto loop1; + locked = union_trylock(fs-altroot); + if (!locked) + goto loop2;

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-15 Thread Jan Blunck
On 5/14/07, Jan Engelhardt <[EMAIL PROTECTED]> wrote: >+static inline void union_lock(struct dentry *dentry) >+{ >+ if (unlikely(dentry && dentry->d_union)) { >+ struct union_info *ui = dentry->d_union; >+ >+ UM_DEBUG_LOCK("\"%s\" locking %p (count=%d)\n", >+

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-15 Thread Bharata B Rao
On Mon, May 14, 2007 at 03:40:57PM -0700, Badari Pulavarty wrote: > On Mon, 2007-05-14 at 15:10 +0530, Bharata B Rao wrote: < snip > > > + > > +/* Shouldn't be called with last reference to union_info */ > > +static inline void union_put_and_unlock(struct union_info *uinfo) > > +{ > > +

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-15 Thread Bharata B Rao
On Mon, May 14, 2007 at 03:40:57PM -0700, Badari Pulavarty wrote: On Mon, 2007-05-14 at 15:10 +0530, Bharata B Rao wrote: snip + +/* Shouldn't be called with last reference to union_info */ +static inline void union_put_and_unlock(struct union_info *uinfo) +{ + union_put(uinfo); +

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-15 Thread Jan Blunck
On 5/14/07, Jan Engelhardt [EMAIL PROTECTED] wrote: +static inline void union_lock(struct dentry *dentry) +{ + if (unlikely(dentry dentry-d_union)) { + struct union_info *ui = dentry-d_union; + + UM_DEBUG_LOCK(\%s\ locking %p (count=%d)\n, +

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Badari Pulavarty
On Mon, 2007-05-14 at 15:10 +0530, Bharata B Rao wrote: > From: Jan Blunck <[EMAIL PROTECTED]> > Subject: Introduce union stack. > > Adds union stack infrastructure to the dentry structure and provides > locking routines to walk the union stack. ... > --- /dev/null > +++

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Jan Engelhardt
On May 14 2007 13:23, Badari Pulavarty wrote: >> +static inline void union_lock_fs(struct fs_struct *fs) >> +{ >> +int locked; >> + >> +while (fs) { >> +locked = union_trylock(fs->root); >> +if (!locked) >> +goto loop1; >> +locked =

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Jan Engelhardt
On May 14 2007 15:10, Bharata B Rao wrote: >+struct union_info * union_alloc(void) Ultimate nitpick: try s/\* /*/; (also elsewhere) >+static inline void union_lock(struct dentry *dentry) >+{ >+ if (unlikely(dentry && dentry->d_union)) { >+ struct union_info *ui =

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Badari Pulavarty
On Mon, 2007-05-14 at 15:10 +0530, Bharata B Rao wrote: > From: Jan Blunck <[EMAIL PROTECTED]> > Subject: Introduce union stack. > > Adds union stack infrastructure to the dentry structure and provides > locking routines to walk the union stack. > > Signed-off-by: Jan Blunck <[EMAIL PROTECTED]>

[RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Bharata B Rao
From: Jan Blunck <[EMAIL PROTECTED]> Subject: Introduce union stack. Adds union stack infrastructure to the dentry structure and provides locking routines to walk the union stack. Signed-off-by: Jan Blunck <[EMAIL PROTECTED]> Signed-off-by: Bharata B Rao <[EMAIL PROTECTED]> --- fs/Makefile

[RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Bharata B Rao
From: Jan Blunck [EMAIL PROTECTED] Subject: Introduce union stack. Adds union stack infrastructure to the dentry structure and provides locking routines to walk the union stack. Signed-off-by: Jan Blunck [EMAIL PROTECTED] Signed-off-by: Bharata B Rao [EMAIL PROTECTED] --- fs/Makefile

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Badari Pulavarty
On Mon, 2007-05-14 at 15:10 +0530, Bharata B Rao wrote: From: Jan Blunck [EMAIL PROTECTED] Subject: Introduce union stack. Adds union stack infrastructure to the dentry structure and provides locking routines to walk the union stack. Signed-off-by: Jan Blunck [EMAIL PROTECTED]

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Jan Engelhardt
On May 14 2007 15:10, Bharata B Rao wrote: +struct union_info * union_alloc(void) Ultimate nitpick: try s/\* /*/; (also elsewhere) +static inline void union_lock(struct dentry *dentry) +{ + if (unlikely(dentry dentry-d_union)) { + struct union_info *ui = dentry-d_union; + +

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Jan Engelhardt
On May 14 2007 13:23, Badari Pulavarty wrote: +static inline void union_lock_fs(struct fs_struct *fs) +{ +int locked; + +while (fs) { +locked = union_trylock(fs-root); +if (!locked) +goto loop1; +locked =

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-14 Thread Badari Pulavarty
On Mon, 2007-05-14 at 15:10 +0530, Bharata B Rao wrote: From: Jan Blunck [EMAIL PROTECTED] Subject: Introduce union stack. Adds union stack infrastructure to the dentry structure and provides locking routines to walk the union stack. ... --- /dev/null +++ b/include/linux/dcache_union.h