]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/quota/xfs_qm.c
introduce I_SYNC
[linux-2.6-omap-h63xx.git] / fs / xfs / quota / xfs_qm.c
index 3e4a8ad8a34c3180eff417f732f11d5df320b722..6ff0f4de1630cb40665950393fb264e483636cc5 100644 (file)
@@ -62,10 +62,8 @@ uint         ndquot;
 
 kmem_zone_t    *qm_dqzone;
 kmem_zone_t    *qm_dqtrxzone;
-static kmem_shaker_t   xfs_qm_shaker;
 
 static cred_t  xfs_zerocr;
-static xfs_inode_t     xfs_zeroino;
 
 STATIC void    xfs_qm_list_init(xfs_dqlist_t *, char *, int);
 STATIC void    xfs_qm_list_destroy(xfs_dqlist_t *);
@@ -79,6 +77,11 @@ STATIC int   xfs_qm_init_quotainos(xfs_mount_t *);
 STATIC int     xfs_qm_init_quotainfo(xfs_mount_t *);
 STATIC int     xfs_qm_shake(int, gfp_t);
 
+static struct shrinker xfs_qm_shaker = {
+       .shrink = xfs_qm_shake,
+       .seeks = DEFAULT_SEEKS,
+};
+
 #ifdef DEBUG
 extern mutex_t qcheck_lock;
 #endif
@@ -117,7 +120,8 @@ xfs_Gqm_init(void)
         * Initialize the dquot hash tables.
         */
        udqhash = kmem_zalloc_greedy(&hsize,
-                                    XFS_QM_HASHSIZE_LOW, XFS_QM_HASHSIZE_HIGH,
+                                    XFS_QM_HASHSIZE_LOW * sizeof(xfs_dqhash_t),
+                                    XFS_QM_HASHSIZE_HIGH * sizeof(xfs_dqhash_t),
                                     KM_SLEEP | KM_MAYFAIL | KM_LARGE);
        gdqhash = kmem_zalloc(hsize, KM_SLEEP | KM_LARGE);
        hsize /= sizeof(xfs_dqhash_t);
@@ -150,7 +154,7 @@ xfs_Gqm_init(void)
        } else
                xqm->qm_dqzone = qm_dqzone;
 
-       xfs_qm_shaker = kmem_shake_register(xfs_qm_shake);
+       register_shrinker(&xfs_qm_shaker);
 
        /*
         * The t_dqinfo portion of transactions.
@@ -182,7 +186,7 @@ xfs_qm_destroy(
 
        ASSERT(xqm != NULL);
        ASSERT(xqm->qm_nrefs == 0);
-       kmem_shake_deregister(xfs_qm_shaker);
+       unregister_shrinker(&xfs_qm_shaker);
        hsize = xqm->qm_dqhashmask + 1;
        for (i = 0; i < hsize; i++) {
                xfs_qm_list_destroy(&(xqm->qm_usr_dqhtable[i]));
@@ -1415,7 +1419,7 @@ xfs_qm_qino_alloc(
                return error;
        }
 
-       if ((error = xfs_dir_ialloc(&tp, &xfs_zeroino, S_IFREG, 1, 0,
+       if ((error = xfs_dir_ialloc(&tp, NULL, S_IFREG, 1, 0,
                                   &xfs_zerocr, 0, 1, ip, &committed))) {
                xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES |
                                 XFS_TRANS_ABORT);