void mark_buffer_dirty (struct buffer_head * bh);
mark_buffer_dirty will set the dirty bit against the buffer, then set its backing page dirty, then attach the page to its address_space's dirty_pages list and then attach the address_space's inode to its superblock's dirty inode list.
mark_buffer_dirty is atomic. It takes bh->b_page->mapping->private_lock, mapping->page_lock and the global inode_lock.