Skip to content

Commit

Permalink
Add compat function of wait_for_stable_page()
Browse files Browse the repository at this point in the history
wait_for_stable_page() function doesn't exist in kernel 3.8 and
earlier.  This adds its compat function to allow build on the earlier
kernels.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
  • Loading branch information
konis committed Jun 7, 2015
1 parent b9093f8 commit ae7f72a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fs/nilfs2/kern_feature.h
Expand Up @@ -130,9 +130,17 @@
# define HAVE_MODULE_ALIAS_FS \
(LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
#endif
/*
* wait_for_stable_page() was introduced in kernel 3.9
*/
#ifndef HAVE_WAIT_FOR_STABLE_PAGE
# define HAVE_WAIT_FOR_STABLE_PAGE \
(LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
#endif
#endif /* LINUX_VERSION_CODE */


#include <linux/pagemap.h>
#include <linux/fs.h>

/*
Expand Down Expand Up @@ -211,4 +219,11 @@ static inline struct inode *file_inode(struct file *f)
# define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)
#endif

#if !HAVE_WAIT_FOR_STABLE_PAGE
static inline void wait_for_stable_page(struct page *page)
{
wait_on_page_writeback(page);
}
#endif

#endif /* NILFS_KERN_FEATURE_H */

0 comments on commit ae7f72a

Please sign in to comment.