[Patch] btrfs-image.c: fix return values

2009-01-19 Thread Américo Wang
- Exit with non-zero when fail; - Don't exit in non-main functions, return. Signed-off-by: WANG Cong wangc...@zeuux.org --- diff --git a/btrfs-image.c b/btrfs-image.c index 9925bdb..62b3dd8 100644 --- a/btrfs-image.c +++ b/btrfs-image.c @@ -741,7 +741,7 @@ static int restore_metadump(const char

[Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args

2009-01-19 Thread Américo Wang
I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and it also looks that this one is more proper. Kill BTRFS_PATH_NAME_MAX since no one will use it. Signed-off-by: WANG Cong wangc...@zeuux.org Cc: Chris Mason chris.ma...@oracle.com --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c

Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args

2009-01-19 Thread Josef Bacik
On Mon, Jan 19, 2009 at 08:57:32PM +0800, Américo Wang wrote: I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and it also looks that this one is more proper. Kill BTRFS_PATH_NAME_MAX since no one will use it. Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff,

[Patch] btrfsctl.c: fix the definition of struct btrfs_ioctl_vol_args

2009-01-19 Thread Américo Wang
According to the definition in kernel space, this one should be changed. Signed-off-by: WANG Cong wangc...@zeuux.org --- diff --git a/btrfsctl.c b/btrfsctl.c index e049799..5ff7f69 100644 --- a/btrfsctl.c +++ b/btrfsctl.c @@ -39,7 +39,7 @@ #define BLKGETSIZE64 0 #define BTRFS_IOC_SNAP_CREATE

[Patch] bit-radix.c: fix declarations

2009-01-19 Thread Américo Wang
bit-radix.c should #include bit-radix.h, and add a missing declaration for find_next_bit(). Signed-off-by: WANG Cong wangc...@zeuux.org --- diff --git a/bit-radix.c b/bit-radix.c index 57f6f3c..01bf4af 100644 --- a/bit-radix.c +++ b/bit-radix.c @@ -17,7 +17,7 @@ */ #include kerncompat.h

[Patch] btrfsck.c: bit-fields should be unsigned

2009-01-19 Thread Américo Wang
bit-fields should be unsigned. Signed-off-by: WANG Cong wangc...@zeuux.org --- diff --git a/btrfsck.c b/btrfsck.c index 4a41e6d..1bf4064 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -60,10 +60,10 @@ struct extent_record { struct inode_backref { struct list_head list; - int

[Patch] btrfs-progs: make several functions static

2009-01-19 Thread Américo Wang
Make several functions static, and make one argument const. Signed-off-by: WANG Cong wangc...@zeuux.org --- diff --git a/btrfsck.c b/btrfsck.c index 4a41e6d..c50de7d 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -1254,7 +1254,7 @@ static int fs_root_objectid(u64 objectid) return 0; }

[PATCH] Fix tree logs parallel sync

2009-01-19 Thread Yan Zheng
Hello, To improve performance, btrfs_sync_log merges tree log sync requests. But it wrongly merges sync requests for different tree logs. If multiple tree logs are synced at the same time, only one tree log, only one of them actually gets synced. This patch has following changes to fix the bug.

Re: Warning and BUG with btrfs and corrupted image

2009-01-19 Thread Pavel Machek
On Tue 2009-01-13 15:43:07, Eric Sesterhenn wrote: * Chris Mason (chris.ma...@oracle.com) wrote: On Tue, 2009-01-13 at 15:21 +0100, Eric Sesterhenn wrote: Hi, when mounting an intentionally corrupted btrfs filesystem i get the following warning and bug message. The image can be

Re: gcc inlining heuristics was Re: [PATCH -v7][RFC]: mutex: implement adaptive spinning

2009-01-19 Thread Nick Piggin
On Tue, Jan 20, 2009 at 08:01:52AM +1100, Linus Torvalds wrote: On Mon, 19 Jan 2009, Nick Piggin wrote: I want to know what is the problem with the restrict keyword? I'm sure I've read Linus ranting about how bad it is in the past... No, I don't think I've ranted about 'restrict'.

Re: gcc inlining heuristics was Re: [PATCH -v7][RFC]: mutex: implement adaptive spinning

2009-01-19 Thread Andi Kleen
The problem with 'restrict' is that almost nobody uses it, and it does Also gcc traditionally didn't do a very good job using it (this might be better in the very latest versions). At least some of the 3.x often discarded this information. automatically. But it should work well as a way to

Re: Warning and BUG with btrfs and corrupted image

2009-01-19 Thread Eric Sesterhenn
Hi, * Pavel Machek (pa...@suse.cz) wrote: On Tue 2009-01-13 15:43:07, Eric Sesterhenn wrote: * Chris Mason (chris.ma...@oracle.com) wrote: On Tue, 2009-01-13 at 15:21 +0100, Eric Sesterhenn wrote: Hi, when mounting an intentionally corrupted btrfs filesystem i get the