lkml.org 
[lkml]   [2009]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/10] ide-tape: use single continuous buffer
Hello, Grant.

Grant Grundler wrote:
> On Wed, Mar 25, 2009 at 7:17 AM, Tejun Heo <tj@kernel.org> wrote:
>> Impact: simpler buffer allocation and handling, fix DMA transfers
> ...
>> + atomic_set(&bh->b_count, bcount);
>> if (atomic_read(&bh->b_count) == bh->b_size)
> ...
>
> I'm failing to see why bh->b_count is an atomic_t.
> I always assumed tapes were exclusive access devices
> and would be serialized at a higher level.

Beats me. I don't know. The code is generally pretty over-engineered
but, well, it's an ancient piece of code with (probably too) rich
history.

>> - ide_tape_kfree_buffer(tape);
>> - return NULL;
>> + bh->b_size = tape->buffer_size;
>> + atomic_set(&bh->b_count, full ? bh->b_size : 0);
>
> No one else could possibly be referencing bh->count at this
> point...I like that it's consistent though.

Yeah, this patch is just one of logical steps to remove bh, so it
doesn't make any other changes than described. The whole bh stuff
will be removed later in the series.

> The use of atomic won't hurt correctness and this patch looks fine to me.
> Please add "Reviewed-by: Grant Grundler <grundler@google.com>"

Thanks.

--
tejun


\
 
 \ /
  Last update: 2009-03-25 17:17    [W:0.062 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site