* Building btrfs as a dkms module on Debian @ 2011-02-15 15:35 Yuri D'Elia 2011-02-16 2:51 ` liubo 0 siblings, 1 reply; 3+ messages in thread From: Yuri D'Elia @ 2011-02-15 15:35 UTC (permalink / raw) To: linux-btrfs Hi everyone. I was trying to test a more recent version of btrfs on my = current kernel (2.6.37) using dkms, without success. I followed these instructions: https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories - cloned the repo - symlinked to /usr/src/btrfs-git - patched version.sh: Please note version.sh requires bash (better to change the shebang or f= ix the script). Even with the patch, version.sh run on a shallow repository generates a= "-dirty" version. I assume this is OK, even though there are no local = changes. - run version.sh - dkms add -m btrfs -v git - dkms build -m btrfs -v git fails with: /var/lib/dkms/btrfs/git/build/extent-tree.c: In function =E2=80=98btrfs= _issue_discard=E2=80=99: /var/lib/dkms/btrfs/git/build/extent-tree.c:1747: error: =E2=80=98BLKDE= V_IFL_WAIT=E2=80=99 undeclared (first use in this function) /var/lib/dkms/btrfs/git/build/extent-tree.c:1747: error: (Each undeclar= ed identifier is reported only once /var/lib/dkms/btrfs/git/build/extent-tree.c:1747: error: for each funct= ion it appears in.) /var/lib/dkms/btrfs/git/build/extent-tree.c:1747: error: =E2=80=98BLKDE= V_IFL_BARRIER=E2=80=99 undeclared (first use in this function) I assume BLKDEV_IFL_WAIT/BARRIER was added in later kernels? Is there a way to make it build btrfs for 2.6.37? Thanks -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Building btrfs as a dkms module on Debian 2011-02-15 15:35 Building btrfs as a dkms module on Debian Yuri D'Elia @ 2011-02-16 2:51 ` liubo 2011-02-16 17:44 ` Yuri D'Elia 0 siblings, 1 reply; 3+ messages in thread From: liubo @ 2011-02-16 2:51 UTC (permalink / raw) To: Yuri D'Elia; +Cc: linux-btrfs On 02/15/2011 11:35 PM, Yuri D'Elia wrote: > Hi everyone. I was trying to test a more recent version of btrfs on m= y current kernel (2.6.37) using dkms, without success. >=20 > I followed these instructions: >=20 > https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories >=20 > - cloned the repo > - symlinked to /usr/src/btrfs-git > - patched version.sh: >=20 > Please note version.sh requires bash (better to change the shebang or= fix the script). > Even with the patch, version.sh run on a shallow repository generates= a "-dirty" version. I assume this is OK, even though there are no loca= l changes. >=20 > - run version.sh > - dkms add -m btrfs -v git > - dkms build -m btrfs -v git fails with: >=20 > /var/lib/dkms/btrfs/git/build/extent-tree.c: In function =E2=80=98btr= fs_issue_discard=E2=80=99: > /var/lib/dkms/btrfs/git/build/extent-tree.c:1747: error: =E2=80=98BLK= DEV_IFL_WAIT=E2=80=99 undeclared (first use in this function) > /var/lib/dkms/btrfs/git/build/extent-tree.c:1747: error: (Each undecl= ared identifier is reported only once > /var/lib/dkms/btrfs/git/build/extent-tree.c:1747: error: for each fun= ction it appears in.) > /var/lib/dkms/btrfs/git/build/extent-tree.c:1747: error: =E2=80=98BLK= DEV_IFL_BARRIER=E2=80=99 undeclared (first use in this function) >=20 > I assume BLKDEV_IFL_WAIT/BARRIER was added in later kernels? > Is there a way to make it build btrfs for 2.6.37? in commit fbd9b09a177a481eda256447c881f014f29034fe: include/linux/blkdev.h: #define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT) #define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER) #define BLKDEV_IFL_SECURE (1 << BLKDEV_SECURE) Maybe this is helpful.:) thanks, liubo >=20 > Thanks >=20 > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs= " in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >=20 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Building btrfs as a dkms module on Debian 2011-02-16 2:51 ` liubo @ 2011-02-16 17:44 ` Yuri D'Elia 0 siblings, 0 replies; 3+ messages in thread From: Yuri D'Elia @ 2011-02-16 17:44 UTC (permalink / raw) To: linux-btrfs; +Cc: linux-btrfs [-- Attachment #1: Type: text/plain, Size: 734 bytes --] On Wed, 16 Feb 2011 10:51:43 +0800 liubo <liubo2009@cn.fujitsu.com> wrote: > > I assume BLKDEV_IFL_WAIT/BARRIER was added in later kernels? > > Is there a way to make it build btrfs for 2.6.37? > > in commit fbd9b09a177a481eda256447c881f014f29034fe: > include/linux/blkdev.h: > > #define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT) > #define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER) > #define BLKDEV_IFL_SECURE (1 << BLKDEV_SECURE) > > Maybe this is helpful.:) I've worked more on this today. There was a lot of restructuring of blkdev in 2.6.38, but in stock 2.6.37 only BLKDEV_SECURE has any effect. Just in case, I'm posting here the changes required to backport current btrfs to 2.6.37 (just a few minor changes). [-- Attachment #2: backport-2.6.37.patch --] [-- Type: text/x-diff, Size: 3354 bytes --] commit db77ab6c70a5c148ff4ab6d354603609c0eb73aa Author: Yuri D'Elia <yuri.delia@eurac.edu> Date: Wed Feb 16 18:27:54 2011 +0100 Backport changes for compilation under 2.6.37 diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 3e1ea3e..7022ac8 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2131,7 +2131,7 @@ static void btrfs_end_buffer_write_sync(struct buffer_head *bh, int uptodate) if (uptodate) { set_buffer_uptodate(bh); } else { - if (!buffer_eopnotsupp(bh) && printk_ratelimit()) { + if (printk_ratelimit()) { printk(KERN_WARNING "lost page write due to " "I/O error on %s\n", bdevname(bh->b_bdev, b)); @@ -2269,7 +2269,7 @@ static int write_dev_supers(struct btrfs_device *device, } if (i == last_barrier && do_barriers && device->barriers) { - ret = submit_bh(WRITE_BARRIER, bh); + ret = submit_bh(WRITE_FLUSH_FUA, bh); if (ret == -EOPNOTSUPP) { printk("btrfs: disabling barriers on dev %s\n", device->name); diff --git a/fs/btrfs/dkms.conf b/fs/btrfs/dkms.conf new file mode 100644 index 0000000..10b8fb9 --- /dev/null +++ b/fs/btrfs/dkms.conf @@ -0,0 +1,6 @@ +PACKAGE_NAME="btrfs" +PACKAGE_VERSION="20110214" +BUILT_MODULE_NAME[0]="btrfs" +DEST_MODULE_LOCATION[0]="/kernel/fs/btrfs/" +AUTOINSTALL="yes" +REMAKE_INITRD="yes" diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a7aaa10..f3c96fc 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -1743,8 +1743,7 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans, static void btrfs_issue_discard(struct block_device *bdev, u64 start, u64 len) { - blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, - BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); + blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, 0); } static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e7aeba2..06fd0d0 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -16,6 +16,10 @@ #include "ctree.h" #include "btrfs_inode.h" +#define INIT_RCU_HEAD(ptr) do { \ + (ptr)->next = NULL; (ptr)->func = NULL; \ +} while (0) + static struct kmem_cache *extent_state_cache; static struct kmem_cache *extent_buffer_cache; diff --git a/fs/btrfs/version.h b/fs/btrfs/version.h index 9bf3946..d7c55c6 100644 --- a/fs/btrfs/version.h +++ b/fs/btrfs/version.h @@ -1,4 +1,4 @@ -#ifndef __BTRFS_VERSION_H -#define __BTRFS_VERSION_H -#define BTRFS_BUILD_VERSION "Btrfs" +#ifndef __BUILD_VERSION +#define __BUILD_VERSION +#define BTRFS_BUILD_VERSION "Btrfs 2011-02-14_16:21:37_-0500_c26a920-dirty" #endif diff --git a/fs/btrfs/version.sh b/fs/btrfs/version.sh index 1ca1952..2c1d0b5 100644 --- a/fs/btrfs/version.sh +++ b/fs/btrfs/version.sh @@ -12,10 +12,7 @@ which git &> /dev/null if [ $? == 0 ]; then git branch >& /dev/null if [ $? == 0 ]; then - if head=`git rev-parse --verify HEAD 2>/dev/null`; then - if tag=`git describe --tags 2>/dev/null`; then - v="$tag" - fi + v="`git show --format='%ci_%h'|head -n 1|sed -e 's/[^a-z0-9_:-]/_/ig'`" # Are there uncommitted changes? git update-index --refresh --unmerged > /dev/null @@ -24,7 +21,6 @@ if [ $? == 0 ]; then | read dummy; then v="$v"-dirty fi - fi fi fi ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-16 17:44 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-02-15 15:35 Building btrfs as a dkms module on Debian Yuri D'Elia 2011-02-16 2:51 ` liubo 2011-02-16 17:44 ` Yuri D'Elia
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).