aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBadari Pulavarty <pbadari@us.ibm.com>2006-10-11 04:21:09 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:17 -0400
commita1ddeb7eaecea6a924e3a79aa386797020cb436f (patch)
treeaa044e5447394097b9a6e8d1222988ba50d3b8b5
parent299717696d48531d70aeb4614c3939e4a28456c1 (diff)
[PATCH] ext4: 48bit i_file_acl
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> Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/ext4/inode.c10
-rw-r--r--include/linux/ext4_fs.h6
2 files changed, 14 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 2b81b1324a6f..9db8cff3baa4 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2643,6 +2643,11 @@ void ext4_read_inode(struct inode * inode)
2643 ei->i_frag_size = raw_inode->i_fsize; 2643 ei->i_frag_size = raw_inode->i_fsize;
2644#endif 2644#endif
2645 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl); 2645 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl);
2646 if ((sizeof(sector_t) > 4) &&
2647 (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
2648 cpu_to_le32(EXT4_OS_HURD)))
2649 ei->i_file_acl |=
2650 ((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32;
2646 if (!S_ISREG(inode->i_mode)) { 2651 if (!S_ISREG(inode->i_mode)) {
2647 ei->i_dir_acl = le32_to_cpu(raw_inode->i_dir_acl); 2652 ei->i_dir_acl = le32_to_cpu(raw_inode->i_dir_acl);
2648 } else { 2653 } else {
@@ -2776,6 +2781,11 @@ static int ext4_do_update_inode(handle_t *handle,
2776 raw_inode->i_frag = ei->i_frag_no; 2781 raw_inode->i_frag = ei->i_frag_no;
2777 raw_inode->i_fsize = ei->i_frag_size; 2782 raw_inode->i_fsize = ei->i_frag_size;
2778#endif 2783#endif
2784 if ((sizeof(sector_t) > 4) &&
2785 (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
2786 cpu_to_le32(EXT4_OS_HURD)))
2787 raw_inode->i_file_acl_high =
2788 cpu_to_le16(ei->i_file_acl >> 32);
2779 raw_inode->i_file_acl = cpu_to_le32(ei->i_file_acl); 2789 raw_inode->i_file_acl = cpu_to_le32(ei->i_file_acl);
2780 if (!S_ISREG(inode->i_mode)) { 2790 if (!S_ISREG(inode->i_mode)) {
2781 raw_inode->i_dir_acl = cpu_to_le32(ei->i_dir_acl); 2791 raw_inode->i_dir_acl = cpu_to_le32(ei->i_dir_acl);
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index e952c6db9690..63ed89f5b27b 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -298,7 +298,7 @@ struct ext4_inode {
298 struct { 298 struct {
299 __u8 l_i_frag; /* Fragment number */ 299 __u8 l_i_frag; /* Fragment number */
300 __u8 l_i_fsize; /* Fragment size */ 300 __u8 l_i_fsize; /* Fragment size */
301 __u16 i_pad1; 301 __le16 l_i_file_acl_high;
302 __le16 l_i_uid_high; /* these 2 fields */ 302 __le16 l_i_uid_high; /* these 2 fields */
303 __le16 l_i_gid_high; /* were reserved2[0] */ 303 __le16 l_i_gid_high; /* were reserved2[0] */
304 __u32 l_i_reserved2; 304 __u32 l_i_reserved2;
@@ -314,7 +314,7 @@ struct ext4_inode {
314 struct { 314 struct {
315 __u8 m_i_frag; /* Fragment number */ 315 __u8 m_i_frag; /* Fragment number */
316 __u8 m_i_fsize; /* Fragment size */ 316 __u8 m_i_fsize; /* Fragment size */
317 __u16 m_pad1; 317 __le16 m_i_file_acl_high;
318 __u32 m_i_reserved2[2]; 318 __u32 m_i_reserved2[2];
319 } masix2; 319 } masix2;
320 } osd2; /* OS dependent 2 */ 320 } osd2; /* OS dependent 2 */
@@ -328,6 +328,7 @@ struct ext4_inode {
328#define i_reserved1 osd1.linux1.l_i_reserved1 328#define i_reserved1 osd1.linux1.l_i_reserved1
329#define i_frag osd2.linux2.l_i_frag 329#define i_frag osd2.linux2.l_i_frag
330#define i_fsize osd2.linux2.l_i_fsize 330#define i_fsize osd2.linux2.l_i_fsize
331#define i_file_acl_high osd2.linux2.l_i_file_acl_high
331#define i_uid_low i_uid 332#define i_uid_low i_uid
332#define i_gid_low i_gid 333#define i_gid_low i_gid
333#define i_uid_high osd2.linux2.l_i_uid_high 334#define i_uid_high osd2.linux2.l_i_uid_high
@@ -348,6 +349,7 @@ struct ext4_inode {
348#define i_reserved1 osd1.masix1.m_i_reserved1 349#define i_reserved1 osd1.masix1.m_i_reserved1
349#define i_frag osd2.masix2.m_i_frag 350#define i_frag osd2.masix2.m_i_frag
350#define i_fsize osd2.masix2.m_i_fsize 351#define i_fsize osd2.masix2.m_i_fsize
352#define i_file_acl_high osd2.masix2.m_i_file_acl_high
351#define i_reserved2 osd2.masix2.m_i_reserved2 353#define i_reserved2 osd2.masix2.m_i_reserved2
352 354
353#endif /* defined(__KERNEL__) || defined(__linux__) */ 355#endif /* defined(__KERNEL__) || defined(__linux__) */