* accounting is preserved.
*/
+
/*
* Dirty a page. If @snapc is NULL, use the current snap context for
* i_snap_realm. Otherwise, redirty a page within the context of
return 0;
}
+ BUG_ON(page->private);
+ BUG_ON(PagePrivate(page));
+
/*
* optimistically adjust accounting, on the assumption that
* we won't race with invalidate.
* Reference snap context in page->private. Also set
* PagePrivate so that we get invalidatepage callback.
*/
- ceph_put_snap_context((void *)page->private);
+ BUG_ON(page->private);
+ BUG_ON(PagePrivate(page));
page->private = (unsigned long)snapc;
SetPagePrivate(page);
} else {
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
+ BUG_ON(!PageDirty(page));
return 1;
}
struct ceph_inode_info *ci;
struct ceph_snap_context *snapc = (void *)page->private;
+ BUG_ON(!PageLocked(page));
BUG_ON(!page->private);
BUG_ON(!PagePrivate(page));
- BUG_ON(!PageLocked(page));
BUG_ON(!page->mapping);
BUG_ON(!PageDirty(page));
off, len, page, page->index);
ret = ceph_write_begin(vma->vm_file, inode->i_mapping, off, len, 0,
&locked_page, &fsdata);
+ WARN_ON(page != locked_page);
if (!ret)
ceph_write_end(vma->vm_file, inode->i_mapping, off, len, len,
locked_page, fsdata);