btrfs-progs: update to 3.17.1; added patches for musl via Alpine.

This commit is contained in:
Juan RP 2014-11-10 14:28:09 +01:00
parent a8070f9668
commit c2800486d7
3 changed files with 64 additions and 2 deletions

View file

@ -0,0 +1,39 @@
diff --git a/bitops.h b/bitops.h
index 323c571..7f30b06 100644
--- bitops.h
+++ bitops.h
@@ -65,6 +65,9 @@ static inline unsigned long hweight_long(unsigned long w)
}
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
+#ifndef __always_inline
+#define __always_inline inline __attribute__((always_inline))
+#endif
/**
* __ffs - find first bit in word.
diff --git a/kerncompat.h.orig b/kerncompat.h
index bb03194e127e..28f832a2e625 100644
--- kerncompat.h
+++ kerncompat.h
@@ -28,6 +28,7 @@
#include <assert.h>
#include <stddef.h>
#include <linux/types.h>
+#include <linux/limits.h>
#include <stdint.h>
#define ptr_to_u64(x) ((u64)(uintptr_t)x)
--- rbtree.h
+++ rbtree.h
@@ -38,6 +38,10 @@
extern "C" {
#endif
+#ifndef __always_inline
+#define __always_inline inline __attribute__((always_inline))
+#endif
+
struct rb_node {
unsigned long __rb_parent_color;
struct rb_node *rb_right;

View file

@ -0,0 +1,23 @@
--- utils.c
+++ utils.c
@@ -833,13 +833,19 @@
{
int ret;
FILE *f;
+ struct stat stat_buf;
char fmt[20];
char p[PATH_MAX];
char real_loop_dev[PATH_MAX];
if (!realpath(loop_dev, real_loop_dev))
return -errno;
- snprintf(p, PATH_MAX, "/sys/block/%s/loop/backing_file", strrchr(real_loop_dev, '/'));
+
+ if (stat(real_loop_dev, &stat_buf) || !S_ISBLK(stat_buf.st_mode))
+ return -errno;
+
+ snprintf(p, PATH_MAX, "/sys/dev/block/%d:%d/loop/backing_file",
+ major(stat_buf.st_rdev), minor(stat_buf.st_rdev));
if (!(f = fopen(p, "r")))
return -errno;

View file

@ -1,6 +1,6 @@
# Template file for 'btrfs-progs'
pkgname=btrfs-progs
_distver=3.17
_distver=3.17.1
# DO NOT MODIFY DATEVER!
_datever=20141006
version=${_datever}.${_distver}
@ -16,7 +16,7 @@ do_fetch() {
git clone -b v${_distver} git://git.kernel.org/pub/scm/linux/kernel/git/kdave/${pkgname}.git ${pkgname}-${version}
}
do_build() {
make CC="$CC" CFLAGS="$CFLAGS" ${makejobs}
make DISABLE_BACKTRACE=1 CC="$CC" CFLAGS="$CFLAGS" ${makejobs}
}
do_install() {
sed -i '/LNS/d' Documentation/Makefile