Merge master.kernel.org:/home/rmk/linux-2.6-arm
[powerpc.git] / fs / dquot.c
index 3995ce7..05f3327 100644 (file)
@@ -409,13 +409,10 @@ out_dqlock:
  * for this sb+type at all. */
 static void invalidate_dquots(struct super_block *sb, int type)
 {
-       struct dquot *dquot;
-       struct list_head *head;
+       struct dquot *dquot, *tmp;
 
        spin_lock(&dq_list_lock);
-       for (head = inuse_list.next; head != &inuse_list;) {
-               dquot = list_entry(head, struct dquot, dq_inuse);
-               head = head->next;
+       list_for_each_entry_safe(dquot, tmp, &inuse_list, dq_inuse) {
                if (dquot->dq_sb != sb)
                        continue;
                if (dquot->dq_type != type)
@@ -503,7 +500,7 @@ static void prune_dqcache(int count)
  * more memory
  */
 
-static int shrink_dqcache_memory(int nr, unsigned int gfp_mask)
+static int shrink_dqcache_memory(int nr, gfp_t gfp_mask)
 {
        if (nr) {
                spin_lock(&dq_list_lock);
@@ -1519,14 +1516,22 @@ out_path:
  * This function is used when filesystem needs to initialize quotas
  * during mount time.
  */
-int vfs_quota_on_mount(int type, int format_id, struct dentry *dentry)
+int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
+               int format_id, int type)
 {
+       struct dentry *dentry;
        int error;
 
+       dentry = lookup_one_len(qf_name, sb->s_root, strlen(qf_name));
+       if (IS_ERR(dentry))
+               return PTR_ERR(dentry);
+
        error = security_quota_on(dentry);
-       if (error)
-               return error;
-       return vfs_quota_on_inode(dentry->d_inode, type, format_id);
+       if (!error)
+               error = vfs_quota_on_inode(dentry->d_inode, type, format_id);
+
+       dput(dentry);
+       return error;
 }
 
 /* Generic routine for getting common part of quota structure */