public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: reserve fields in inode for parent ptr and alloc policy
@ 2013-04-10 18:24 Mark Tinguely
  2013-04-10 18:56 ` Eric Sandeen
  2013-04-11  3:00 ` Dave Chinner
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Tinguely @ 2013-04-10 18:24 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-reserve-parent-and-allocation-fields-in-inode.patch --]
[-- Type: text/plain, Size: 3118 bytes --]

Reserve fields in new inode layout for parent pointer and
allocation policy.
		----
The inode will hold the parent information for the first
link to a file. Information for the other links will be
held in extended attribute entries.

The "di_parino" is the inode of the parent directory. The
directory information for this entry is located the parent
directory with "di_paroff" offset. 

The di_parino/di_paroff concept code is running.
		----
The "di_allocpolicy" will be used to remember the allocation
policy associated with this inode.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
---
 fs/xfs/xfs_dinode.h |    3 +++
 fs/xfs/xfs_inode.c  |    6 ++++++
 fs/xfs/xfs_inode.h  |    3 +++
 3 files changed, 12 insertions(+)

Index: b/fs/xfs/xfs_dinode.h
===================================================================
--- a/fs/xfs/xfs_dinode.h
+++ b/fs/xfs/xfs_dinode.h
@@ -76,6 +76,9 @@ typedef struct xfs_dinode {
 	__be64		di_changecount;	/* number of attribute changes */
 	__be64		di_lsn;		/* flush sequence */
 	__be64		di_flags2;	/* more random flags */
+	__be64		di_parino;	/* parent inode */
+	__be32		di_paroff;	/* offset into parent directory */
+	__be32		di_allocpolicy;	/* allocation policy number */
 	__u8		di_pad2[16];	/* more padding for future expansion */
 
 	/* fields only written to during inode creation */
Index: b/fs/xfs/xfs_inode.c
===================================================================
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -875,6 +875,9 @@ xfs_dinode_from_disk(
 		to->di_flags2 = be64_to_cpu(from->di_flags2);
 		to->di_ino = be64_to_cpu(from->di_ino);
 		to->di_lsn = be64_to_cpu(from->di_lsn);
+		to->di_parino = be64_to_cpu(from->di_parino);
+		to->di_paroff = be32_to_cpu(from->di_paroff);
+		to->di_allocpolicy = be32_to_cpu(from->di_allocpolicy);
 		memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2));
 		uuid_copy(&to->di_uuid, &from->di_uuid);
 	}
@@ -922,6 +925,9 @@ xfs_dinode_to_disk(
 		to->di_flags2 = cpu_to_be64(from->di_flags2);
 		to->di_ino = cpu_to_be64(from->di_ino);
 		to->di_lsn = cpu_to_be64(from->di_lsn);
+		to->di_parino = cpu_to_be64(from->di_parino);
+		to->di_paroff = cpu_to_be32(from->di_paroff);
+		to->di_allocpolicy = cpu_to_be32(from->di_allocpolicy);
 		memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2));
 		uuid_copy(&to->di_uuid, &from->di_uuid);
 	}
Index: b/fs/xfs/xfs_inode.h
===================================================================
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -159,6 +159,9 @@ typedef struct xfs_icdinode {
 	__uint64_t	di_changecount;	/* number of attribute changes */
 	xfs_lsn_t	di_lsn;		/* flush sequence */
 	__uint64_t	di_flags2;	/* more random flags */
+	xfs_ino_t	di_parino;	/* parent inode */
+	__uint32_t	di_paroff;	/* offset into parent directory */
+	__uint32_t	di_allocpolicy;	/* allocation policy number */
 	__uint8_t	di_pad2[16];	/* more padding for future expansion */
 
 	/* fields only written to during inode creation */


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2013-04-12  0:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10 18:24 [PATCH] xfs: reserve fields in inode for parent ptr and alloc policy Mark Tinguely
2013-04-10 18:56 ` Eric Sandeen
2013-04-10 19:39   ` Rich Johnston
2013-04-10 20:31     ` Mark Tinguely
2013-04-10 20:40       ` Eric Sandeen
2013-04-11  3:28       ` Dave Chinner
2013-04-11  3:00 ` Dave Chinner
2013-04-11 13:54   ` Mark Tinguely
2013-04-12  0:24     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox