diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-09-28 07:49:15 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-12-03 06:53:28 -0500 |
commit | 2ec4650526c5a94d96bb760001fe0685b15988de (patch) | |
tree | 0903ed60100f27968364b6cd9bff94141648ed00 /fs | |
parent | 86e931a35e93d94e6e91b57cc76456e16d188ea9 (diff) |
GFS2: Use dquot_send_warning()
This adds support to GFS2 to send quota warnings via netlink.
Also it removes a stray \r which was left over from when the
code used to print warnings on the console.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/quota.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index e8db5346a942..1d4fc0413a3f 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/gfs2_ondisk.h> | 47 | #include <linux/gfs2_ondisk.h> |
48 | #include <linux/kthread.h> | 48 | #include <linux/kthread.h> |
49 | #include <linux/freezer.h> | 49 | #include <linux/freezer.h> |
50 | #include <linux/quota.h> | ||
50 | #include <linux/dqblk_xfs.h> | 51 | #include <linux/dqblk_xfs.h> |
51 | 52 | ||
52 | #include "gfs2.h" | 53 | #include "gfs2.h" |
@@ -1001,7 +1002,7 @@ static int print_message(struct gfs2_quota_data *qd, char *type) | |||
1001 | { | 1002 | { |
1002 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 1003 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; |
1003 | 1004 | ||
1004 | printk(KERN_INFO "GFS2: fsid=%s: quota %s for %s %u\r\n", | 1005 | printk(KERN_INFO "GFS2: fsid=%s: quota %s for %s %u\n", |
1005 | sdp->sd_fsname, type, | 1006 | sdp->sd_fsname, type, |
1006 | (test_bit(QDF_USER, &qd->qd_flags)) ? "user" : "group", | 1007 | (test_bit(QDF_USER, &qd->qd_flags)) ? "user" : "group", |
1007 | qd->qd_id); | 1008 | qd->qd_id); |
@@ -1038,6 +1039,10 @@ int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid) | |||
1038 | 1039 | ||
1039 | if (be64_to_cpu(qd->qd_qb.qb_limit) && (s64)be64_to_cpu(qd->qd_qb.qb_limit) < value) { | 1040 | if (be64_to_cpu(qd->qd_qb.qb_limit) && (s64)be64_to_cpu(qd->qd_qb.qb_limit) < value) { |
1040 | print_message(qd, "exceeded"); | 1041 | print_message(qd, "exceeded"); |
1042 | quota_send_warning(test_bit(QDF_USER, &qd->qd_flags) ? | ||
1043 | USRQUOTA : GRPQUOTA, qd->qd_id, | ||
1044 | sdp->sd_vfs->s_dev, QUOTA_NL_BHARDWARN); | ||
1045 | |||
1041 | error = -EDQUOT; | 1046 | error = -EDQUOT; |
1042 | break; | 1047 | break; |
1043 | } else if (be64_to_cpu(qd->qd_qb.qb_warn) && | 1048 | } else if (be64_to_cpu(qd->qd_qb.qb_warn) && |
@@ -1045,6 +1050,9 @@ int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid) | |||
1045 | time_after_eq(jiffies, qd->qd_last_warn + | 1050 | time_after_eq(jiffies, qd->qd_last_warn + |
1046 | gfs2_tune_get(sdp, | 1051 | gfs2_tune_get(sdp, |
1047 | gt_quota_warn_period) * HZ)) { | 1052 | gt_quota_warn_period) * HZ)) { |
1053 | quota_send_warning(test_bit(QDF_USER, &qd->qd_flags) ? | ||
1054 | USRQUOTA : GRPQUOTA, qd->qd_id, | ||
1055 | sdp->sd_vfs->s_dev, QUOTA_NL_BSOFTWARN); | ||
1048 | error = print_message(qd, "warning"); | 1056 | error = print_message(qd, "warning"); |
1049 | qd->qd_last_warn = jiffies; | 1057 | qd->qd_last_warn = jiffies; |
1050 | } | 1058 | } |