NFSv4.1/pnfs: Fix atomicity of commit list updates
[deliverable/linux.git] / fs / nfs / internal.h
index 9b372b845f6a6ff06a4a035e2f6799d7d29cd8f7..1dad18105ed02e0e01979580fd05eee692935e6c 100644 (file)
@@ -490,6 +490,9 @@ void nfs_retry_commit(struct list_head *page_list,
 void nfs_commitdata_release(struct nfs_commit_data *data);
 void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst,
                                 struct nfs_commit_info *cinfo);
+void nfs_request_add_commit_list_locked(struct nfs_page *req,
+               struct list_head *dst,
+               struct nfs_commit_info *cinfo);
 void nfs_request_remove_commit_list(struct nfs_page *req,
                                    struct nfs_commit_info *cinfo);
 void nfs_init_cinfo(struct nfs_commit_info *cinfo,
@@ -623,13 +626,15 @@ void nfs_super_set_maxbytes(struct super_block *sb, __u64 maxfilesize)
  * Record the page as unstable and mark its inode as dirty.
  */
 static inline
-void nfs_mark_page_unstable(struct page *page)
+void nfs_mark_page_unstable(struct page *page, struct nfs_commit_info *cinfo)
 {
-       struct inode *inode = page_file_mapping(page)->host;
+       if (!cinfo->dreq) {
+               struct inode *inode = page_file_mapping(page)->host;
 
-       inc_zone_page_state(page, NR_UNSTABLE_NFS);
-       inc_wb_stat(&inode_to_bdi(inode)->wb, WB_RECLAIMABLE);
-        __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
+               inc_zone_page_state(page, NR_UNSTABLE_NFS);
+               inc_wb_stat(&inode_to_bdi(inode)->wb, WB_RECLAIMABLE);
+               __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
+       }
 }
 
 /*
This page took 0.029963 seconds and 5 git commands to generate.