lkml.org 
[lkml]   [2008]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.




\
 
 \ /
  Last update: 2008-11-04 20:21    [W:1.434 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site