summaryrefslogtreecommitdiff
path: root/fs/nfs/internal.h
diff options
context:
space:
mode:
authorTom Haynes <thomas.haynes@primarydata.com>2015-02-14 00:19:53 +0300
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-02-14 01:47:26 +0300
commitd15bc38df607c893c36f4962dca0f57174c6a5c9 (patch)
treed263dcfbfaed2de1fde01a028d14184dace7781b /fs/nfs/internal.h
parent6bec0035286119eefc32a5b1102127e6a4032cb2 (diff)
downloadlinux-d15bc38df607c893c36f4962dca0f57174c6a5c9.tar.xz
nfs: Provide and use helper functions for marking a page as unstable
Signed-off-by: Tom Haynes <loghyr@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r--fs/nfs/internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 212b8c883d22..b802fb3a2d99 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -598,6 +598,19 @@ 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)
+{
+ struct inode *inode = page_file_mapping(page)->host;
+
+ inc_zone_page_state(page, NR_UNSTABLE_NFS);
+ inc_bdi_stat(inode_to_bdi(inode), BDI_RECLAIMABLE);
+ __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
+}
+
+/*
* Determine the number of bytes of data the page contains
*/
static inline