Re: f2fs on GTA02

2012-12-11 Thread Phil Vandry

On 2012-12-11 02:19, Martin Jansa wrote:

3.2 kernel works pretty good
https://github.com/shr-distribution/linux/tree/om-gta02/3.2/master

there are branches also for 3.5 and GNUtoo is working on it.


Oh, wow. That means that the wiki page
http://wiki.openmoko.org/wiki/Kernel
is way behind. Thanks for the pointer to the more recent stuff.

-v

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: f2fs on GTA02

2012-12-11 Thread Peter Viskup

On 12/06/2012 10:19 PM, Phil Vandry wrote:

Hello Freerunner users,

I am interested in using the new f2fs filesystem created by Kim 
Jaegeuk at Samsung on the µSD cards of a bunch of GTA02s. Right now 
it's undergoing testing in linux-next and there are several fresh 
discussion threads about it on lkml. I intend to wait until the code 
has stabilized a bit before making the attempt.


First, is this a good idea? Also, is anyone else interested?

The problem is that the code only compiles against recent Linux 
kernels and the newest kernel available for GTA02 is 2.6.39. I see two 
options:


1. Get Linux 3.7 working on the GTA02

2. Get f2fs working on Linux 2.6.39

Both options are challenging but I have to go for #2 because I don't 
have the knowledge to do #1.


For #1: There are quite a few differences between upstream 2.6.39 and 
om-gta02-2.6.39 kernels. Some of the patches I understand and could 
re-apply against a more recent kernel, some of them have already been 
integrated upstream, but others are mysterious to me and even if I 
could apply them I can't guess whether or not they ought to still be 
applied. One big issue is that the glamo driver is not present 
upstream (and ar6000 also?).


For #2: I have already prepared a patch to backport f2fs to 
2.6.34/2.6.39 but there have been quite a lot of changes in the vfs 
and other areas in the intervening time. The patch is 817 lines long. 
Most of it is straightforward, though there were one or two tricky 
bits. The only thing I have achieved so far is getting it to compile 
with no errors and no warnings. That's a start, but it's not a 
guarantee that the filesystem will actually work!


A significant problem with #2 is maintenance and bug fixes going 
forward. I would have to backport all future changes to f2fs.


Anyway, for the information of anyone who's interested, I plan to at 
least give option #2 a try and see if I might be lucky :-)


-v

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community



Hi Phil,
would be great to see how it performs. I would like to ask you to 
publish outcomes of your performance tests on the openmoko wiki [1] or 
here on the list. I found UBIFS an great filesystem for the OpenMoko 
with great performance and less memory requirements.
QtMoko with UBIFS needed approximately 10MB (don't remember the real 
number - it could be double) less memory than image with JFFS2.
On devices with such small amount of memory as OpenMoko have the 
optimization of memory use is important - not only read/write speed. 
Today's smartphones have much more memory and I am curious if Kim did 
take care of minimization of memory structures of this fs.


Looking forward for your reports.

[1] http://wiki.openmoko.org/wiki/UBIFS#Performance

--
Peter Viskup

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: f2fs on GTA02

2012-12-11 Thread Phil Vandry

On 2012-12-11 13:40, Peter Viskup wrote:

would be great to see how it performs. I would like to ask you to
publish outcomes of your performance tests on the openmoko wiki [1] or
here on the list. I found UBIFS an great filesystem for the OpenMoko


Hi Peter,

Please note that UBIFS, like jffs2, is a filesystem designed to be used 
with flash that you have direct access to (MTD devices). It can be used 
on the Freerunner's internal NAND flash. What I'm talking about here is 
f2fs, a filesystem designed to be used on a block device. In that sense 
it is like ext4 and most other well known filesystems, not like UBIFS. 
It can be used on the Freerunner's µSD card.


I will of course report my experience with f2fs once I try it out.

-v

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: f2fs on GTA02

2012-12-10 Thread Martin Jansa
On Thu, Dec 06, 2012 at 04:19:37PM -0500, Phil Vandry wrote:
 Hello Freerunner users,
 
 I am interested in using the new f2fs filesystem created by Kim Jaegeuk 
 at Samsung on the µSD cards of a bunch of GTA02s. Right now it's 
 undergoing testing in linux-next and there are several fresh discussion 
 threads about it on lkml. I intend to wait until the code has stabilized 
 a bit before making the attempt.
 
 First, is this a good idea? Also, is anyone else interested?
 
 The problem is that the code only compiles against recent Linux kernels 
 and the newest kernel available for GTA02 is 2.6.39. I see two options:
 
 1. Get Linux 3.7 working on the GTA02

