Skip to content

Commit

Permalink
Commit the atom before passing management to new file plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Shishkin <edward.shishkin@gmail.com>
  • Loading branch information
edward6 committed Jan 3, 2019
1 parent 54123eb commit 494a90f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugin/file/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ capture_anonymous_jnodes(struct address_space *mapping,
/*
* Commit atom of the jnode of a page.
*/
static int sync_page(struct page *page)
int reiser4_sync_page(struct page *page)
{
int result;
do {
Expand Down Expand Up @@ -1113,7 +1113,7 @@ static int sync_page_list(struct inode *inode)

from = page->index + 1;

result = sync_page(page);
result = reiser4_sync_page(page);

put_page(page);
xa_lock_irq(&mapping->i_pages);
Expand Down
1 change: 1 addition & 0 deletions plugin/file/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ int reiser4_mmap_dispatch(struct file *, struct vm_area_struct *);
int reiser4_open_dispatch(struct inode *inode, struct file *file);
int reiser4_release_dispatch(struct inode *, struct file *);
int reiser4_sync_file_common(struct file *, loff_t, loff_t, int datasync);
int reiser4_sync_page(struct page *page);

/* address space operations */
int reiser4_readpage_dispatch(struct file *, struct page *);
Expand Down
9 changes: 8 additions & 1 deletion plugin/file/file_conversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,15 @@ ssize_t reiser4_write_dispatch(struct file *file, const char __user *buf,
/**
* Second step.
* New file plugin has been scheduled.
* Perform conversion to the new plugin.
* Commit respective atom and pass management to the new plugin.
*/
assert("edward-181", cont.pages[0] != NULL);
/*
* this will commit the whole logical cluster
* the file consists of
*/
reiser4_sync_page(cont.pages[0]);

down_read(&reiser4_inode_data(inode)->conv_sem);
result = convert_file_plugin(file, inode, &cont);
up_read(&reiser4_inode_data(inode)->conv_sem);
Expand Down

0 comments on commit 494a90f

Please sign in to comment.