diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-28 16:53:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-28 16:53:23 -0400 |
commit | 76d5b28bbad1c5502a24f94c2beafc468690b2ba (patch) | |
tree | aa98fcfd4ca8835216fa8de6064f7cced35082f0 | |
parent | 71e9dcc0019c8b1e7395d2d1512c08aa1c828710 (diff) | |
parent | e008bb6134a6e68fd2c827a46b27d017d920de8f (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull quota update from Jan Kara:
"time64 support for quota"
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
quota: use time64_t internally
-rw-r--r-- | fs/ocfs2/quota_global.c | 2 | ||||
-rw-r--r-- | fs/quota/dquot.c | 16 | ||||
-rw-r--r-- | include/linux/quota.h | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index ab6a6cdcf91c..87e577a49b0d 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c | |||
@@ -483,7 +483,7 @@ int __ocfs2_sync_dquot(struct dquot *dquot, int freeing) | |||
483 | struct ocfs2_mem_dqinfo *info = sb_dqinfo(sb, type)->dqi_priv; | 483 | struct ocfs2_mem_dqinfo *info = sb_dqinfo(sb, type)->dqi_priv; |
484 | struct ocfs2_global_disk_dqblk dqblk; | 484 | struct ocfs2_global_disk_dqblk dqblk; |
485 | s64 spacechange, inodechange; | 485 | s64 spacechange, inodechange; |
486 | time_t olditime, oldbtime; | 486 | time64_t olditime, oldbtime; |
487 | 487 | ||
488 | err = sb->s_op->quota_read(sb, type, (char *)&dqblk, | 488 | err = sb->s_op->quota_read(sb, type, (char *)&dqblk, |
489 | sizeof(struct ocfs2_global_disk_dqblk), | 489 | sizeof(struct ocfs2_global_disk_dqblk), |
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index ff21980d0119..b1322dd9d136 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -1133,7 +1133,7 @@ static void dquot_decr_inodes(struct dquot *dquot, qsize_t number) | |||
1133 | else | 1133 | else |
1134 | dquot->dq_dqb.dqb_curinodes = 0; | 1134 | dquot->dq_dqb.dqb_curinodes = 0; |
1135 | if (dquot->dq_dqb.dqb_curinodes <= dquot->dq_dqb.dqb_isoftlimit) | 1135 | if (dquot->dq_dqb.dqb_curinodes <= dquot->dq_dqb.dqb_isoftlimit) |
1136 | dquot->dq_dqb.dqb_itime = (time_t) 0; | 1136 | dquot->dq_dqb.dqb_itime = (time64_t) 0; |
1137 | clear_bit(DQ_INODES_B, &dquot->dq_flags); | 1137 | clear_bit(DQ_INODES_B, &dquot->dq_flags); |
1138 | } | 1138 | } |
1139 | 1139 | ||
@@ -1145,7 +1145,7 @@ static void dquot_decr_space(struct dquot *dquot, qsize_t number) | |||
1145 | else | 1145 | else |
1146 | dquot->dq_dqb.dqb_curspace = 0; | 1146 | dquot->dq_dqb.dqb_curspace = 0; |
1147 | if (dquot->dq_dqb.dqb_curspace <= dquot->dq_dqb.dqb_bsoftlimit) | 1147 | if (dquot->dq_dqb.dqb_curspace <= dquot->dq_dqb.dqb_bsoftlimit) |
1148 | dquot->dq_dqb.dqb_btime = (time_t) 0; | 1148 | dquot->dq_dqb.dqb_btime = (time64_t) 0; |
1149 | clear_bit(DQ_BLKS_B, &dquot->dq_flags); | 1149 | clear_bit(DQ_BLKS_B, &dquot->dq_flags); |
1150 | } | 1150 | } |
1151 | 1151 | ||
@@ -1292,7 +1292,7 @@ static int check_idq(struct dquot *dquot, qsize_t inodes, | |||
1292 | if (dquot->dq_dqb.dqb_isoftlimit && | 1292 | if (dquot->dq_dqb.dqb_isoftlimit && |
1293 | newinodes > dquot->dq_dqb.dqb_isoftlimit && | 1293 | newinodes > dquot->dq_dqb.dqb_isoftlimit && |
1294 | dquot->dq_dqb.dqb_itime && | 1294 | dquot->dq_dqb.dqb_itime && |
1295 | get_seconds() >= dquot->dq_dqb.dqb_itime && | 1295 | ktime_get_real_seconds() >= dquot->dq_dqb.dqb_itime && |
1296 | !ignore_hardlimit(dquot)) { | 1296 | !ignore_hardlimit(dquot)) { |
1297 | prepare_warning(warn, dquot, QUOTA_NL_ISOFTLONGWARN); | 1297 | prepare_warning(warn, dquot, QUOTA_NL_ISOFTLONGWARN); |
1298 | return -EDQUOT; | 1298 | return -EDQUOT; |
@@ -1302,7 +1302,7 @@ static int check_idq(struct dquot *dquot, qsize_t inodes, | |||
1302 | newinodes > dquot->dq_dqb.dqb_isoftlimit && | 1302 | newinodes > dquot->dq_dqb.dqb_isoftlimit && |
1303 | dquot->dq_dqb.dqb_itime == 0) { | 1303 | dquot->dq_dqb.dqb_itime == 0) { |
1304 | prepare_warning(warn, dquot, QUOTA_NL_ISOFTWARN); | 1304 | prepare_warning(warn, dquot, QUOTA_NL_ISOFTWARN); |
1305 | dquot->dq_dqb.dqb_itime = get_seconds() + | 1305 | dquot->dq_dqb.dqb_itime = ktime_get_real_seconds() + |
1306 | sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type].dqi_igrace; | 1306 | sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type].dqi_igrace; |
1307 | } | 1307 | } |
1308 | 1308 | ||
@@ -1334,7 +1334,7 @@ static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, | |||
1334 | if (dquot->dq_dqb.dqb_bsoftlimit && | 1334 | if (dquot->dq_dqb.dqb_bsoftlimit && |
1335 | tspace > dquot->dq_dqb.dqb_bsoftlimit && | 1335 | tspace > dquot->dq_dqb.dqb_bsoftlimit && |
1336 | dquot->dq_dqb.dqb_btime && | 1336 | dquot->dq_dqb.dqb_btime && |
1337 | get_seconds() >= dquot->dq_dqb.dqb_btime && | 1337 | ktime_get_real_seconds() >= dquot->dq_dqb.dqb_btime && |
1338 | !ignore_hardlimit(dquot)) { | 1338 | !ignore_hardlimit(dquot)) { |
1339 | if (!prealloc) | 1339 | if (!prealloc) |
1340 | prepare_warning(warn, dquot, QUOTA_NL_BSOFTLONGWARN); | 1340 | prepare_warning(warn, dquot, QUOTA_NL_BSOFTLONGWARN); |
@@ -1346,7 +1346,7 @@ static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, | |||
1346 | dquot->dq_dqb.dqb_btime == 0) { | 1346 | dquot->dq_dqb.dqb_btime == 0) { |
1347 | if (!prealloc) { | 1347 | if (!prealloc) { |
1348 | prepare_warning(warn, dquot, QUOTA_NL_BSOFTWARN); | 1348 | prepare_warning(warn, dquot, QUOTA_NL_BSOFTWARN); |
1349 | dquot->dq_dqb.dqb_btime = get_seconds() + | 1349 | dquot->dq_dqb.dqb_btime = ktime_get_real_seconds() + |
1350 | sb_dqopt(sb)->info[dquot->dq_id.type].dqi_bgrace; | 1350 | sb_dqopt(sb)->info[dquot->dq_id.type].dqi_bgrace; |
1351 | } | 1351 | } |
1352 | else | 1352 | else |
@@ -2695,7 +2695,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) | |||
2695 | clear_bit(DQ_BLKS_B, &dquot->dq_flags); | 2695 | clear_bit(DQ_BLKS_B, &dquot->dq_flags); |
2696 | } else if (!(di->d_fieldmask & QC_SPC_TIMER)) | 2696 | } else if (!(di->d_fieldmask & QC_SPC_TIMER)) |
2697 | /* Set grace only if user hasn't provided his own... */ | 2697 | /* Set grace only if user hasn't provided his own... */ |
2698 | dm->dqb_btime = get_seconds() + dqi->dqi_bgrace; | 2698 | dm->dqb_btime = ktime_get_real_seconds() + dqi->dqi_bgrace; |
2699 | } | 2699 | } |
2700 | if (check_ilim) { | 2700 | if (check_ilim) { |
2701 | if (!dm->dqb_isoftlimit || | 2701 | if (!dm->dqb_isoftlimit || |
@@ -2704,7 +2704,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) | |||
2704 | clear_bit(DQ_INODES_B, &dquot->dq_flags); | 2704 | clear_bit(DQ_INODES_B, &dquot->dq_flags); |
2705 | } else if (!(di->d_fieldmask & QC_INO_TIMER)) | 2705 | } else if (!(di->d_fieldmask & QC_INO_TIMER)) |
2706 | /* Set grace only if user hasn't provided his own... */ | 2706 | /* Set grace only if user hasn't provided his own... */ |
2707 | dm->dqb_itime = get_seconds() + dqi->dqi_igrace; | 2707 | dm->dqb_itime = ktime_get_real_seconds() + dqi->dqi_igrace; |
2708 | } | 2708 | } |
2709 | if (dm->dqb_bhardlimit || dm->dqb_bsoftlimit || dm->dqb_ihardlimit || | 2709 | if (dm->dqb_bhardlimit || dm->dqb_bsoftlimit || dm->dqb_ihardlimit || |
2710 | dm->dqb_isoftlimit) | 2710 | dm->dqb_isoftlimit) |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 9dfb6bce8c9e..8486d27cf360 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -200,8 +200,8 @@ struct mem_dqblk { | |||
200 | qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */ | 200 | qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */ |
201 | qsize_t dqb_isoftlimit; /* preferred inode limit */ | 201 | qsize_t dqb_isoftlimit; /* preferred inode limit */ |
202 | qsize_t dqb_curinodes; /* current # allocated inodes */ | 202 | qsize_t dqb_curinodes; /* current # allocated inodes */ |
203 | time_t dqb_btime; /* time limit for excessive disk use */ | 203 | time64_t dqb_btime; /* time limit for excessive disk use */ |
204 | time_t dqb_itime; /* time limit for excessive inode use */ | 204 | time64_t dqb_itime; /* time limit for excessive inode use */ |
205 | }; | 205 | }; |
206 | 206 | ||
207 | /* | 207 | /* |