Btrfs: compat code fixes
authorChris Mason <chris.mason@oracle.com>
Thu, 20 Nov 2008 15:22:27 +0000 (10:22 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 20 Nov 2008 15:22:27 +0000 (10:22 -0500)
The btrfs git kernel trees is used to build a standalone tree for
compiling against older kernels.  This commit makes the standalone tree
work with 2.6.27

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/compat.h
fs/btrfs/compression.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/super.c
fs/btrfs/volumes.c

index dd1defdbfa36801548b8b287612df9d737a2f2f6..75e4426d6fbb7fc6004593d7e46250f0a1da8bb5 100644 (file)
@@ -25,6 +25,7 @@ static inline struct dentry *d_obtain_alias(struct inode *inode)
 # define  __pagevec_lru_add_file __pagevec_lru_add
 # define open_bdev_exclusive open_bdev_excl
 # define close_bdev_exclusive(bdev, mode) close_bdev_excl(bdev)
+typedef unsigned __bitwise__ fmode_t;
 #endif
 
 
index df05f513e1ebcb2f4ae20511c1cc1165f26f83e4..4febe2eb0b839ee8c825064ca188d684efdfdf73 100644 (file)
 #include <linux/bit_spinlock.h>
 #include <linux/version.h>
 #include <linux/pagevec.h>
+#include "compat.h"
 #include "ctree.h"
 #include "disk-io.h"
 #include "transaction.h"
 #include "btrfs_inode.h"
 #include "volumes.h"
 #include "ordered-data.h"
-#include "compat.h"
 #include "compression.h"
 #include "extent_io.h"
 #include "extent_map.h"
index c8dcb47b6d7dc62151eb1bdaf462d9572ec50c00..981652233f707e489e764025626d967bf1b100b4 100644 (file)
@@ -26,7 +26,8 @@
 #include <linux/buffer_head.h> // for block_sync_page
 #include <linux/workqueue.h>
 #include <linux/kthread.h>
-# include <linux/freezer.h>
+#include <linux/freezer.h>
+#include "compat.h"
 #include "crc32c.h"
 #include "ctree.h"
 #include "disk-io.h"
index 62d49705d14047890996a965123fd630ef53735c..b33e0bfb99e1f0be74832a11377e8594c61365e9 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/pagemap.h>
 #include <linux/writeback.h>
 #include <linux/blkdev.h>
+#include <linux/version.h>
+#include "compat.h"
 #include "hash.h"
 #include "crc32c.h"
 #include "ctree.h"
@@ -900,6 +902,7 @@ static int noinline remove_extent_backref(struct btrfs_trans_handle *trans,
        return ret;
 }
 
+#ifdef BIO_RW_DISCARD
 static void btrfs_issue_discard(struct block_device *bdev,
                                u64 start, u64 len)
 {
@@ -909,7 +912,7 @@ static void btrfs_issue_discard(struct block_device *bdev,
        blkdev_issue_discard(bdev, start >> 9, len >> 9);
 #endif
 }
-
+#endif
 
 static int noinline free_extents(struct btrfs_trans_handle *trans,
                                 struct btrfs_root *extent_root,
index 2c77e0957f743ed13ac4f7ac978b24d1618b3c2c..7a8ad4292f75f1d523008ea0002a4cf7bd8be628 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/xattr.h>
 #include <linux/posix_acl.h>
 #include <linux/falloc.h>
+#include "compat.h"
 #include "ctree.h"
 #include "disk-io.h"
 #include "transaction.h"
@@ -47,7 +48,6 @@
 #include "volumes.h"
 #include "ordered-data.h"
 #include "xattr.h"
-#include "compat.h"
 #include "tree-log.h"
 #include "ref-cache.h"
 #include "compression.h"
index 8828109fa58efa9475d52cb2383015e71eadcfd0..f3d68457e66aa29d9af45e950c0e5503bee29729 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/version.h>
 #include <linux/xattr.h>
 #include <linux/vmalloc.h>
+#include "compat.h"
 #include "ctree.h"
 #include "disk-io.h"
 #include "transaction.h"
index 77c5eff3e209d8098b942006cf81ed9cdf7eecbc..1975ea273dc32644d06e094d3ffa35cb5064fb25 100644 (file)
@@ -37,6 +37,8 @@
 #include <linux/ctype.h>
 #include <linux/namei.h>
 #include <linux/miscdevice.h>
+#include <linux/version.h>
+#include "compat.h"
 #include "ctree.h"
 #include "disk-io.h"
 #include "transaction.h"
index c3ee63f92a5f968518a0d1f7a10911baac14d819..724ead54529bc890b5cecf635f1ee6c614c1b391 100644 (file)
@@ -20,7 +20,9 @@
 #include <linux/buffer_head.h>
 #include <linux/blkdev.h>
 #include <linux/random.h>
+#include <linux/version.h>
 #include <asm/div64.h>
+#include "compat.h"
 #include "ctree.h"
 #include "extent_map.h"
 #include "disk-io.h"