This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[PATCH] XFS delayed allocation

Tags: None
(comma "," separated)
Athantor
Registered Member
Posts
45
Karma
0

[PATCH] XFS delayed allocation

Mon Apr 30, 2007 6:10 pm
I've been missing this feature from Azureus, so I thought that I'll implement it as is a fairly simple thing :-): patch.

Now 5G file is allocated in less than 1s instead of 20s, and 1024 * 3M are allocated in 10s vs. 1m05s.

It depends on xfsprogs(ktorrent will compile without it too, but won't use XFS methods; didn't test that :-().

It should be possible to implement similar feature for Reiser4 and Ext4, but since both of those FS-es are experimental and undocumented it has to wait.


I hope that I didn't break many things and someone else will find this patch useful too. :-)


Image Image
George
Moderator
Posts
5421
Karma
1

Re: [PATCH] XFS delayed allocation

Mon Apr 30, 2007 7:34 pm
Athantor wrote:I've been missing this feature from Azureus, so I thought that I'll implement it as is a fairly simple thing :-): patch.

Now 5G file is allocated in less than 1s instead of 20s, and 1024 * 3M are allocated in 10s vs. 1m05s.

It depends on xfsprogs(ktorrent will compile without it too, but won't use XFS methods; didn't test that :-().

It should be possible to implement similar feature for Reiser4 and Ext4, but since both of those FS-es are experimental and undocumented it has to wait.


I hope that I didn't break many things and someone else will find this patch useful too. :-)


Nice, I need to make sure it doesn't conflict with our full disk preallocate we added last month.

Does this xfs preallocate avoids fragmentation ?
Athantor
Registered Member
Posts
45
Karma
0

Re: [PATCH] XFS delayed allocation

Mon Apr 30, 2007 8:35 pm
George wrote:Nice,


Thank you. :-)

George wrote:I need to make sure it doesn't conflict with our full disk preallocate we added last month.


I've based my 'XfsPreallocate' on your 'FatPreallocate', so I hope it won't.

George wrote:Does this xfs preallocate avoids fragmentation ?


Yes, it's more modern way of preallocation, but filesystem has to support it, and every FS has its own way of using it. [1], [2], [3] (allocate-on-flash and extents), [4].

Raiser4 has its own undocumented, strange calls in libreiser4 and ext4 has 'EXT4_IOC_PREALLOCATE' ioctl, but I wasn't able to use it. I've also found on LKML patches adding this functionality to ext3, and messages suggesting using delalloc as posix_fallocate();


Image Image
Athantor
Registered Member
Posts
45
Karma
0

Mon Apr 30, 2007 10:29 pm
BTW:
While I was 'playing' with this, I've found that the labels showing free space in 'Open' file selector won't show correct values if 'Download to'/m_downloadLocation points to the location on other drive. Maybe this is intended, but personally I think that this is bit illogical, so I came with this.


Image Image
George
Moderator
Posts
5421
Karma
1

Tue May 01, 2007 2:06 pm
OK, XFS patch is committed
Athantor
Registered Member
Posts
45
Karma
0

Tue May 01, 2007 2:08 pm
Wow, thanks! :D


Image Image
George
Moderator
Posts
5421
Karma
1

Tue May 01, 2007 2:12 pm
The other patch to.

A big thanks for providing these patches.
lucke
Registered Member
Posts
205
Karma
0

Tue May 01, 2007 2:30 pm
Great!
Athantor
Registered Member
Posts
45
Karma
0

Fri May 04, 2007 9:21 am
As the XFS includes are b0rked, the '-ansi' flag breaks the compilation (at least for me :P): fix.


Image Image
George
Moderator
Posts
5421
Karma
1

Fri May 04, 2007 5:44 pm
Adding this fix breaks my compilation :

cd '/home/joris/ktorrent/newstuff/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make
compiling /home/joris/ktorrent/newstuff/libktorrent/util/fileops.cpp (/home/joris/ktorrent/newstuff/libktorrent/util/fileops.cpp)
compiling fileops.TUlo (g++)
/usr/include/xfs/platform_defs.h:41: error: conflicting declaration ‘typedef long long unsigned int __u64’
/home/joris/ktorrent/newstuff/libktorrent/util/fileops.cpp:46: error: ‘__u64’ has a previous declaration as ‘typedef uint64_t __u64’
/usr/include/xfs/platform_defs.h:42: error: conflicting declaration ‘typedef long long int __s64’
/home/joris/ktorrent/newstuff/libktorrent/util/fileops.cpp:47: error: ‘__s64’ has a previous declaration as ‘typedef int64_t __s64’
*** Exited with status: 2 ***
Athantor
Registered Member
Posts
45
Karma
0

Fri May 04, 2007 7:35 pm
I've found something like this:
/usr/include/asm/types.h wrote:
Code: Select all
#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)


guarding missing types; and this file is from:
equery wrote:
Code: Select all
athantor@athantor ~ % zsh belongs /usr/include/asm/types.h
[ Searching for file(s) /usr/include/asm/types.h in *... ]
sys-kernel/linux-headers-2.6.21 (/usr/include/asm/types.h)


This #if has changed between .20 and .21 (or guys from gentoo broke something ;-))

How about this: patch v2?


Image Image
George
Moderator
Posts
5421
Karma
1

Sun May 06, 2007 6:39 pm
It compiles so we will commit it.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot]