linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 8/9] 48-bit block numbers for extended attributes
@ 2006-08-10  1:22 Mingming Cao
  2006-08-10  6:41 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Mingming Cao @ 2006-08-10  1:22 UTC (permalink / raw)
  To: akpm; +Cc: linux-fsdevel, ext2-devel, linux-kernel


As we are planning to support 48-bit block numbers for ext4,
we need to support 48-bit block numbers for extended attributes.
In the short term, we can do this by reuse (on-disk) 16-bit
padding (linux2.i_pad1 currently used only by "hurd") as high 
order bits for xattr. This patch basically does that.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>


---

 linux-2.6.18-rc4-ming/fs/ext4/inode.c         |    8 ++++++++
 linux-2.6.18-rc4-ming/include/linux/ext4_fs.h |    6 ++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff -puN fs/ext4/inode.c~ext4_48bit_i_file_acl fs/ext4/inode.c
--- linux-2.6.18-rc4/fs/ext4/inode.c~ext4_48bit_i_file_acl	2006-08-09 15:42:05.848401839 -0700
+++ linux-2.6.18-rc4-ming/fs/ext4/inode.c	2006-08-09 15:42:05.858401920 -0700
@@ -2641,6 +2641,10 @@ void ext4_read_inode(struct inode * inod
 	ei->i_frag_size = raw_inode->i_fsize;
 #endif
 	ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl);
+	if ((sizeof(sector_t) > 4) &&
+	    (EXT4_SB(inode->i_sb)->s_es->s_creator_os != EXT4_OS_HURD))
+		ei->i_file_acl |=
+			((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32;
 	if (!S_ISREG(inode->i_mode)) {
 		ei->i_dir_acl = le32_to_cpu(raw_inode->i_dir_acl);
 	} else {
@@ -2774,6 +2778,10 @@ static int ext4_do_update_inode(handle_t
 	raw_inode->i_frag = ei->i_frag_no;
 	raw_inode->i_fsize = ei->i_frag_size;
 #endif
+	if ((sizeof(sector_t) > 4) &&
+	    (EXT4_SB(inode->i_sb)->s_es->s_creator_os != EXT4_OS_HURD))
+		raw_inode->i_file_acl_high =
+			cpu_to_le16((__u64)ei->i_file_acl >> 32);
 	raw_inode->i_file_acl = cpu_to_le32(ei->i_file_acl);
 	if (!S_ISREG(inode->i_mode)) {
 		raw_inode->i_dir_acl = cpu_to_le32(ei->i_dir_acl);
diff -puN include/linux/ext4_fs.h~ext4_48bit_i_file_acl include/linux/ext4_fs.h
--- linux-2.6.18-rc4/include/linux/ext4_fs.h~ext4_48bit_i_file_acl	2006-08-09 15:42:05.851401864 -0700
+++ linux-2.6.18-rc4-ming/include/linux/ext4_fs.h	2006-08-09 15:42:05.860401937 -0700
@@ -285,7 +285,7 @@ struct ext4_inode {
 		struct {
 			__u8	l_i_frag;	/* Fragment number */
 			__u8	l_i_fsize;	/* Fragment size */
-			__u16	i_pad1;
+			__u16	l_i_file_acl_high;
 			__le16	l_i_uid_high;	/* these 2 fields    */
 			__le16	l_i_gid_high;	/* were reserved2[0] */
 			__u32	l_i_reserved2;
@@ -301,7 +301,7 @@ struct ext4_inode {
 		struct {
 			__u8	m_i_frag;	/* Fragment number */
 			__u8	m_i_fsize;	/* Fragment size */
-			__u16	m_pad1;
+			__u16	m_i_file_acl_high;
 			__u32	m_i_reserved2[2];
 		} masix2;
 	} osd2;				/* OS dependent 2 */
@@ -315,6 +315,7 @@ struct ext4_inode {
 #define i_reserved1	osd1.linux1.l_i_reserved1
 #define i_frag		osd2.linux2.l_i_frag
 #define i_fsize		osd2.linux2.l_i_fsize
+#define i_file_acl_high	osd2.linux2.l_i_file_acl_high
 #define i_uid_low	i_uid
 #define i_gid_low	i_gid
 #define i_uid_high	osd2.linux2.l_i_uid_high
@@ -335,6 +336,7 @@ struct ext4_inode {
 #define i_reserved1	osd1.masix1.m_i_reserved1
 #define i_frag		osd2.masix2.m_i_frag
 #define i_fsize		osd2.masix2.m_i_fsize
+#define i_file_acl_high	osd2.masix2.m_i_file_acl_high
 #define i_reserved2	osd2.masix2.m_i_reserved2
 
 #endif /* defined(__KERNEL__) || defined(__linux__) */

_



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 8/9] 48-bit block numbers for extended attributes
  2006-08-10  1:22 [PATCH 8/9] 48-bit block numbers for extended attributes Mingming Cao
@ 2006-08-10  6:41 ` Andrew Morton
  2006-08-10 17:27   ` Mingming Cao
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2006-08-10  6:41 UTC (permalink / raw)
  To: cmm; +Cc: linux-fsdevel, ext2-devel, linux-kernel

On Wed, 09 Aug 2006 18:22:09 -0700
Mingming Cao <cmm@us.ibm.com> wrote:

> As we are planning to support 48-bit block numbers for ext4,
> we need to support 48-bit block numbers for extended attributes.
> In the short term, we can do this by reuse (on-disk) 16-bit
> padding (linux2.i_pad1 currently used only by "hurd") as high 
> order bits for xattr. This patch basically does that.

Short-term tends to become medium-term, then you're stuck with it.

What is the plan here?

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 8/9] 48-bit block numbers for extended attributes
  2006-08-10  6:41 ` Andrew Morton
@ 2006-08-10 17:27   ` Mingming Cao
  0 siblings, 0 replies; 3+ messages in thread
From: Mingming Cao @ 2006-08-10 17:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-fsdevel, ext2-devel, linux-kernel

Andrew Morton wrote:

> On Wed, 09 Aug 2006 18:22:09 -0700
> Mingming Cao <cmm@us.ibm.com> wrote:
> 
> 
>>As we are planning to support 48-bit block numbers for ext4,
>>we need to support 48-bit block numbers for extended attributes.
>>In the short term, we can do this by reuse (on-disk) 16-bit
>>padding (linux2.i_pad1 currently used only by "hurd") as high 
>>order bits for xattr. This patch basically does that.
> 
> 
> Short-term tends to become medium-term, then you're stuck with it.
> 
> What is the plan here?

At the time we discuss how to support 48 bit xattr in the current inode, 
we were thinking about patching ext3, thus it's not likely we will going 
to do a deep surgery on the on-disk ext3 inode itself to have room for 
another 16bit xattr. So the plan at that is to steal some unused bits 
and construct with existing 32bit xattr to come with a 48bit xattr in total.

Given the fact that we are creating a new filesystem ext4, the ideal way 
(long term) probably we should support 64bit xattr in the ext4 inode, 
that is possible. The plan is to focus on support 48bit ext4 first, then 
probably move on next few things that also requires on-disk format 
changes, this is an experiment filesystem at this moment....

Thanks,
Mingming


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-10 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-10  1:22 [PATCH 8/9] 48-bit block numbers for extended attributes Mingming Cao
2006-08-10  6:41 ` Andrew Morton
2006-08-10 17:27   ` Mingming Cao

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).