Messages in this thread | | | Date | Tue, 4 Nov 2008 11:16:31 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH 04/18] libosd: OSDv1 preliminary implementation |
| |
On Tue, 4 Nov 2008 18:44:29 +0200 Boaz Harrosh <bharrosh@panasas.com> wrote:
> Implementation of the most basic OSD functionality and > infrastructure. Mainly Format, Create/Remove Partition, > Create/Remove Object, and read/write. > > > ... > > +struct osd_request *_osd_request_alloc(gfp_t gfp) > +{ > + struct osd_request *or; > + > + /* TODO: Use mempool with one saved request */ > + or = kzalloc(sizeof(*or), gfp); > + return or; > +} > + > +void _osd_request_free(struct osd_request *or) > +{ > + kfree(or); > +}
These two functions can/should be made static. Please generally check for this.
Also it'd probably make sense to declare both these inline. The compiler _shoudl_ get it right, but stranger things have happened...
> > ... > > +/* > + * If osd_finalize_request() was called but the request was not executed through > + * the block layer, then we must release BIOs. > + */ > +static void _abort_unexecuted_bios(struct request *rq) > +{ > + struct bio *bio; > + > + while ((bio = rq->bio) != NULL) { > + rq->bio = bio->bi_next; > + bio_endio(bio, 0); > + } > +}
Boy, that's a scary function. bye-bye data.
| |