[Btrfs-devel] [PATCH 4/4] btrfs: Add unexported file_ra_state_init() when using kernels prior to 2.6.19

Jeff Mahoney jeffm at suse.com
Wed Feb 6 14:14:51 PST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 Kernels prior to 2.6.19 don't export file_ra_state_init(). This patch adds
 the file_ra_state_init() from 2.6.18.

Signed-off-by: Jeff Mahoney <jeffm at suse.com>
- ---
 extent-tree.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

- --- a/extent-tree.c	2008-02-06 15:58:22.000000000 -0500
+++ b/extent-tree.c	2008-02-06 16:08:17.000000000 -0500
@@ -19,6 +19,7 @@
 #include <linux/sched.h>
 #include <linux/crc32c.h>
 #include <linux/pagemap.h>
+#include <linux/backing-dev.h>
 #include "hash.h"
 #include "ctree.h"
 #include "disk-io.h"
@@ -2198,6 +2199,16 @@ int btrfs_free_block_groups(struct btrfs
 	return 0;
 }
 
+/* Versions prior to 2.6.19 don't export file_ra_state_init */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+void
+file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
+{
+        ra->ra_pages = mapping->backing_dev_info->ra_pages;
+        ra->prev_page = 1;
+}
+#endif
+
 static int noinline relocate_inode_pages(struct inode *inode, u64 start,
 					 u64 len)
 {

- -- 
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHqjFaLPWxlyuTD7IRAi/iAJ0V3a1WsEYgBWaYdavTMmPBzfOxaQCfWSD4
vMDlU1t1KziDAMAN2/gm448=
=MUvx
-----END PGP SIGNATURE-----



More information about the Btrfs-devel mailing list