3.2 kernel works pretty good
https://github.com/shr-distribution/linux/tree/om-gta02/3.2/master

there are branches also for 3.5 and GNUtoo is working on it.

Cheers,

 
 2. Get f2fs working on Linux 2.6.39
 
 Both options are challenging but I have to go for #2 because I don't 
 have the knowledge to do #1.
 
 For #1: There are quite a few differences between upstream 2.6.39 and 
 om-gta02-2.6.39 kernels. Some of the patches I understand and could 
 re-apply against a more recent kernel, some of them have already been 
 integrated upstream, but others are mysterious to me and even if I could 
 apply them I can't guess whether or not they ought to still be applied. 
 One big issue is that the glamo driver is not present upstream (and 
 ar6000 also?).
 
 For #2: I have already prepared a patch to backport f2fs to 
 2.6.34/2.6.39 but there have been quite a lot of changes in the vfs and 
 other areas in the intervening time. The patch is 817 lines long. Most 
 of it is straightforward, though there were one or two tricky bits. The 
 only thing I have achieved so far is getting it to compile with no 
 errors and no warnings. That's a start, but it's not a guarantee that 
 the filesystem will actually work!
 
 A significant problem with #2 is maintenance and bug fixes going 
 forward. I would have to backport all future changes to f2fs.
 
 Anyway, for the information of anyone who's interested, I plan to at 
 least give option #2 a try and see if I might be lucky :-)
 
 -v
 
 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community

-- 
Martin 'JaMa' Jansa jabber: martin.ja...@gmail.com


signature.asc
Description: Digital signature
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


f2fs on GTA02

2012-12-06 Thread Phil Vandry

Hello Freerunner users,

I am interested in using the new f2fs filesystem created by Kim Jaegeuk 
at Samsung on the µSD cards of a bunch of GTA02s. Right now it's 
undergoing testing in linux-next and there are several fresh discussion 
threads about it on lkml. I intend to wait until the code has stabilized 
a bit before making the attempt.


First, is this a good idea? Also, is anyone else interested?

The problem is that the code only compiles against recent Linux kernels 
and the newest kernel available for GTA02 is 2.6.39. I see two options:


1. Get Linux 3.7 working on the GTA02

2. Get f2fs working on Linux 2.6.39

Both options are challenging but I have to go for #2 because I don't 
have the knowledge to do #1.


For #1: There are quite a few differences between upstream 2.6.39 and 
om-gta02-2.6.39 kernels. Some of the patches I understand and could 
re-apply against a more recent kernel, some of them have already been 
integrated upstream, but others are mysterious to me and even if I could 
apply them I can't guess whether or not they ought to still be applied. 
One big issue is that the glamo driver is not present upstream (and 
ar6000 also?).


For #2: I have already prepared a patch to backport f2fs to 
2.6.34/2.6.39 but there have been quite a lot of changes in the vfs and 
other areas in the intervening time. The patch is 817 lines long. Most 
of it is straightforward, though there were one or two tricky bits. The 
only thing I have achieved so far is getting it to compile with no 
errors and no warnings. That's a start, but it's not a guarantee that 
the filesystem will actually work!


A significant problem with #2 is maintenance and bug fixes going 
forward. I would have to backport all future changes to f2fs.


Anyway, for the information of anyone who's interested, I plan to at 
least give option #2 a try and see if I might be lucky :-)


-v

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: f2fs on GTA02

2012-12-06 Thread Dr. H. Nikolaus Schaller

Am 06.12.2012 um 22:19 schrieb Phil Vandry:

 Hello Freerunner users,
 
 I am interested in using the new f2fs filesystem created by Kim Jaegeuk at 
 Samsung on the µSD cards of a bunch of GTA02s. Right now it's undergoing 
 testing in linux-next and there are several fresh discussion threads about it 
 on lkml. I intend to wait until the code has stabilized a bit before making 
 the attempt.
 
 First, is this a good idea? Also, is anyone else interested?
 
 The problem is that the code only compiles against recent Linux kernels and 
 the newest kernel available for GTA02 is 2.6.39. I see two options:
 
 1. Get Linux 3.7 working on the GTA02
 
 2. Get f2fs working on Linux 2.6.39

