Re: [RFC] my current kernel todo list

From: Alexander Viro (viro@math.psu.edu)
Date: Mon Sep 04 2000 - 12:41:15 EST


On Mon, 4 Sep 2000, Tigran Aivazian wrote:

> Hi Arnaldo,
>
> That is a very decent list you have got there. How about to add to
> it:
>
> - go through all filesystems and convert them from using
> mark_buffer_dirty(bh, [0,1]) to just mark_buffer_dirty(bh) since the flag
> is now ignored and all buffers are flushed at equal intervals. Also,
> change the exported interface, of course.
>
> Conceptually simple, but a lot (at least 3 hours) of work.

Are you kidding? In nvi:

iI:Vi ^V<ESC>f:r^V
;CG/mark_buffer_dirty/^V
w%dF,:x^V<ESC>2k"a3dd@a<ESC>0"bd$
ifind . -name '*.[chS]'|xargs grep -nw mark_buffer_dirty /dev/null<ESC>!!sh

and then press @b on the obvius lines. Doing the rest by hands will not
take anywhere near 3 hours. I'm not saying that it's the most elegant way
to write such macro, but it will work (<ESC> stands for Esc and ^V for
Ctrl-V, indeed).

Translation for vi-impaired: first 3 lines enter the string
I:Vi ^[f:r^M;CG/mark_buffer_dirty/^Mw%dF,:x^[2k"ad3d@a
and move it into buffer b. The next line inserts the obvious command
and filters it through sh, giving you the list of all instances of
mark_buffer_dirty.

After that, @b would execute the macro stored in buffer b, that is
        insert ':Vi ' in the beginning of line
        find first ':' after it
        replace it with <CR>
        repeat the last search (== find next ':')
        replace it and the rest of line with
G/mark_buffer_dirty/
w%dF,:x
        [at that point you have
:Vi <file>
G<line>/mark_buffer_dirty/
w%dF,:x
        where your line was]
        go 2 lines up
        move 3 lines into buffer a
        execute macro stored in a, that is
                open a new window that would contain <file>
                go to line number <line>
                search for mark_buffer_dirty
                go to the next word (that will be'(')
                go to the corresponding ')'
                delete back to the ','
                save file and close the window

IOW, @b goes to the corresponding instance of mark_buffer_dirty and
removes the second argument. That's it.

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



This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:18 EST