diff options
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index ca9ca5a3c535..89299085450e 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -610,7 +610,9 @@ __xfs_iflock( | |||
610 | 610 | ||
611 | STATIC uint | 611 | STATIC uint |
612 | _xfs_dic2xflags( | 612 | _xfs_dic2xflags( |
613 | __uint16_t di_flags) | 613 | __uint16_t di_flags, |
614 | uint64_t di_flags2, | ||
615 | bool has_attr) | ||
614 | { | 616 | { |
615 | uint flags = 0; | 617 | uint flags = 0; |
616 | 618 | ||
@@ -645,25 +647,32 @@ _xfs_dic2xflags( | |||
645 | flags |= FS_XFLAG_FILESTREAM; | 647 | flags |= FS_XFLAG_FILESTREAM; |
646 | } | 648 | } |
647 | 649 | ||
650 | if (di_flags2 & XFS_DIFLAG2_ANY) { | ||
651 | if (di_flags2 & XFS_DIFLAG2_DAX) | ||
652 | flags |= FS_XFLAG_DAX; | ||
653 | } | ||
654 | |||
655 | if (has_attr) | ||
656 | flags |= FS_XFLAG_HASATTR; | ||
657 | |||
648 | return flags; | 658 | return flags; |
649 | } | 659 | } |
650 | 660 | ||
651 | uint | 661 | uint |
652 | xfs_ip2xflags( | 662 | xfs_ip2xflags( |
653 | xfs_inode_t *ip) | 663 | struct xfs_inode *ip) |
654 | { | 664 | { |
655 | xfs_icdinode_t *dic = &ip->i_d; | 665 | struct xfs_icdinode *dic = &ip->i_d; |
656 | 666 | ||
657 | return _xfs_dic2xflags(dic->di_flags) | | 667 | return _xfs_dic2xflags(dic->di_flags, dic->di_flags2, XFS_IFORK_Q(ip)); |
658 | (XFS_IFORK_Q(ip) ? FS_XFLAG_HASATTR : 0); | ||
659 | } | 668 | } |
660 | 669 | ||
661 | uint | 670 | uint |
662 | xfs_dic2xflags( | 671 | xfs_dic2xflags( |
663 | xfs_dinode_t *dip) | 672 | struct xfs_dinode *dip) |
664 | { | 673 | { |
665 | return _xfs_dic2xflags(be16_to_cpu(dip->di_flags)) | | 674 | return _xfs_dic2xflags(be16_to_cpu(dip->di_flags), |
666 | (XFS_DFORK_Q(dip) ? FS_XFLAG_HASATTR : 0); | 675 | be64_to_cpu(dip->di_flags2), XFS_DFORK_Q(dip)); |
667 | } | 676 | } |
668 | 677 | ||
669 | /* | 678 | /* |
@@ -862,7 +871,8 @@ xfs_ialloc( | |||
862 | case S_IFREG: | 871 | case S_IFREG: |
863 | case S_IFDIR: | 872 | case S_IFDIR: |
864 | if (pip && (pip->i_d.di_flags & XFS_DIFLAG_ANY)) { | 873 | if (pip && (pip->i_d.di_flags & XFS_DIFLAG_ANY)) { |
865 | uint di_flags = 0; | 874 | uint64_t di_flags2 = 0; |
875 | uint di_flags = 0; | ||
866 | 876 | ||
867 | if (S_ISDIR(mode)) { | 877 | if (S_ISDIR(mode)) { |
868 | if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) | 878 | if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) |
@@ -898,7 +908,11 @@ xfs_ialloc( | |||
898 | di_flags |= XFS_DIFLAG_NODEFRAG; | 908 | di_flags |= XFS_DIFLAG_NODEFRAG; |
899 | if (pip->i_d.di_flags & XFS_DIFLAG_FILESTREAM) | 909 | if (pip->i_d.di_flags & XFS_DIFLAG_FILESTREAM) |
900 | di_flags |= XFS_DIFLAG_FILESTREAM; | 910 | di_flags |= XFS_DIFLAG_FILESTREAM; |
911 | if (pip->i_d.di_flags2 & XFS_DIFLAG2_DAX) | ||
912 | di_flags2 |= XFS_DIFLAG2_DAX; | ||
913 | |||
901 | ip->i_d.di_flags |= di_flags; | 914 | ip->i_d.di_flags |= di_flags; |
915 | ip->i_d.di_flags2 |= di_flags2; | ||
902 | } | 916 | } |
903 | /* FALLTHROUGH */ | 917 | /* FALLTHROUGH */ |
904 | case S_IFLNK: | 918 | case S_IFLNK: |