Re: [PATCH 04/18] libosd: OSDv1 preliminary implementation

From: Andrew Morton
Date: Tue Nov 04 2008 - 14:17:49 EST


On Tue, 4 Nov 2008 18:44:29 +0200
Boaz Harrosh <bharrosh@xxxxxxxxxxx> 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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/