3. develop 3.7/3.8 for GTA04 - the newest complete kernel is 3.5 and someone 
has recently posted first success on a 3.6 kernel with device tree.

 
 Both options are challenging but I have to go for #2 because I don't have the 
 knowledge to do #1.
 
 For #1: There are quite a few differences between upstream 2.6.39 and 
 om-gta02-2.6.39 kernels. Some of the patches I understand and could re-apply 
 against a more recent kernel, some of them have already been integrated 
 upstream, but others are mysterious to me and even if I could apply them I 
 can't guess whether or not they ought to still be applied. One big issue is 
 that the glamo driver is not present upstream (and ar6000 also?).
 
 For #2: I have already prepared a patch to backport f2fs to 2.6.34/2.6.39 but 
 there have been quite a lot of changes in the vfs and other areas in the 
 intervening time. The patch is 817 lines long. Most of it is straightforward, 
 though there were one or two tricky bits. The only thing I have achieved so 
 far is getting it to compile with no errors and no warnings. That's a start, 
 but it's not a guarantee that the filesystem will actually work!
 
 A significant problem with #2 is maintenance and bug fixes going forward. I 
 would have to backport all future changes to f2fs.
 
 Anyway, for the information of anyone who's interested, I plan to at least 
 give option #2 a try and see if I might be lucky :-)
 
 -v
 
 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: f2fs on GTA02

2012-12-06 Thread arne anka

Hello Freerunner users,

I am interested in using the new f2fs filesystem created by Kim Jaegeuk  
at Samsung on the µSD cards of a bunch of GTA02s. Right now it's ...


1. Get Linux 3.7 working on the GTA02



3. develop 3.7/3.8 for GTA04


how's that going to help when he's specifically asking about the GTA02?

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: f2fs on GTA02

2012-12-06 Thread Phil Vandry

On 2012-12-06 16:35, Dr. H. Nikolaus Schaller wrote:

3. develop 3.7/3.8 for GTA04 - the newest complete kernel is 3.5 and someone 
has recently posted first success on a 3.6 kernel with device tree.


Oh, very true, very true :-) But we also have a lot of GTA02 already 
deployed and I would quite like to have it working on those devices.


-v

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: f2fs on GTA02

2012-12-06 Thread Dr. H. Nikolaus Schaller

Am 06.12.2012 um 22:42 schrieb arne anka:

 Hello Freerunner users,
 
 I am interested in using the new f2fs filesystem created by Kim Jaegeuk at 
 Samsung on the µSD cards of a bunch of GTA02s. Right now it's ...
 
 1. Get Linux 3.7 working on the GTA02
 
 3. develop 3.7/3.8 for GTA04
 
 how's that going to help when he's specifically asking about the GTA02?

I think he is mainly interested in the f2fs. And needs some hardware to test 
it. So he can upgrade the GTA02 with a GTA04 board and that saves a lot of time 
by not backporting to an old system.


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: f2fs on GTA02

2012-12-06 Thread Phil Vandry

On 2012-12-06 16:56, NeilBrown wrote:

I plan to try it sometime in the next few week.


Cool!


No partitions means you need to have x-loader, uboot, and kernel in the
NAND.  That isn't difficult but it something to be aware of.


As you say, no problem. We already have our bootloader, kernel, and 
rootfs in NAND and I was already planning to not use a partition.



If you post the patch I can have a look and see if anything obvious stands
out.


Here it is. It's against 2.6.34, not 2.6.39, because that's what we 
happen to be using in our GTA02s in the field, but it probably wouldn't 
be much different for 2.6.39. Also, it's against the very first version 
of f2fs that was posted to lkml. I'm planning to redo it to integrate 
the latest version of f2fs.


Thanks for your feedback. I'll look forward to your 3.7 work for GTA04, 
and for GTA02 I'll try to get my backport working.


-v
From f50b49a4c40a02882eff1455600ddda571814e56 Mon Sep 17 00:00:00 2001
From: Phil Vandry van...@tzone.org
Date: Sat, 10 Nov 2012 22:05:51 -0500
Subject: backport f2fs to kernel 2.6.34

---
 fs/f2fs/acl.c |   61 --
 fs/f2fs/acl.h |2 +-
 fs/f2fs/data.c|4 +-
 fs/f2fs/dir.c |   30 ++--
 fs/f2fs/f2fs.h|5 +-
 fs/f2fs/file.c|  123 +
 fs/f2fs/gc.h  |2 +-
 fs/f2fs/inode.c   |6 +--
 fs/f2fs/namei.c   |   14 +++---
 fs/f2fs/node.c|8 ++--
 fs/f2fs/segment.c |   15 --
 fs/f2fs/super.c   |   24 --
 fs/f2fs/xattr.c   |6 +-
 fs/f2fs/xattr.h   |   10 ++--
 14 files changed, 139 insertions(+), 171 deletions(-)

diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index ce661ae..bc58644 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -190,6 +190,23 @@ struct posix_acl *f2fs_get_acl(struct inode *inode, int type)
 	return acl;
 }
 
+int
+f2fs_check_acl(struct inode *inode, int mask)
+{
+	struct posix_acl *acl;
+
+	acl = f2fs_get_acl(inode, ACL_TYPE_ACCESS);
+	if (IS_ERR(acl))
+		return PTR_ERR(acl);
+	if (acl) {
+		int error = posix_acl_permission(inode, acl, mask);
+		posix_acl_release(acl);
+		return error;
+	}
+
+	return -EAGAIN;
+}
+
 static int f2fs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
 {
 	struct f2fs_sb_info *sbi = F2FS_SB(inode-i_sb);
@@ -208,9 +225,11 @@ static int f2fs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
 	case ACL_TYPE_ACCESS:
 		name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
 		if (acl) {
-			error = posix_acl_equiv_mode(acl, inode-i_mode);
+			mode_t mode = inode-i_mode;
+			error = posix_acl_equiv_mode(acl, mode);
 			if (error  0)
 return error;
+			inode-i_mode = mode;
 			set_acl_inode(fi, inode-i_mode);
 			if (error == 0)
 acl = NULL;
@@ -262,17 +281,28 @@ int f2fs_init_acl(struct inode *inode, struct inode *dir)
 	}
 
 	if (test_opt(sbi, POSIX_ACL)  acl) {
+		struct posix_acl *clone;
+		mode_t mode;
 
 		if (S_ISDIR(inode-i_mode)) {
 			error = f2fs_set_acl(inode, ACL_TYPE_DEFAULT, acl);
 			if (error)
 goto cleanup;
 		}
-		error = posix_acl_create(acl, GFP_KERNEL, inode-i_mode);
-		if (error  0)
-			return error;
-		if (error  0)
-			error = f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl);
+		clone = posix_acl_clone(acl, GFP_KERNEL);
+		error = -ENOMEM;
+		if (!clone)
+			goto cleanup;
+		mode = inode-i_mode;
+		error = posix_acl_create_masq(clone, mode);
+		if (error = 0) {
+			inode-i_mode = mode;
+			if (error  0) {
+/* This is an extended ACL */
+error = f2fs_set_acl(inode, ACL_TYPE_ACCESS, clone);
+			}
+		}
+		posix_acl_release(clone);
 	}
 cleanup:
 	posix_acl_release(acl);
@@ -282,7 +312,7 @@ cleanup:
 int f2fs_acl_chmod(struct inode *inode)
 {
 	struct f2fs_sb_info *sbi = F2FS_SB(inode-i_sb);
-	struct posix_acl *acl;
+	struct posix_acl *acl, *clone;
 	int error;
 	mode_t mode = get_inode_mode(inode);
 
@@ -295,11 +325,14 @@ int f2fs_acl_chmod(struct inode *inode)
 	if (IS_ERR(acl) || !acl)
 		return PTR_ERR(acl);
 
-	error = posix_acl_chmod(acl, GFP_KERNEL, mode);
-	if (error)
-		return error;
-	error = f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl);
+	clone = posix_acl_clone(acl, GFP_KERNEL);
 	posix_acl_release(acl);
+	if (!clone)
+		return -ENOMEM;
+	error = posix_acl_chmod_masq(clone, inode-i_mode);
+	if (!error)
+		error = f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl);
+	posix_acl_release(clone);
 	return error;
 }
 
@@ -362,7 +395,7 @@ static int f2fs_xattr_set_acl(struct dentry *dentry, const char *name,
 	if (strcmp(name, ) != 0)
 		return -EINVAL;
 
-	if (!inode_owner_or_capable(inode))
+	if (!is_owner_or_cap(inode))
 		return -EPERM;
 
 	if (value) {
@@ -385,7 +418,7 @@ release_and_out:
 	return error;
 }
 
-const struct xattr_handler f2fs_xattr_acl_default_handler = {
+struct xattr_handler f2fs_xattr_acl_default_handler = {
 	.prefix = POSIX_ACL_XATTR_DEFAULT,
 	.flags = ACL_TYPE_DEFAULT,
 	.list = f2fs_xattr_list_acl,
@@ -393,7 +426,7 @@ const struct xattr_handler f2fs_xattr_acl_default_handler = {