diff options
Diffstat (limited to 'fs/xfs/xfs_vfsops.c')
-rw-r--r-- | fs/xfs/xfs_vfsops.c | 62 |
1 files changed, 24 insertions, 38 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 42bcc0215203..f1a904e23ade 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
@@ -795,7 +795,6 @@ xfs_statvfs( | |||
795 | xfs_mount_t *mp; | 795 | xfs_mount_t *mp; |
796 | xfs_sb_t *sbp; | 796 | xfs_sb_t *sbp; |
797 | unsigned long s; | 797 | unsigned long s; |
798 | u64 id; | ||
799 | 798 | ||
800 | mp = XFS_BHVTOM(bdp); | 799 | mp = XFS_BHVTOM(bdp); |
801 | sbp = &(mp->m_sb); | 800 | sbp = &(mp->m_sb); |
@@ -823,9 +822,7 @@ xfs_statvfs( | |||
823 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); | 822 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); |
824 | XFS_SB_UNLOCK(mp, s); | 823 | XFS_SB_UNLOCK(mp, s); |
825 | 824 | ||
826 | id = huge_encode_dev(mp->m_dev); | 825 | xfs_statvfs_fsid(statp, mp); |
827 | statp->f_fsid.val[0] = (u32)id; | ||
828 | statp->f_fsid.val[1] = (u32)(id >> 32); | ||
829 | statp->f_namelen = MAXNAMELEN - 1; | 826 | statp->f_namelen = MAXNAMELEN - 1; |
830 | 827 | ||
831 | return 0; | 828 | return 0; |
@@ -906,7 +903,6 @@ xfs_sync_inodes( | |||
906 | xfs_inode_t *ip_next; | 903 | xfs_inode_t *ip_next; |
907 | xfs_buf_t *bp; | 904 | xfs_buf_t *bp; |
908 | vnode_t *vp = NULL; | 905 | vnode_t *vp = NULL; |
909 | vmap_t vmap; | ||
910 | int error; | 906 | int error; |
911 | int last_error; | 907 | int last_error; |
912 | uint64_t fflag; | 908 | uint64_t fflag; |
@@ -1101,48 +1097,21 @@ xfs_sync_inodes( | |||
1101 | * lock in xfs_ireclaim() after the inode is pulled from | 1097 | * lock in xfs_ireclaim() after the inode is pulled from |
1102 | * the mount list will sleep until we release it here. | 1098 | * the mount list will sleep until we release it here. |
1103 | * This keeps the vnode from being freed while we reference | 1099 | * This keeps the vnode from being freed while we reference |
1104 | * it. It is also cheaper and simpler than actually doing | 1100 | * it. |
1105 | * a vn_get() for every inode we touch here. | ||
1106 | */ | 1101 | */ |
1107 | if (xfs_ilock_nowait(ip, lock_flags) == 0) { | 1102 | if (xfs_ilock_nowait(ip, lock_flags) == 0) { |
1108 | |||
1109 | if ((flags & SYNC_BDFLUSH) || (vp == NULL)) { | 1103 | if ((flags & SYNC_BDFLUSH) || (vp == NULL)) { |
1110 | ip = ip->i_mnext; | 1104 | ip = ip->i_mnext; |
1111 | continue; | 1105 | continue; |
1112 | } | 1106 | } |
1113 | 1107 | ||
1114 | /* | 1108 | vp = vn_grab(vp); |
1115 | * We need to unlock the inode list lock in order | ||
1116 | * to lock the inode. Insert a marker record into | ||
1117 | * the inode list to remember our position, dropping | ||
1118 | * the lock is now done inside the IPOINTER_INSERT | ||
1119 | * macro. | ||
1120 | * | ||
1121 | * We also use the inode list lock to protect us | ||
1122 | * in taking a snapshot of the vnode version number | ||
1123 | * for use in calling vn_get(). | ||
1124 | */ | ||
1125 | VMAP(vp, vmap); | ||
1126 | IPOINTER_INSERT(ip, mp); | ||
1127 | |||
1128 | vp = vn_get(vp, &vmap); | ||
1129 | if (vp == NULL) { | 1109 | if (vp == NULL) { |
1130 | /* | 1110 | ip = ip->i_mnext; |
1131 | * The vnode was reclaimed once we let go | ||
1132 | * of the inode list lock. Skip to the | ||
1133 | * next list entry. Remove the marker. | ||
1134 | */ | ||
1135 | |||
1136 | XFS_MOUNT_ILOCK(mp); | ||
1137 | |||
1138 | mount_locked = B_TRUE; | ||
1139 | vnode_refed = B_FALSE; | ||
1140 | |||
1141 | IPOINTER_REMOVE(ip, mp); | ||
1142 | |||
1143 | continue; | 1111 | continue; |
1144 | } | 1112 | } |
1145 | 1113 | ||
1114 | IPOINTER_INSERT(ip, mp); | ||
1146 | xfs_ilock(ip, lock_flags); | 1115 | xfs_ilock(ip, lock_flags); |
1147 | 1116 | ||
1148 | ASSERT(vp == XFS_ITOV(ip)); | 1117 | ASSERT(vp == XFS_ITOV(ip)); |
@@ -1533,7 +1502,10 @@ xfs_syncsub( | |||
1533 | * eventually kicked out of the cache. | 1502 | * eventually kicked out of the cache. |
1534 | */ | 1503 | */ |
1535 | if (flags & SYNC_REFCACHE) { | 1504 | if (flags & SYNC_REFCACHE) { |
1536 | xfs_refcache_purge_some(mp); | 1505 | if (flags & SYNC_WAIT) |
1506 | xfs_refcache_purge_mp(mp); | ||
1507 | else | ||
1508 | xfs_refcache_purge_some(mp); | ||
1537 | } | 1509 | } |
1538 | 1510 | ||
1539 | /* | 1511 | /* |
@@ -1649,6 +1621,10 @@ xfs_vget( | |||
1649 | #define MNTOPT_SWIDTH "swidth" /* data volume stripe width */ | 1621 | #define MNTOPT_SWIDTH "swidth" /* data volume stripe width */ |
1650 | #define MNTOPT_NOUUID "nouuid" /* ignore filesystem UUID */ | 1622 | #define MNTOPT_NOUUID "nouuid" /* ignore filesystem UUID */ |
1651 | #define MNTOPT_MTPT "mtpt" /* filesystem mount point */ | 1623 | #define MNTOPT_MTPT "mtpt" /* filesystem mount point */ |
1624 | #define MNTOPT_GRPID "grpid" /* group-ID from parent directory */ | ||
1625 | #define MNTOPT_NOGRPID "nogrpid" /* group-ID from current process */ | ||
1626 | #define MNTOPT_BSDGROUPS "bsdgroups" /* group-ID from parent directory */ | ||
1627 | #define MNTOPT_SYSVGROUPS "sysvgroups" /* group-ID from current process */ | ||
1652 | #define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ | 1628 | #define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ |
1653 | #define MNTOPT_IHASHSIZE "ihashsize" /* size of inode hash table */ | 1629 | #define MNTOPT_IHASHSIZE "ihashsize" /* size of inode hash table */ |
1654 | #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ | 1630 | #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ |
@@ -1769,6 +1745,12 @@ xfs_parseargs( | |||
1769 | } | 1745 | } |
1770 | args->flags |= XFSMNT_IHASHSIZE; | 1746 | args->flags |= XFSMNT_IHASHSIZE; |
1771 | args->ihashsize = simple_strtoul(value, &eov, 10); | 1747 | args->ihashsize = simple_strtoul(value, &eov, 10); |
1748 | } else if (!strcmp(this_char, MNTOPT_GRPID) || | ||
1749 | !strcmp(this_char, MNTOPT_BSDGROUPS)) { | ||
1750 | vfsp->vfs_flag |= VFS_GRPID; | ||
1751 | } else if (!strcmp(this_char, MNTOPT_NOGRPID) || | ||
1752 | !strcmp(this_char, MNTOPT_SYSVGROUPS)) { | ||
1753 | vfsp->vfs_flag &= ~VFS_GRPID; | ||
1772 | } else if (!strcmp(this_char, MNTOPT_WSYNC)) { | 1754 | } else if (!strcmp(this_char, MNTOPT_WSYNC)) { |
1773 | args->flags |= XFSMNT_WSYNC; | 1755 | args->flags |= XFSMNT_WSYNC; |
1774 | } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) { | 1756 | } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) { |
@@ -1890,6 +1872,7 @@ xfs_showargs( | |||
1890 | }; | 1872 | }; |
1891 | struct proc_xfs_info *xfs_infop; | 1873 | struct proc_xfs_info *xfs_infop; |
1892 | struct xfs_mount *mp = XFS_BHVTOM(bhv); | 1874 | struct xfs_mount *mp = XFS_BHVTOM(bhv); |
1875 | struct vfs *vfsp = XFS_MTOVFS(mp); | ||
1893 | 1876 | ||
1894 | for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { | 1877 | for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { |
1895 | if (mp->m_flags & xfs_infop->flag) | 1878 | if (mp->m_flags & xfs_infop->flag) |
@@ -1926,7 +1909,10 @@ xfs_showargs( | |||
1926 | 1909 | ||
1927 | if (!(mp->m_flags & XFS_MOUNT_32BITINOOPT)) | 1910 | if (!(mp->m_flags & XFS_MOUNT_32BITINOOPT)) |
1928 | seq_printf(m, "," MNTOPT_64BITINODE); | 1911 | seq_printf(m, "," MNTOPT_64BITINODE); |
1929 | 1912 | ||
1913 | if (vfsp->vfs_flag & VFS_GRPID) | ||
1914 | seq_printf(m, "," MNTOPT_GRPID); | ||
1915 | |||
1930 | return 0; | 1916 | return 0; |
1931 | } | 1917 | } |
1932 | 1918 | ||