]> err.no Git - linux-2.6/blobdiff - fs/xfs/xfs_mount.c
Blackfin arch: Do not pollute name space used in linux-2.6.x/sound
[linux-2.6] / fs / xfs / xfs_mount.c
index f4daf1ec9931fee40f94ff81d0664bf67f3af518..ebdb76da527c81d6c021e0ffe995ef1395393c9e 100644 (file)
@@ -139,7 +139,7 @@ xfs_mount_init(void)
        AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail");
        spinlock_init(&mp->m_sb_lock, "xfs_sb");
        mutex_init(&mp->m_ilock);
-       initnsema(&mp->m_growlock, 1, "xfs_grow");
+       mutex_init(&mp->m_growlock);
        /*
         * Initialize the AIL.
         */
@@ -157,14 +157,8 @@ xfs_mount_init(void)
  */
 void
 xfs_mount_free(
-       xfs_mount_t     *mp,
-       int             remove_bhv)
+       xfs_mount_t     *mp)
 {
-       if (mp->m_ihash)
-               xfs_ihash_free(mp);
-       if (mp->m_chash)
-               xfs_chash_free(mp);
-
        if (mp->m_perag) {
                int     agno;
 
@@ -180,7 +174,7 @@ xfs_mount_free(
        AIL_LOCK_DESTROY(&mp->m_ail_lock);
        spinlock_destroy(&mp->m_sb_lock);
        mutex_destroy(&mp->m_ilock);
-       freesema(&mp->m_growlock);
+       mutex_destroy(&mp->m_growlock);
        if (mp->m_quotainfo)
                XFS_QM_DONE(mp);
 
@@ -191,15 +185,7 @@ xfs_mount_free(
        if (mp->m_logname != NULL)
                kmem_free(mp->m_logname, strlen(mp->m_logname) + 1);
 
-       if (remove_bhv) {
-               struct bhv_vfs  *vfsp = XFS_MTOVFS(mp);
-
-               bhv_remove_all_vfsops(vfsp, 0);
-               VFS_REMOVEBHV(vfsp, &mp->m_bhv);
-       }
-
        xfs_icsb_destroy_counters(mp);
-       kmem_free(mp, sizeof(xfs_mount_t));
 }
 
 /*
@@ -342,9 +328,19 @@ xfs_mount_validate_sb(
        return 0;
 }
 
+STATIC void
+xfs_initialize_perag_icache(
+       xfs_perag_t     *pag)
+{
+       if (!pag->pag_ici_init) {
+               rwlock_init(&pag->pag_ici_lock);
+               INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC);
+               pag->pag_ici_init = 1;
+       }
+}
+
 xfs_agnumber_t
 xfs_initialize_perag(
-       bhv_vfs_t       *vfs,
        xfs_mount_t     *mp,
        xfs_agnumber_t  agcount)
 {
@@ -362,7 +358,7 @@ xfs_initialize_perag(
        /* Clear the mount flag if no inode can overflow 32 bits
         * on this filesystem, or if specifically requested..
         */
-       if ((vfs->vfs_flag & VFS_32BITINODES) && ino > max_inum) {
+       if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > max_inum) {
                mp->m_flags |= XFS_MOUNT_32BITINODES;
        } else {
                mp->m_flags &= ~XFS_MOUNT_32BITINODES;
@@ -396,12 +392,14 @@ xfs_initialize_perag(
                        pag->pagi_inodeok = 1;
                        if (index < max_metadata)
                                pag->pagf_metadata = 1;
+                       xfs_initialize_perag_icache(pag);
                }
        } else {
                /* Setup default behavior for smaller filesystems */
                for (index = 0; index < agcount; index++) {
                        pag = &mp->m_perag[index];
                        pag->pagi_inodeok = 1;
+                       xfs_initialize_perag_icache(pag);
                }
        }
        return index;
@@ -749,7 +747,6 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount)
  */
 int
 xfs_mountfs(
-       bhv_vfs_t       *vfsp,
        xfs_mount_t     *mp,
        int             mfsi_flags)
 {
@@ -876,14 +873,11 @@ xfs_mountfs(
         */
        if ((mfsi_flags & XFS_MFSI_SECOND) == 0 &&
            (mp->m_flags & XFS_MOUNT_NOUUID) == 0) {
-               __uint64_t      ret64;
                if (xfs_uuid_mount(mp)) {
                        error = XFS_ERROR(EINVAL);
                        goto error1;
                }
                uuid_mounted=1;
-               ret64 = uuid_hash64(&sbp->sb_uuid);
-               memcpy(&vfsp->vfs_fsid, &ret64, sizeof(ret64));
        }
 
        /*
@@ -1008,16 +1002,6 @@ xfs_mountfs(
         */
        uuid_getnodeuniq(&sbp->sb_uuid, mp->m_fixedfsid);
 
-       /*
-        *  The vfs structure needs to have a file system independent
-        *  way of checking for the invariant file system ID.  Since it
-        *  can't look at mount structures it has a pointer to the data
-        *  in the mount structure.
-        *
-        *  File systems that don't support user level file handles (i.e.
-        *  all of them except for XFS) will leave vfs_altfsid as NULL.
-        */
-       vfsp->vfs_altfsid = (xfs_fsid_t *)mp->m_fixedfsid;
        mp->m_dmevmask = 0;     /* not persistent; set after each mount */
 
        xfs_dir_mount(mp);
@@ -1032,13 +1016,6 @@ xfs_mountfs(
         */
        xfs_trans_init(mp);
 
-       /*
-        * Allocate and initialize the inode hash table for this
-        * file system.
-        */
-       xfs_ihash_init(mp);
-       xfs_chash_init(mp);
-
        /*
         * Allocate and initialize the per-ag data.
         */
@@ -1046,7 +1023,7 @@ xfs_mountfs(
        mp->m_perag =
                kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP);
 
-       mp->m_maxagi = xfs_initialize_perag(vfsp, mp, sbp->sb_agcount);
+       mp->m_maxagi = xfs_initialize_perag(mp, sbp->sb_agcount);
 
        /*
         * log's mount-time initialization. Perform 1st part recovery if needed
@@ -1137,7 +1114,7 @@ xfs_mountfs(
         * If fs is not mounted readonly, then update the superblock
         * unit and width changes.
         */
-       if (update_flags && !(vfsp->vfs_flag & VFS_RDONLY))
+       if (update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY))
                xfs_mount_log_sbunit(mp, update_flags);
 
        /*
@@ -1190,8 +1167,6 @@ xfs_mountfs(
  error3:
        xfs_log_unmount_dealloc(mp);
  error2:
-       xfs_ihash_free(mp);
-       xfs_chash_free(mp);
        for (agno = 0; agno < sbp->sb_agcount; agno++)
                if (mp->m_perag[agno].pagb_list)
                        kmem_free(mp->m_perag[agno].pagb_list,
@@ -1215,10 +1190,6 @@ xfs_mountfs(
 int
 xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
 {
-       struct bhv_vfs  *vfsp = XFS_MTOVFS(mp);
-#if defined(DEBUG) || defined(INDUCE_IO_ERROR)
-       int64_t         fsid;
-#endif
        __uint64_t      resblks;
 
        /*
@@ -1282,14 +1253,10 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
                xfs_uuid_unmount(mp);
 
 #if defined(DEBUG) || defined(INDUCE_IO_ERROR)
-       /*
-        * clear all error tags on this filesystem
-        */
-       memcpy(&fsid, &vfsp->vfs_fsid, sizeof(int64_t));
-       xfs_errortag_clearall_umount(fsid, mp->m_fsname, 0);
+       xfs_errortag_clearall(mp, 0);
 #endif
-       XFS_IODONE(vfsp);
-       xfs_mount_free(mp, 1);
+       XFS_IODONE(mp);
+       xfs_mount_free(mp);
        return 0;
 }
 
@@ -1316,10 +1283,8 @@ xfs_unmountfs_wait(xfs_mount_t *mp)
 int
 xfs_fs_writable(xfs_mount_t *mp)
 {
-       bhv_vfs_t       *vfsp = XFS_MTOVFS(mp);
-
-       return !(vfs_test_for_freeze(vfsp) || XFS_FORCED_SHUTDOWN(mp) ||
-               (vfsp->vfs_flag & VFS_RDONLY));
+       return !(xfs_test_for_freeze(mp) || XFS_FORCED_SHUTDOWN(mp) ||
+               (mp->m_flags & XFS_MOUNT_RDONLY));
 }
 
 /*
@@ -1397,7 +1362,7 @@ xfs_unmountfs_writesb(xfs_mount_t *mp)
         * skip superblock write if fs is read-only, or
         * if we are doing a forced umount.
         */
-       if (!(XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY ||
+       if (!((mp->m_flags & XFS_MOUNT_RDONLY) ||
                XFS_FORCED_SHUTDOWN(mp))) {
 
                sbp = xfs_getsb(mp, 0);