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@xxxxxxx>
---
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 */
|