Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-22 Thread Verma, Vishal L
On Wed, 2015-12-23 at 10:06 +1100, NeilBrown wrote: > On Wed, Dec 23 2015, Verma, Vishal L wrote: > > > On Tue, 2015-12-22 at 16:34 +1100, NeilBrown wrote: > > > On Sat, Dec 05 2015, Verma, Vishal L wrote: > > > > > > > On Fri, 2015-12-04 at 15:30 -0800, James Bottomley wrote: > > > > [...] > >

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-22 Thread NeilBrown
On Wed, Dec 23 2015, Verma, Vishal L wrote: > On Tue, 2015-12-22 at 16:34 +1100, NeilBrown wrote: >> On Sat, Dec 05 2015, Verma, Vishal L wrote: >> >> > On Fri, 2015-12-04 at 15:30 -0800, James Bottomley wrote: >> > [...] >> > > > +ssize_t badblocks_store(struct badblocks *bb, const char *page,

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-22 Thread Verma, Vishal L
On Tue, 2015-12-22 at 16:34 +1100, NeilBrown wrote: > On Sat, Dec 05 2015, Verma, Vishal L wrote: > > > On Fri, 2015-12-04 at 15:30 -0800, James Bottomley wrote: > > [...] > > > > +ssize_t badblocks_store(struct badblocks *bb, const char *page, > > > > size_t len, > > > > +

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-21 Thread NeilBrown
On Sat, Dec 05 2015, Verma, Vishal L wrote: > On Fri, 2015-12-04 at 15:30 -0800, James Bottomley wrote: > [...] >> > +ssize_t badblocks_store(struct badblocks *bb, const char *page, >> > size_t len, >> > + int unack) >> [...] >> > +int badblocks_init(struct badblocks *bb, int

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-08 Thread Verma, Vishal L
On Wed, 2015-12-09 at 08:03 +1100, NeilBrown wrote: > On Sat, Dec 05 2015, Verma, Vishal L wrote: > > > > > > > +int badblocks_clear(struct badblocks *bb, sector_t s, int > > > > sectors) > > > > +{ > > > [...] > > > > +#define DO_DEBUG 1 > > > > > > Why have this at all if it's unconditionally

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-08 Thread NeilBrown
On Sat, Dec 05 2015, Verma, Vishal L wrote: >> >> > +int badblocks_clear(struct badblocks *bb, sector_t s, int sectors) >> > +{ >> [...] >> > +#define DO_DEBUG 1 >> >> Why have this at all if it's unconditionally defined and always set. > > Neil - any reason or anything you had in mind for this?

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-08 Thread Verma, Vishal L
On Tue, 2015-12-08 at 13:18 -0800, Dan Williams wrote: > On Tue, Dec 8, 2015 at 1:08 PM, Verma, Vishal L > wrote: > > On Wed, 2015-12-09 at 08:03 +1100, NeilBrown wrote: > > > On Sat, Dec 05 2015, Verma, Vishal L wrote: > > > > > > > > > > > +int badblocks_clear(struct

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-08 Thread Dan Williams
On Tue, Dec 8, 2015 at 1:08 PM, Verma, Vishal L wrote: > On Wed, 2015-12-09 at 08:03 +1100, NeilBrown wrote: >> On Sat, Dec 05 2015, Verma, Vishal L wrote: >> > > >> > > > +int badblocks_clear(struct badblocks *bb, sector_t s, int >> > > > sectors) >> > > > +{ >> > >

[PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-07 Thread Vishal Verma
Take the core badblocks implementation from md, and make it generally available. This follows the same style as kernel implementations of linked lists, rb-trees etc, where you can have a structure that can be embedded anywhere, and accessor functions to manipulate the data. The only changes in

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-04 Thread James Bottomley
On Wed, 2015-11-25 at 11:43 -0700, Vishal Verma wrote: > Take the core badblocks implementation from md, and make it generally > available. This follows the same style as kernel implementations of > linked lists, rb-trees etc, where you can have a structure that can be > embedded anywhere, and

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-04 Thread Verma, Vishal L
On Fri, 2015-12-04 at 15:30 -0800, James Bottomley wrote: [...] > > + * We return > > + *  0 if there are no known bad blocks in the range > > + *  1 if there are known bad block which are all acknowledged > > + * -1 if there are bad blocks which have not yet been acknowledged > > in metadata. > >

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-04 Thread James Bottomley
On Fri, 2015-12-04 at 23:58 +, Verma, Vishal L wrote: > On Fri, 2015-12-04 at 15:30 -0800, James Bottomley wrote: > [...] > > > + * We return > > > + * 0 if there are no known bad blocks in the range > > > + * 1 if there are known bad block which are all acknowledged > > > + * -1 if there

Re: [PATCH v2 1/3] badblocks: Add core badblock management code

2015-12-04 Thread Verma, Vishal L
On Fri, 2015-12-04 at 16:06 -0800, James Bottomley wrote: > On Fri, 2015-12-04 at 23:58 +, Verma, Vishal L wrote: > > On Fri, 2015-12-04 at 15:30 -0800, James Bottomley wrote: > > [...] > > > > + * We return > > > > + *  0 if there are no known bad blocks in the range > > > > + *  1 if there

[PATCH v2 1/3] badblocks: Add core badblock management code

2015-11-25 Thread Vishal Verma
Take the core badblocks implementation from md, and make it generally available. This follows the same style as kernel implementations of linked lists, rb-trees etc, where you can have a structure that can be embedded anywhere, and accessor functions to manipulate the data. The only changes in