]> err.no Git - linux-2.6/blobdiff - fs/dquot.c
[PATCH] ext3: fix reservation extension
[linux-2.6] / fs / dquot.c
index 0122a279106a9dd4a0475557901471be5c428546..f9cd5e23ebdf2aaa9e91ca71e3cda95dbe60560a 100644 (file)
@@ -131,7 +131,7 @@ static struct quota_format_type *quota_formats;     /* List of registered formats */
 static struct quota_module_name module_names[] = INIT_QUOTA_MODULE_NAMES;
 
 /* SLAB cache for dquot structures */
-static kmem_cache_t *dquot_cachep;
+static struct kmem_cache *dquot_cachep;
 
 int register_quota_format(struct quota_format_type *fmt)
 {
@@ -600,7 +600,7 @@ static struct dquot *get_empty_dquot(struct super_block *sb, int type)
 {
        struct dquot *dquot;
 
-       dquot = kmem_cache_alloc(dquot_cachep, SLAB_NOFS);
+       dquot = kmem_cache_alloc(dquot_cachep, GFP_NOFS);
        if(!dquot)
                return NODQUOT;
 
@@ -834,6 +834,9 @@ static void print_warning(struct dquot *dquot, const char warntype)
        if (!need_print_warning(dquot) || (flag && test_and_set_bit(flag, &dquot->dq_flags)))
                return;
 
+       mutex_lock(&tty_mutex);
+       if (!current->signal->tty)
+               goto out_lock;
        tty_write_message(current->signal->tty, dquot->dq_sb->s_id);
        if (warntype == ISOFTWARN || warntype == BSOFTWARN)
                tty_write_message(current->signal->tty, ": warning, ");
@@ -861,6 +864,8 @@ static void print_warning(struct dquot *dquot, const char warntype)
                        break;
        }
        tty_write_message(current->signal->tty, msg);
+out_lock:
+       mutex_unlock(&tty_mutex);
 }
 
 static inline void flush_warnings(struct dquot **dquots, char *warntype)