diff options
-rw-r--r-- | fs/gfs2/dir.c | 9 | ||||
-rw-r--r-- | include/uapi/linux/gfs2_ondisk.h | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index fa32655449c8..ffcfdd18d485 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -1684,6 +1684,14 @@ static int dir_new_leaf(struct inode *inode, const struct qstr *name) | |||
1684 | return 0; | 1684 | return 0; |
1685 | } | 1685 | } |
1686 | 1686 | ||
1687 | static u16 gfs2_inode_ra_len(const struct gfs2_inode *ip) | ||
1688 | { | ||
1689 | u64 where = ip->i_no_addr + 1; | ||
1690 | if (ip->i_eattr == where) | ||
1691 | return 1; | ||
1692 | return 0; | ||
1693 | } | ||
1694 | |||
1687 | /** | 1695 | /** |
1688 | * gfs2_dir_add - Add new filename into directory | 1696 | * gfs2_dir_add - Add new filename into directory |
1689 | * @inode: The directory inode | 1697 | * @inode: The directory inode |
@@ -1721,6 +1729,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, | |||
1721 | dent = gfs2_init_dirent(inode, dent, name, bh); | 1729 | dent = gfs2_init_dirent(inode, dent, name, bh); |
1722 | gfs2_inum_out(nip, dent); | 1730 | gfs2_inum_out(nip, dent); |
1723 | dent->de_type = cpu_to_be16(IF2DT(nip->i_inode.i_mode)); | 1731 | dent->de_type = cpu_to_be16(IF2DT(nip->i_inode.i_mode)); |
1732 | dent->de_rahead = cpu_to_be16(gfs2_inode_ra_len(nip)); | ||
1724 | tv = CURRENT_TIME; | 1733 | tv = CURRENT_TIME; |
1725 | if (ip->i_diskflags & GFS2_DIF_EXHASH) { | 1734 | if (ip->i_diskflags & GFS2_DIF_EXHASH) { |
1726 | leaf = (struct gfs2_leaf *)bh->b_data; | 1735 | leaf = (struct gfs2_leaf *)bh->b_data; |
diff --git a/include/uapi/linux/gfs2_ondisk.h b/include/uapi/linux/gfs2_ondisk.h index 310020816809..db3fdd083882 100644 --- a/include/uapi/linux/gfs2_ondisk.h +++ b/include/uapi/linux/gfs2_ondisk.h | |||
@@ -304,7 +304,13 @@ struct gfs2_dirent { | |||
304 | __be16 de_rec_len; | 304 | __be16 de_rec_len; |
305 | __be16 de_name_len; | 305 | __be16 de_name_len; |
306 | __be16 de_type; | 306 | __be16 de_type; |
307 | __u8 __pad[14]; | 307 | union { |
308 | __u8 __pad[14]; | ||
309 | struct { | ||
310 | __be16 de_rahead; | ||
311 | __u8 pad2[12]; | ||
312 | }; | ||
313 | }; | ||
308 | }; | 314 | }; |
309 | 315 | ||
310 | /* | 316 | /* |