Fix shadow_bitmap_modify() in fsck

shadow_bitmap_modify() is missing to consider about mapoffset when
calculate modification length.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Add REQ_META annotation for volmap

This allow to pass additional bio flags when flushing.

By using it, this also adds REQ_META annotation for sb, bitmap data,
volmap, logmap. With this, we can see REQ_META via blktrace data.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Fix tux3_clear_dirty_inode_nolock() race

If frontend and backend ran with following order, inode is already
dirty before __mark_inode_dirty(). Therefore, __mark_inode_dirty()
miss to wake the flusher up.

       cpu0                                 cpu1
__tux3_mark_inode_dirty()
    /* mark frontend delta dirty */
    tux3_dirty_inode()
                                     /* Clear core dirty and backend delta */
                                     tux3_clear_dirty_inode_nolock()
                                         inode->i_state |= I_DIRTY

    /* inode is already dirty */
    __mark_inode_dirty()

So, this patch removes unnecessary "inode->i_state |= I_DIRTY".

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Fix inode->dirtied_when in the case of re-dirty

__mark_inode_dirty() doesn't know about delta boundary (we don't clear
I_DIRTY before flush, in order to prevent the inode to be freed). So,
if inode was re-dirtied for frontend delta while flushing old delta,
->dirtied_when may not be updated by __mark_inode_dirty() forever.

Although we don't use ->dirtied_when, bdi flusher uses ->dirtied_when
to decide flush timing, so we have to update ->dirtied_when ourself.

           cpu0                                      cpu1

__tux3_mark_inode_dirty()
    tux3_dirty_inode()
    __mark_inode_dirty()
    /* core dirty is still dirty */
                                      __tux3_clear_dirty_inode()
				      /* clear I_DIRTY and backend dirty */

So, if inode is not marked frontend dirty but was still marked as
I_DIRTY, this patch updates inode->dirtied_when (like __mark_inode_dirty()).

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Remove mark_buffer_dirty() in tux3_set_buffer_dirty_list()

In previous patch, we added re-dirty detection.

But tux3_set_buffer_dirty_list() is calling mark_buffer_dirty() like
below, so we can't detect re-dirty properly. Because,
mark_buffer_dirty() can set I_DIRTY_PAGES without our ->dirty_inode()
hook.

    tux3_set_buffer_dirty_list()
        mark_buffer_dirty()
            __set_page_dirty()
	        __mark_inode_dirty(I_DIRTY_PAGES)
    __tux3_mark_inode_dirty(I_DIRTY_PAGES)

To fix this, opencode mark_buffer_dirty(), then remove
__mark_inode_dirty() from tux3_set_buffer_dirty_list(). Instead, it
returns 1 or 0, to tell whether caller needs to call
__tux3_mark_inode_dirty().

With this changes, we can avoid to call unnecessary
__tux3_mark_inode_dirty() too.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>