Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull quota and UDF fix from Jan Kara:
"A fix for UDF to properly free preallocated blocks and a fix for quota
so that Q_GETQUOTA quotactl reports correct numbers for XFS filesystem
(and similarly Q_XGETQUOTA quotactl works properly for other
filesystems)"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units
udf: Release preallocation on last writeable close

+319 -196
+23 -26
fs/gfs2/quota.c
··· 667 667 668 668 static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, 669 669 s64 change, struct gfs2_quota_data *qd, 670 - struct fs_disk_quota *fdq) 670 + struct qc_dqblk *fdq) 671 671 { 672 672 struct inode *inode = &ip->i_inode; 673 673 struct gfs2_sbd *sdp = GFS2_SB(inode); ··· 697 697 be64_add_cpu(&q.qu_value, change); 698 698 qd->qd_qb.qb_value = q.qu_value; 699 699 if (fdq) { 700 - if (fdq->d_fieldmask & FS_DQ_BSOFT) { 701 - q.qu_warn = cpu_to_be64(fdq->d_blk_softlimit >> sdp->sd_fsb2bb_shift); 700 + if (fdq->d_fieldmask & QC_SPC_SOFT) { 701 + q.qu_warn = cpu_to_be64(fdq->d_spc_softlimit >> sdp->sd_sb.sb_bsize_shift); 702 702 qd->qd_qb.qb_warn = q.qu_warn; 703 703 } 704 - if (fdq->d_fieldmask & FS_DQ_BHARD) { 705 - q.qu_limit = cpu_to_be64(fdq->d_blk_hardlimit >> sdp->sd_fsb2bb_shift); 704 + if (fdq->d_fieldmask & QC_SPC_HARD) { 705 + q.qu_limit = cpu_to_be64(fdq->d_spc_hardlimit >> sdp->sd_sb.sb_bsize_shift); 706 706 qd->qd_qb.qb_limit = q.qu_limit; 707 707 } 708 - if (fdq->d_fieldmask & FS_DQ_BCOUNT) { 709 - q.qu_value = cpu_to_be64(fdq->d_bcount >> sdp->sd_fsb2bb_shift); 708 + if (fdq->d_fieldmask & QC_SPACE) { 709 + q.qu_value = cpu_to_be64(fdq->d_space >> sdp->sd_sb.sb_bsize_shift); 710 710 qd->qd_qb.qb_value = q.qu_value; 711 711 } 712 712 } ··· 1497 1497 } 1498 1498 1499 1499 static int gfs2_get_dqblk(struct super_block *sb, struct kqid qid, 1500 - struct fs_disk_quota *fdq) 1500 + struct qc_dqblk *fdq) 1501 1501 { 1502 1502 struct gfs2_sbd *sdp = sb->s_fs_info; 1503 1503 struct gfs2_quota_lvb *qlvb; ··· 1505 1505 struct gfs2_holder q_gh; 1506 1506 int error; 1507 1507 1508 - memset(fdq, 0, sizeof(struct fs_disk_quota)); 1508 + memset(fdq, 0, sizeof(*fdq)); 1509 1509 1510 1510 if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) 1511 1511 return -ESRCH; /* Crazy XFS error code */ ··· 1522 1522 goto out; 1523 1523 1524 1524 qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lksb.sb_lvbptr; 1525 - fdq->d_version = FS_DQUOT_VERSION; 1526 - fdq->d_flags = (qid.type == USRQUOTA) ? FS_USER_QUOTA : FS_GROUP_QUOTA; 1527 - fdq->d_id = from_kqid_munged(current_user_ns(), qid); 1528 - fdq->d_blk_hardlimit = be64_to_cpu(qlvb->qb_limit) << sdp->sd_fsb2bb_shift; 1529 - fdq->d_blk_softlimit = be64_to_cpu(qlvb->qb_warn) << sdp->sd_fsb2bb_shift; 1530 - fdq->d_bcount = be64_to_cpu(qlvb->qb_value) << sdp->sd_fsb2bb_shift; 1525 + fdq->d_spc_hardlimit = be64_to_cpu(qlvb->qb_limit) << sdp->sd_sb.sb_bsize_shift; 1526 + fdq->d_spc_softlimit = be64_to_cpu(qlvb->qb_warn) << sdp->sd_sb.sb_bsize_shift; 1527 + fdq->d_space = be64_to_cpu(qlvb->qb_value) << sdp->sd_sb.sb_bsize_shift; 1531 1528 1532 1529 gfs2_glock_dq_uninit(&q_gh); 1533 1530 out: ··· 1533 1536 } 1534 1537 1535 1538 /* GFS2 only supports a subset of the XFS fields */ 1536 - #define GFS2_FIELDMASK (FS_DQ_BSOFT|FS_DQ_BHARD|FS_DQ_BCOUNT) 1539 + #define GFS2_FIELDMASK (QC_SPC_SOFT|QC_SPC_HARD|QC_SPACE) 1537 1540 1538 1541 static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid, 1539 - struct fs_disk_quota *fdq) 1542 + struct qc_dqblk *fdq) 1540 1543 { 1541 1544 struct gfs2_sbd *sdp = sb->s_fs_info; 1542 1545 struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); ··· 1580 1583 goto out_i; 1581 1584 1582 1585 /* If nothing has changed, this is a no-op */ 1583 - if ((fdq->d_fieldmask & FS_DQ_BSOFT) && 1584 - ((fdq->d_blk_softlimit >> sdp->sd_fsb2bb_shift) == be64_to_cpu(qd->qd_qb.qb_warn))) 1585 - fdq->d_fieldmask ^= FS_DQ_BSOFT; 1586 + if ((fdq->d_fieldmask & QC_SPC_SOFT) && 1587 + ((fdq->d_spc_softlimit >> sdp->sd_sb.sb_bsize_shift) == be64_to_cpu(qd->qd_qb.qb_warn))) 1588 + fdq->d_fieldmask ^= QC_SPC_SOFT; 1586 1589 1587 - if ((fdq->d_fieldmask & FS_DQ_BHARD) && 1588 - ((fdq->d_blk_hardlimit >> sdp->sd_fsb2bb_shift) == be64_to_cpu(qd->qd_qb.qb_limit))) 1589 - fdq->d_fieldmask ^= FS_DQ_BHARD; 1590 + if ((fdq->d_fieldmask & QC_SPC_HARD) && 1591 + ((fdq->d_spc_hardlimit >> sdp->sd_sb.sb_bsize_shift) == be64_to_cpu(qd->qd_qb.qb_limit))) 1592 + fdq->d_fieldmask ^= QC_SPC_HARD; 1590 1593 1591 - if ((fdq->d_fieldmask & FS_DQ_BCOUNT) && 1592 - ((fdq->d_bcount >> sdp->sd_fsb2bb_shift) == be64_to_cpu(qd->qd_qb.qb_value))) 1593 - fdq->d_fieldmask ^= FS_DQ_BCOUNT; 1594 + if ((fdq->d_fieldmask & QC_SPACE) && 1595 + ((fdq->d_space >> sdp->sd_sb.sb_bsize_shift) == be64_to_cpu(qd->qd_qb.qb_value))) 1596 + fdq->d_fieldmask ^= QC_SPACE; 1594 1597 1595 1598 if (fdq->d_fieldmask == 0) 1596 1599 goto out_i;
+39 -44
fs/quota/dquot.c
··· 2396 2396 } 2397 2397 2398 2398 /* Generic routine for getting common part of quota structure */ 2399 - static void do_get_dqblk(struct dquot *dquot, struct fs_disk_quota *di) 2399 + static void do_get_dqblk(struct dquot *dquot, struct qc_dqblk *di) 2400 2400 { 2401 2401 struct mem_dqblk *dm = &dquot->dq_dqb; 2402 2402 2403 2403 memset(di, 0, sizeof(*di)); 2404 - di->d_version = FS_DQUOT_VERSION; 2405 - di->d_flags = dquot->dq_id.type == USRQUOTA ? 2406 - FS_USER_QUOTA : FS_GROUP_QUOTA; 2407 - di->d_id = from_kqid_munged(current_user_ns(), dquot->dq_id); 2408 - 2409 2404 spin_lock(&dq_data_lock); 2410 - di->d_blk_hardlimit = stoqb(dm->dqb_bhardlimit); 2411 - di->d_blk_softlimit = stoqb(dm->dqb_bsoftlimit); 2405 + di->d_spc_hardlimit = dm->dqb_bhardlimit; 2406 + di->d_spc_softlimit = dm->dqb_bsoftlimit; 2412 2407 di->d_ino_hardlimit = dm->dqb_ihardlimit; 2413 2408 di->d_ino_softlimit = dm->dqb_isoftlimit; 2414 - di->d_bcount = dm->dqb_curspace + dm->dqb_rsvspace; 2415 - di->d_icount = dm->dqb_curinodes; 2416 - di->d_btimer = dm->dqb_btime; 2417 - di->d_itimer = dm->dqb_itime; 2409 + di->d_space = dm->dqb_curspace + dm->dqb_rsvspace; 2410 + di->d_ino_count = dm->dqb_curinodes; 2411 + di->d_spc_timer = dm->dqb_btime; 2412 + di->d_ino_timer = dm->dqb_itime; 2418 2413 spin_unlock(&dq_data_lock); 2419 2414 } 2420 2415 2421 2416 int dquot_get_dqblk(struct super_block *sb, struct kqid qid, 2422 - struct fs_disk_quota *di) 2417 + struct qc_dqblk *di) 2423 2418 { 2424 2419 struct dquot *dquot; 2425 2420 ··· 2428 2433 } 2429 2434 EXPORT_SYMBOL(dquot_get_dqblk); 2430 2435 2431 - #define VFS_FS_DQ_MASK \ 2432 - (FS_DQ_BCOUNT | FS_DQ_BSOFT | FS_DQ_BHARD | \ 2433 - FS_DQ_ICOUNT | FS_DQ_ISOFT | FS_DQ_IHARD | \ 2434 - FS_DQ_BTIMER | FS_DQ_ITIMER) 2436 + #define VFS_QC_MASK \ 2437 + (QC_SPACE | QC_SPC_SOFT | QC_SPC_HARD | \ 2438 + QC_INO_COUNT | QC_INO_SOFT | QC_INO_HARD | \ 2439 + QC_SPC_TIMER | QC_INO_TIMER) 2435 2440 2436 2441 /* Generic routine for setting common part of quota structure */ 2437 - static int do_set_dqblk(struct dquot *dquot, struct fs_disk_quota *di) 2442 + static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) 2438 2443 { 2439 2444 struct mem_dqblk *dm = &dquot->dq_dqb; 2440 2445 int check_blim = 0, check_ilim = 0; 2441 2446 struct mem_dqinfo *dqi = &sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type]; 2442 2447 2443 - if (di->d_fieldmask & ~VFS_FS_DQ_MASK) 2448 + if (di->d_fieldmask & ~VFS_QC_MASK) 2444 2449 return -EINVAL; 2445 2450 2446 - if (((di->d_fieldmask & FS_DQ_BSOFT) && 2447 - (di->d_blk_softlimit > dqi->dqi_maxblimit)) || 2448 - ((di->d_fieldmask & FS_DQ_BHARD) && 2449 - (di->d_blk_hardlimit > dqi->dqi_maxblimit)) || 2450 - ((di->d_fieldmask & FS_DQ_ISOFT) && 2451 + if (((di->d_fieldmask & QC_SPC_SOFT) && 2452 + stoqb(di->d_spc_softlimit) > dqi->dqi_maxblimit) || 2453 + ((di->d_fieldmask & QC_SPC_HARD) && 2454 + stoqb(di->d_spc_hardlimit) > dqi->dqi_maxblimit) || 2455 + ((di->d_fieldmask & QC_INO_SOFT) && 2451 2456 (di->d_ino_softlimit > dqi->dqi_maxilimit)) || 2452 - ((di->d_fieldmask & FS_DQ_IHARD) && 2457 + ((di->d_fieldmask & QC_INO_HARD) && 2453 2458 (di->d_ino_hardlimit > dqi->dqi_maxilimit))) 2454 2459 return -ERANGE; 2455 2460 2456 2461 spin_lock(&dq_data_lock); 2457 - if (di->d_fieldmask & FS_DQ_BCOUNT) { 2458 - dm->dqb_curspace = di->d_bcount - dm->dqb_rsvspace; 2462 + if (di->d_fieldmask & QC_SPACE) { 2463 + dm->dqb_curspace = di->d_space - dm->dqb_rsvspace; 2459 2464 check_blim = 1; 2460 2465 set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); 2461 2466 } 2462 2467 2463 - if (di->d_fieldmask & FS_DQ_BSOFT) 2464 - dm->dqb_bsoftlimit = qbtos(di->d_blk_softlimit); 2465 - if (di->d_fieldmask & FS_DQ_BHARD) 2466 - dm->dqb_bhardlimit = qbtos(di->d_blk_hardlimit); 2467 - if (di->d_fieldmask & (FS_DQ_BSOFT | FS_DQ_BHARD)) { 2468 + if (di->d_fieldmask & QC_SPC_SOFT) 2469 + dm->dqb_bsoftlimit = di->d_spc_softlimit; 2470 + if (di->d_fieldmask & QC_SPC_HARD) 2471 + dm->dqb_bhardlimit = di->d_spc_hardlimit; 2472 + if (di->d_fieldmask & (QC_SPC_SOFT | QC_SPC_HARD)) { 2468 2473 check_blim = 1; 2469 2474 set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); 2470 2475 } 2471 2476 2472 - if (di->d_fieldmask & FS_DQ_ICOUNT) { 2473 - dm->dqb_curinodes = di->d_icount; 2477 + if (di->d_fieldmask & QC_INO_COUNT) { 2478 + dm->dqb_curinodes = di->d_ino_count; 2474 2479 check_ilim = 1; 2475 2480 set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); 2476 2481 } 2477 2482 2478 - if (di->d_fieldmask & FS_DQ_ISOFT) 2483 + if (di->d_fieldmask & QC_INO_SOFT) 2479 2484 dm->dqb_isoftlimit = di->d_ino_softlimit; 2480 - if (di->d_fieldmask & FS_DQ_IHARD) 2485 + if (di->d_fieldmask & QC_INO_HARD) 2481 2486 dm->dqb_ihardlimit = di->d_ino_hardlimit; 2482 - if (di->d_fieldmask & (FS_DQ_ISOFT | FS_DQ_IHARD)) { 2487 + if (di->d_fieldmask & (QC_INO_SOFT | QC_INO_HARD)) { 2483 2488 check_ilim = 1; 2484 2489 set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); 2485 2490 } 2486 2491 2487 - if (di->d_fieldmask & FS_DQ_BTIMER) { 2488 - dm->dqb_btime = di->d_btimer; 2492 + if (di->d_fieldmask & QC_SPC_TIMER) { 2493 + dm->dqb_btime = di->d_spc_timer; 2489 2494 check_blim = 1; 2490 2495 set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); 2491 2496 } 2492 2497 2493 - if (di->d_fieldmask & FS_DQ_ITIMER) { 2494 - dm->dqb_itime = di->d_itimer; 2498 + if (di->d_fieldmask & QC_INO_TIMER) { 2499 + dm->dqb_itime = di->d_ino_timer; 2495 2500 check_ilim = 1; 2496 2501 set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); 2497 2502 } ··· 2501 2506 dm->dqb_curspace < dm->dqb_bsoftlimit) { 2502 2507 dm->dqb_btime = 0; 2503 2508 clear_bit(DQ_BLKS_B, &dquot->dq_flags); 2504 - } else if (!(di->d_fieldmask & FS_DQ_BTIMER)) 2509 + } else if (!(di->d_fieldmask & QC_SPC_TIMER)) 2505 2510 /* Set grace only if user hasn't provided his own... */ 2506 2511 dm->dqb_btime = get_seconds() + dqi->dqi_bgrace; 2507 2512 } ··· 2510 2515 dm->dqb_curinodes < dm->dqb_isoftlimit) { 2511 2516 dm->dqb_itime = 0; 2512 2517 clear_bit(DQ_INODES_B, &dquot->dq_flags); 2513 - } else if (!(di->d_fieldmask & FS_DQ_ITIMER)) 2518 + } else if (!(di->d_fieldmask & QC_INO_TIMER)) 2514 2519 /* Set grace only if user hasn't provided his own... */ 2515 2520 dm->dqb_itime = get_seconds() + dqi->dqi_igrace; 2516 2521 } ··· 2526 2531 } 2527 2532 2528 2533 int dquot_set_dqblk(struct super_block *sb, struct kqid qid, 2529 - struct fs_disk_quota *di) 2534 + struct qc_dqblk *di) 2530 2535 { 2531 2536 struct dquot *dquot; 2532 2537 int rc;
+137 -25
fs/quota/quota.c
··· 118 118 return sb->s_qcop->set_info(sb, type, &info); 119 119 } 120 120 121 - static void copy_to_if_dqblk(struct if_dqblk *dst, struct fs_disk_quota *src) 121 + static inline qsize_t qbtos(qsize_t blocks) 122 + { 123 + return blocks << QIF_DQBLKSIZE_BITS; 124 + } 125 + 126 + static inline qsize_t stoqb(qsize_t space) 127 + { 128 + return (space + QIF_DQBLKSIZE - 1) >> QIF_DQBLKSIZE_BITS; 129 + } 130 + 131 + static void copy_to_if_dqblk(struct if_dqblk *dst, struct qc_dqblk *src) 122 132 { 123 133 memset(dst, 0, sizeof(*dst)); 124 - dst->dqb_bhardlimit = src->d_blk_hardlimit; 125 - dst->dqb_bsoftlimit = src->d_blk_softlimit; 126 - dst->dqb_curspace = src->d_bcount; 134 + dst->dqb_bhardlimit = stoqb(src->d_spc_hardlimit); 135 + dst->dqb_bsoftlimit = stoqb(src->d_spc_softlimit); 136 + dst->dqb_curspace = src->d_space; 127 137 dst->dqb_ihardlimit = src->d_ino_hardlimit; 128 138 dst->dqb_isoftlimit = src->d_ino_softlimit; 129 - dst->dqb_curinodes = src->d_icount; 130 - dst->dqb_btime = src->d_btimer; 131 - dst->dqb_itime = src->d_itimer; 139 + dst->dqb_curinodes = src->d_ino_count; 140 + dst->dqb_btime = src->d_spc_timer; 141 + dst->dqb_itime = src->d_ino_timer; 132 142 dst->dqb_valid = QIF_ALL; 133 143 } 134 144 ··· 146 136 void __user *addr) 147 137 { 148 138 struct kqid qid; 149 - struct fs_disk_quota fdq; 139 + struct qc_dqblk fdq; 150 140 struct if_dqblk idq; 151 141 int ret; 152 142 ··· 164 154 return 0; 165 155 } 166 156 167 - static void copy_from_if_dqblk(struct fs_disk_quota *dst, struct if_dqblk *src) 157 + static void copy_from_if_dqblk(struct qc_dqblk *dst, struct if_dqblk *src) 168 158 { 169 - dst->d_blk_hardlimit = src->dqb_bhardlimit; 170 - dst->d_blk_softlimit = src->dqb_bsoftlimit; 171 - dst->d_bcount = src->dqb_curspace; 159 + dst->d_spc_hardlimit = qbtos(src->dqb_bhardlimit); 160 + dst->d_spc_softlimit = qbtos(src->dqb_bsoftlimit); 161 + dst->d_space = src->dqb_curspace; 172 162 dst->d_ino_hardlimit = src->dqb_ihardlimit; 173 163 dst->d_ino_softlimit = src->dqb_isoftlimit; 174 - dst->d_icount = src->dqb_curinodes; 175 - dst->d_btimer = src->dqb_btime; 176 - dst->d_itimer = src->dqb_itime; 164 + dst->d_ino_count = src->dqb_curinodes; 165 + dst->d_spc_timer = src->dqb_btime; 166 + dst->d_ino_timer = src->dqb_itime; 177 167 178 168 dst->d_fieldmask = 0; 179 169 if (src->dqb_valid & QIF_BLIMITS) 180 - dst->d_fieldmask |= FS_DQ_BSOFT | FS_DQ_BHARD; 170 + dst->d_fieldmask |= QC_SPC_SOFT | QC_SPC_HARD; 181 171 if (src->dqb_valid & QIF_SPACE) 182 - dst->d_fieldmask |= FS_DQ_BCOUNT; 172 + dst->d_fieldmask |= QC_SPACE; 183 173 if (src->dqb_valid & QIF_ILIMITS) 184 - dst->d_fieldmask |= FS_DQ_ISOFT | FS_DQ_IHARD; 174 + dst->d_fieldmask |= QC_INO_SOFT | QC_INO_HARD; 185 175 if (src->dqb_valid & QIF_INODES) 186 - dst->d_fieldmask |= FS_DQ_ICOUNT; 176 + dst->d_fieldmask |= QC_INO_COUNT; 187 177 if (src->dqb_valid & QIF_BTIME) 188 - dst->d_fieldmask |= FS_DQ_BTIMER; 178 + dst->d_fieldmask |= QC_SPC_TIMER; 189 179 if (src->dqb_valid & QIF_ITIME) 190 - dst->d_fieldmask |= FS_DQ_ITIMER; 180 + dst->d_fieldmask |= QC_INO_TIMER; 191 181 } 192 182 193 183 static int quota_setquota(struct super_block *sb, int type, qid_t id, 194 184 void __user *addr) 195 185 { 196 - struct fs_disk_quota fdq; 186 + struct qc_dqblk fdq; 197 187 struct if_dqblk idq; 198 188 struct kqid qid; 199 189 ··· 257 247 return ret; 258 248 } 259 249 250 + /* 251 + * XFS defines BBTOB and BTOBB macros inside fs/xfs/ and we cannot move them 252 + * out of there as xfsprogs rely on definitions being in that header file. So 253 + * just define same functions here for quota purposes. 254 + */ 255 + #define XFS_BB_SHIFT 9 256 + 257 + static inline u64 quota_bbtob(u64 blocks) 258 + { 259 + return blocks << XFS_BB_SHIFT; 260 + } 261 + 262 + static inline u64 quota_btobb(u64 bytes) 263 + { 264 + return (bytes + (1 << XFS_BB_SHIFT) - 1) >> XFS_BB_SHIFT; 265 + } 266 + 267 + static void copy_from_xfs_dqblk(struct qc_dqblk *dst, struct fs_disk_quota *src) 268 + { 269 + dst->d_spc_hardlimit = quota_bbtob(src->d_blk_hardlimit); 270 + dst->d_spc_softlimit = quota_bbtob(src->d_blk_softlimit); 271 + dst->d_ino_hardlimit = src->d_ino_hardlimit; 272 + dst->d_ino_softlimit = src->d_ino_softlimit; 273 + dst->d_space = quota_bbtob(src->d_bcount); 274 + dst->d_ino_count = src->d_icount; 275 + dst->d_ino_timer = src->d_itimer; 276 + dst->d_spc_timer = src->d_btimer; 277 + dst->d_ino_warns = src->d_iwarns; 278 + dst->d_spc_warns = src->d_bwarns; 279 + dst->d_rt_spc_hardlimit = quota_bbtob(src->d_rtb_hardlimit); 280 + dst->d_rt_spc_softlimit = quota_bbtob(src->d_rtb_softlimit); 281 + dst->d_rt_space = quota_bbtob(src->d_rtbcount); 282 + dst->d_rt_spc_timer = src->d_rtbtimer; 283 + dst->d_rt_spc_warns = src->d_rtbwarns; 284 + dst->d_fieldmask = 0; 285 + if (src->d_fieldmask & FS_DQ_ISOFT) 286 + dst->d_fieldmask |= QC_INO_SOFT; 287 + if (src->d_fieldmask & FS_DQ_IHARD) 288 + dst->d_fieldmask |= QC_INO_HARD; 289 + if (src->d_fieldmask & FS_DQ_BSOFT) 290 + dst->d_fieldmask |= QC_SPC_SOFT; 291 + if (src->d_fieldmask & FS_DQ_BHARD) 292 + dst->d_fieldmask |= QC_SPC_HARD; 293 + if (src->d_fieldmask & FS_DQ_RTBSOFT) 294 + dst->d_fieldmask |= QC_RT_SPC_SOFT; 295 + if (src->d_fieldmask & FS_DQ_RTBHARD) 296 + dst->d_fieldmask |= QC_RT_SPC_HARD; 297 + if (src->d_fieldmask & FS_DQ_BTIMER) 298 + dst->d_fieldmask |= QC_SPC_TIMER; 299 + if (src->d_fieldmask & FS_DQ_ITIMER) 300 + dst->d_fieldmask |= QC_INO_TIMER; 301 + if (src->d_fieldmask & FS_DQ_RTBTIMER) 302 + dst->d_fieldmask |= QC_RT_SPC_TIMER; 303 + if (src->d_fieldmask & FS_DQ_BWARNS) 304 + dst->d_fieldmask |= QC_SPC_WARNS; 305 + if (src->d_fieldmask & FS_DQ_IWARNS) 306 + dst->d_fieldmask |= QC_INO_WARNS; 307 + if (src->d_fieldmask & FS_DQ_RTBWARNS) 308 + dst->d_fieldmask |= QC_RT_SPC_WARNS; 309 + if (src->d_fieldmask & FS_DQ_BCOUNT) 310 + dst->d_fieldmask |= QC_SPACE; 311 + if (src->d_fieldmask & FS_DQ_ICOUNT) 312 + dst->d_fieldmask |= QC_INO_COUNT; 313 + if (src->d_fieldmask & FS_DQ_RTBCOUNT) 314 + dst->d_fieldmask |= QC_RT_SPACE; 315 + } 316 + 260 317 static int quota_setxquota(struct super_block *sb, int type, qid_t id, 261 318 void __user *addr) 262 319 { 263 320 struct fs_disk_quota fdq; 321 + struct qc_dqblk qdq; 264 322 struct kqid qid; 265 323 266 324 if (copy_from_user(&fdq, addr, sizeof(fdq))) ··· 338 260 qid = make_kqid(current_user_ns(), type, id); 339 261 if (!qid_valid(qid)) 340 262 return -EINVAL; 341 - return sb->s_qcop->set_dqblk(sb, qid, &fdq); 263 + copy_from_xfs_dqblk(&qdq, &fdq); 264 + return sb->s_qcop->set_dqblk(sb, qid, &qdq); 265 + } 266 + 267 + static void copy_to_xfs_dqblk(struct fs_disk_quota *dst, struct qc_dqblk *src, 268 + int type, qid_t id) 269 + { 270 + memset(dst, 0, sizeof(*dst)); 271 + dst->d_version = FS_DQUOT_VERSION; 272 + dst->d_id = id; 273 + if (type == USRQUOTA) 274 + dst->d_flags = FS_USER_QUOTA; 275 + else if (type == PRJQUOTA) 276 + dst->d_flags = FS_PROJ_QUOTA; 277 + else 278 + dst->d_flags = FS_GROUP_QUOTA; 279 + dst->d_blk_hardlimit = quota_btobb(src->d_spc_hardlimit); 280 + dst->d_blk_softlimit = quota_btobb(src->d_spc_softlimit); 281 + dst->d_ino_hardlimit = src->d_ino_hardlimit; 282 + dst->d_ino_softlimit = src->d_ino_softlimit; 283 + dst->d_bcount = quota_btobb(src->d_space); 284 + dst->d_icount = src->d_ino_count; 285 + dst->d_itimer = src->d_ino_timer; 286 + dst->d_btimer = src->d_spc_timer; 287 + dst->d_iwarns = src->d_ino_warns; 288 + dst->d_bwarns = src->d_spc_warns; 289 + dst->d_rtb_hardlimit = quota_btobb(src->d_rt_spc_hardlimit); 290 + dst->d_rtb_softlimit = quota_btobb(src->d_rt_spc_softlimit); 291 + dst->d_rtbcount = quota_btobb(src->d_rt_space); 292 + dst->d_rtbtimer = src->d_rt_spc_timer; 293 + dst->d_rtbwarns = src->d_rt_spc_warns; 342 294 } 343 295 344 296 static int quota_getxquota(struct super_block *sb, int type, qid_t id, 345 297 void __user *addr) 346 298 { 347 299 struct fs_disk_quota fdq; 300 + struct qc_dqblk qdq; 348 301 struct kqid qid; 349 302 int ret; 350 303 ··· 384 275 qid = make_kqid(current_user_ns(), type, id); 385 276 if (!qid_valid(qid)) 386 277 return -EINVAL; 387 - ret = sb->s_qcop->get_dqblk(sb, qid, &fdq); 388 - if (!ret && copy_to_user(addr, &fdq, sizeof(fdq))) 278 + ret = sb->s_qcop->get_dqblk(sb, qid, &qdq); 279 + if (ret) 280 + return ret; 281 + copy_to_xfs_dqblk(&fdq, &qdq, type, id); 282 + if (copy_to_user(addr, &fdq, sizeof(fdq))) 389 283 return -EFAULT; 390 284 return ret; 391 285 }
+1 -1
fs/udf/file.c
··· 224 224 static int udf_release_file(struct inode *inode, struct file *filp) 225 225 { 226 226 if (filp->f_mode & FMODE_WRITE && 227 - atomic_read(&inode->i_writecount) > 1) { 227 + atomic_read(&inode->i_writecount) == 1) { 228 228 /* 229 229 * Grab i_mutex to avoid races with writes changing i_size 230 230 * while we are running.
+2 -2
fs/xfs/xfs_qm.h
··· 166 166 /* quota ops */ 167 167 extern int xfs_qm_scall_trunc_qfiles(struct xfs_mount *, uint); 168 168 extern int xfs_qm_scall_getquota(struct xfs_mount *, xfs_dqid_t, 169 - uint, struct fs_disk_quota *); 169 + uint, struct qc_dqblk *); 170 170 extern int xfs_qm_scall_setqlim(struct xfs_mount *, xfs_dqid_t, uint, 171 - struct fs_disk_quota *); 171 + struct qc_dqblk *); 172 172 extern int xfs_qm_scall_getqstat(struct xfs_mount *, 173 173 struct fs_quota_stat *); 174 174 extern int xfs_qm_scall_getqstatv(struct xfs_mount *,
+66 -90
fs/xfs/xfs_qm_syscalls.c
··· 39 39 STATIC int xfs_qm_log_quotaoff_end(xfs_mount_t *, xfs_qoff_logitem_t *, 40 40 uint); 41 41 STATIC uint xfs_qm_export_flags(uint); 42 - STATIC uint xfs_qm_export_qtype_flags(uint); 43 42 44 43 /* 45 44 * Turn off quota accounting and/or enforcement for all udquots and/or ··· 572 573 return 0; 573 574 } 574 575 575 - #define XFS_DQ_MASK \ 576 - (FS_DQ_LIMIT_MASK | FS_DQ_TIMER_MASK | FS_DQ_WARNS_MASK) 576 + #define XFS_QC_MASK \ 577 + (QC_LIMIT_MASK | QC_TIMER_MASK | QC_WARNS_MASK) 577 578 578 579 /* 579 580 * Adjust quota limits, and start/stop timers accordingly. ··· 583 584 struct xfs_mount *mp, 584 585 xfs_dqid_t id, 585 586 uint type, 586 - fs_disk_quota_t *newlim) 587 + struct qc_dqblk *newlim) 587 588 { 588 589 struct xfs_quotainfo *q = mp->m_quotainfo; 589 590 struct xfs_disk_dquot *ddq; ··· 592 593 int error; 593 594 xfs_qcnt_t hard, soft; 594 595 595 - if (newlim->d_fieldmask & ~XFS_DQ_MASK) 596 + if (newlim->d_fieldmask & ~XFS_QC_MASK) 596 597 return -EINVAL; 597 - if ((newlim->d_fieldmask & XFS_DQ_MASK) == 0) 598 + if ((newlim->d_fieldmask & XFS_QC_MASK) == 0) 598 599 return 0; 599 600 600 601 /* ··· 632 633 /* 633 634 * Make sure that hardlimits are >= soft limits before changing. 634 635 */ 635 - hard = (newlim->d_fieldmask & FS_DQ_BHARD) ? 636 - (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_blk_hardlimit) : 636 + hard = (newlim->d_fieldmask & QC_SPC_HARD) ? 637 + (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_spc_hardlimit) : 637 638 be64_to_cpu(ddq->d_blk_hardlimit); 638 - soft = (newlim->d_fieldmask & FS_DQ_BSOFT) ? 639 - (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_blk_softlimit) : 639 + soft = (newlim->d_fieldmask & QC_SPC_SOFT) ? 640 + (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_spc_softlimit) : 640 641 be64_to_cpu(ddq->d_blk_softlimit); 641 642 if (hard == 0 || hard >= soft) { 642 643 ddq->d_blk_hardlimit = cpu_to_be64(hard); ··· 649 650 } else { 650 651 xfs_debug(mp, "blkhard %Ld < blksoft %Ld", hard, soft); 651 652 } 652 - hard = (newlim->d_fieldmask & FS_DQ_RTBHARD) ? 653 - (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_rtb_hardlimit) : 653 + hard = (newlim->d_fieldmask & QC_RT_SPC_HARD) ? 654 + (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_rt_spc_hardlimit) : 654 655 be64_to_cpu(ddq->d_rtb_hardlimit); 655 - soft = (newlim->d_fieldmask & FS_DQ_RTBSOFT) ? 656 - (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_rtb_softlimit) : 656 + soft = (newlim->d_fieldmask & QC_RT_SPC_SOFT) ? 657 + (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_rt_spc_softlimit) : 657 658 be64_to_cpu(ddq->d_rtb_softlimit); 658 659 if (hard == 0 || hard >= soft) { 659 660 ddq->d_rtb_hardlimit = cpu_to_be64(hard); ··· 666 667 xfs_debug(mp, "rtbhard %Ld < rtbsoft %Ld", hard, soft); 667 668 } 668 669 669 - hard = (newlim->d_fieldmask & FS_DQ_IHARD) ? 670 + hard = (newlim->d_fieldmask & QC_INO_HARD) ? 670 671 (xfs_qcnt_t) newlim->d_ino_hardlimit : 671 672 be64_to_cpu(ddq->d_ino_hardlimit); 672 - soft = (newlim->d_fieldmask & FS_DQ_ISOFT) ? 673 + soft = (newlim->d_fieldmask & QC_INO_SOFT) ? 673 674 (xfs_qcnt_t) newlim->d_ino_softlimit : 674 675 be64_to_cpu(ddq->d_ino_softlimit); 675 676 if (hard == 0 || hard >= soft) { ··· 686 687 /* 687 688 * Update warnings counter(s) if requested 688 689 */ 689 - if (newlim->d_fieldmask & FS_DQ_BWARNS) 690 - ddq->d_bwarns = cpu_to_be16(newlim->d_bwarns); 691 - if (newlim->d_fieldmask & FS_DQ_IWARNS) 692 - ddq->d_iwarns = cpu_to_be16(newlim->d_iwarns); 693 - if (newlim->d_fieldmask & FS_DQ_RTBWARNS) 694 - ddq->d_rtbwarns = cpu_to_be16(newlim->d_rtbwarns); 690 + if (newlim->d_fieldmask & QC_SPC_WARNS) 691 + ddq->d_bwarns = cpu_to_be16(newlim->d_spc_warns); 692 + if (newlim->d_fieldmask & QC_INO_WARNS) 693 + ddq->d_iwarns = cpu_to_be16(newlim->d_ino_warns); 694 + if (newlim->d_fieldmask & QC_RT_SPC_WARNS) 695 + ddq->d_rtbwarns = cpu_to_be16(newlim->d_rt_spc_warns); 695 696 696 697 if (id == 0) { 697 698 /* ··· 701 702 * soft and hard limit values (already done, above), and 702 703 * for warnings. 703 704 */ 704 - if (newlim->d_fieldmask & FS_DQ_BTIMER) { 705 - q->qi_btimelimit = newlim->d_btimer; 706 - ddq->d_btimer = cpu_to_be32(newlim->d_btimer); 705 + if (newlim->d_fieldmask & QC_SPC_TIMER) { 706 + q->qi_btimelimit = newlim->d_spc_timer; 707 + ddq->d_btimer = cpu_to_be32(newlim->d_spc_timer); 707 708 } 708 - if (newlim->d_fieldmask & FS_DQ_ITIMER) { 709 - q->qi_itimelimit = newlim->d_itimer; 710 - ddq->d_itimer = cpu_to_be32(newlim->d_itimer); 709 + if (newlim->d_fieldmask & QC_INO_TIMER) { 710 + q->qi_itimelimit = newlim->d_ino_timer; 711 + ddq->d_itimer = cpu_to_be32(newlim->d_ino_timer); 711 712 } 712 - if (newlim->d_fieldmask & FS_DQ_RTBTIMER) { 713 - q->qi_rtbtimelimit = newlim->d_rtbtimer; 714 - ddq->d_rtbtimer = cpu_to_be32(newlim->d_rtbtimer); 713 + if (newlim->d_fieldmask & QC_RT_SPC_TIMER) { 714 + q->qi_rtbtimelimit = newlim->d_rt_spc_timer; 715 + ddq->d_rtbtimer = cpu_to_be32(newlim->d_rt_spc_timer); 715 716 } 716 - if (newlim->d_fieldmask & FS_DQ_BWARNS) 717 - q->qi_bwarnlimit = newlim->d_bwarns; 718 - if (newlim->d_fieldmask & FS_DQ_IWARNS) 719 - q->qi_iwarnlimit = newlim->d_iwarns; 720 - if (newlim->d_fieldmask & FS_DQ_RTBWARNS) 721 - q->qi_rtbwarnlimit = newlim->d_rtbwarns; 717 + if (newlim->d_fieldmask & QC_SPC_WARNS) 718 + q->qi_bwarnlimit = newlim->d_spc_warns; 719 + if (newlim->d_fieldmask & QC_INO_WARNS) 720 + q->qi_iwarnlimit = newlim->d_ino_warns; 721 + if (newlim->d_fieldmask & QC_RT_SPC_WARNS) 722 + q->qi_rtbwarnlimit = newlim->d_rt_spc_warns; 722 723 } else { 723 724 /* 724 725 * If the user is now over quota, start the timelimit. ··· 823 824 struct xfs_mount *mp, 824 825 xfs_dqid_t id, 825 826 uint type, 826 - struct fs_disk_quota *dst) 827 + struct qc_dqblk *dst) 827 828 { 828 829 struct xfs_dquot *dqp; 829 830 int error; ··· 847 848 } 848 849 849 850 memset(dst, 0, sizeof(*dst)); 850 - dst->d_version = FS_DQUOT_VERSION; 851 - dst->d_flags = xfs_qm_export_qtype_flags(dqp->q_core.d_flags); 852 - dst->d_id = be32_to_cpu(dqp->q_core.d_id); 853 - dst->d_blk_hardlimit = 854 - XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_blk_hardlimit)); 855 - dst->d_blk_softlimit = 856 - XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_blk_softlimit)); 851 + dst->d_spc_hardlimit = 852 + XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_blk_hardlimit)); 853 + dst->d_spc_softlimit = 854 + XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_blk_softlimit)); 857 855 dst->d_ino_hardlimit = be64_to_cpu(dqp->q_core.d_ino_hardlimit); 858 856 dst->d_ino_softlimit = be64_to_cpu(dqp->q_core.d_ino_softlimit); 859 - dst->d_bcount = XFS_FSB_TO_BB(mp, dqp->q_res_bcount); 860 - dst->d_icount = dqp->q_res_icount; 861 - dst->d_btimer = be32_to_cpu(dqp->q_core.d_btimer); 862 - dst->d_itimer = be32_to_cpu(dqp->q_core.d_itimer); 863 - dst->d_iwarns = be16_to_cpu(dqp->q_core.d_iwarns); 864 - dst->d_bwarns = be16_to_cpu(dqp->q_core.d_bwarns); 865 - dst->d_rtb_hardlimit = 866 - XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtb_hardlimit)); 867 - dst->d_rtb_softlimit = 868 - XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtb_softlimit)); 869 - dst->d_rtbcount = XFS_FSB_TO_BB(mp, dqp->q_res_rtbcount); 870 - dst->d_rtbtimer = be32_to_cpu(dqp->q_core.d_rtbtimer); 871 - dst->d_rtbwarns = be16_to_cpu(dqp->q_core.d_rtbwarns); 857 + dst->d_space = XFS_FSB_TO_B(mp, dqp->q_res_bcount); 858 + dst->d_ino_count = dqp->q_res_icount; 859 + dst->d_spc_timer = be32_to_cpu(dqp->q_core.d_btimer); 860 + dst->d_ino_timer = be32_to_cpu(dqp->q_core.d_itimer); 861 + dst->d_ino_warns = be16_to_cpu(dqp->q_core.d_iwarns); 862 + dst->d_spc_warns = be16_to_cpu(dqp->q_core.d_bwarns); 863 + dst->d_rt_spc_hardlimit = 864 + XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_rtb_hardlimit)); 865 + dst->d_rt_spc_softlimit = 866 + XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_rtb_softlimit)); 867 + dst->d_rt_space = XFS_FSB_TO_B(mp, dqp->q_res_rtbcount); 868 + dst->d_rt_spc_timer = be32_to_cpu(dqp->q_core.d_rtbtimer); 869 + dst->d_rt_spc_warns = be16_to_cpu(dqp->q_core.d_rtbwarns); 872 870 873 871 /* 874 872 * Internally, we don't reset all the timers when quota enforcement ··· 878 882 dqp->q_core.d_flags == XFS_DQ_GROUP) || 879 883 (!XFS_IS_PQUOTA_ENFORCED(mp) && 880 884 dqp->q_core.d_flags == XFS_DQ_PROJ)) { 881 - dst->d_btimer = 0; 882 - dst->d_itimer = 0; 883 - dst->d_rtbtimer = 0; 885 + dst->d_spc_timer = 0; 886 + dst->d_ino_timer = 0; 887 + dst->d_rt_spc_timer = 0; 884 888 } 885 889 886 890 #ifdef DEBUG 887 - if (((XFS_IS_UQUOTA_ENFORCED(mp) && dst->d_flags == FS_USER_QUOTA) || 888 - (XFS_IS_GQUOTA_ENFORCED(mp) && dst->d_flags == FS_GROUP_QUOTA) || 889 - (XFS_IS_PQUOTA_ENFORCED(mp) && dst->d_flags == FS_PROJ_QUOTA)) && 890 - dst->d_id != 0) { 891 - if ((dst->d_bcount > dst->d_blk_softlimit) && 892 - (dst->d_blk_softlimit > 0)) { 893 - ASSERT(dst->d_btimer != 0); 891 + if (((XFS_IS_UQUOTA_ENFORCED(mp) && type == XFS_DQ_USER) || 892 + (XFS_IS_GQUOTA_ENFORCED(mp) && type == XFS_DQ_GROUP) || 893 + (XFS_IS_PQUOTA_ENFORCED(mp) && type == XFS_DQ_PROJ)) && 894 + id != 0) { 895 + if ((dst->d_space > dst->d_spc_softlimit) && 896 + (dst->d_spc_softlimit > 0)) { 897 + ASSERT(dst->d_spc_timer != 0); 894 898 } 895 - if ((dst->d_icount > dst->d_ino_softlimit) && 899 + if ((dst->d_ino_count > dst->d_ino_softlimit) && 896 900 (dst->d_ino_softlimit > 0)) { 897 - ASSERT(dst->d_itimer != 0); 901 + ASSERT(dst->d_ino_timer != 0); 898 902 } 899 903 } 900 904 #endif 901 905 out_put: 902 906 xfs_qm_dqput(dqp); 903 907 return error; 904 - } 905 - 906 - STATIC uint 907 - xfs_qm_export_qtype_flags( 908 - uint flags) 909 - { 910 - /* 911 - * Can't be more than one, or none. 912 - */ 913 - ASSERT((flags & (FS_PROJ_QUOTA | FS_USER_QUOTA)) != 914 - (FS_PROJ_QUOTA | FS_USER_QUOTA)); 915 - ASSERT((flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)) != 916 - (FS_PROJ_QUOTA | FS_GROUP_QUOTA)); 917 - ASSERT((flags & (FS_USER_QUOTA | FS_GROUP_QUOTA)) != 918 - (FS_USER_QUOTA | FS_GROUP_QUOTA)); 919 - ASSERT((flags & (FS_PROJ_QUOTA|FS_USER_QUOTA|FS_GROUP_QUOTA)) != 0); 920 - 921 - return (flags & XFS_DQ_USER) ? 922 - FS_USER_QUOTA : (flags & XFS_DQ_PROJ) ? 923 - FS_PROJ_QUOTA : FS_GROUP_QUOTA; 924 908 } 925 909 926 910 STATIC uint
+4 -4
fs/xfs/xfs_quotaops.c
··· 131 131 xfs_fs_get_dqblk( 132 132 struct super_block *sb, 133 133 struct kqid qid, 134 - struct fs_disk_quota *fdq) 134 + struct qc_dqblk *qdq) 135 135 { 136 136 struct xfs_mount *mp = XFS_M(sb); 137 137 ··· 141 141 return -ESRCH; 142 142 143 143 return xfs_qm_scall_getquota(mp, from_kqid(&init_user_ns, qid), 144 - xfs_quota_type(qid.type), fdq); 144 + xfs_quota_type(qid.type), qdq); 145 145 } 146 146 147 147 STATIC int 148 148 xfs_fs_set_dqblk( 149 149 struct super_block *sb, 150 150 struct kqid qid, 151 - struct fs_disk_quota *fdq) 151 + struct qc_dqblk *qdq) 152 152 { 153 153 struct xfs_mount *mp = XFS_M(sb); 154 154 ··· 160 160 return -ESRCH; 161 161 162 162 return xfs_qm_scall_setqlim(mp, from_kqid(&init_user_ns, qid), 163 - xfs_quota_type(qid.type), fdq); 163 + xfs_quota_type(qid.type), qdq); 164 164 } 165 165 166 166 const struct quotactl_ops xfs_quotactl_operations = {
+45 -2
include/linux/quota.h
··· 321 321 322 322 struct path; 323 323 324 + /* Structure for communicating via ->get_dqblk() & ->set_dqblk() */ 325 + struct qc_dqblk { 326 + int d_fieldmask; /* mask of fields to change in ->set_dqblk() */ 327 + u64 d_spc_hardlimit; /* absolute limit on used space */ 328 + u64 d_spc_softlimit; /* preferred limit on used space */ 329 + u64 d_ino_hardlimit; /* maximum # allocated inodes */ 330 + u64 d_ino_softlimit; /* preferred inode limit */ 331 + u64 d_space; /* Space owned by the user */ 332 + u64 d_ino_count; /* # inodes owned by the user */ 333 + s64 d_ino_timer; /* zero if within inode limits */ 334 + /* if not, we refuse service */ 335 + s64 d_spc_timer; /* similar to above; for space */ 336 + int d_ino_warns; /* # warnings issued wrt num inodes */ 337 + int d_spc_warns; /* # warnings issued wrt used space */ 338 + u64 d_rt_spc_hardlimit; /* absolute limit on realtime space */ 339 + u64 d_rt_spc_softlimit; /* preferred limit on RT space */ 340 + u64 d_rt_space; /* realtime space owned */ 341 + s64 d_rt_spc_timer; /* similar to above; for RT space */ 342 + int d_rt_spc_warns; /* # warnings issued wrt RT space */ 343 + }; 344 + 345 + /* Field specifiers for ->set_dqblk() in struct qc_dqblk */ 346 + #define QC_INO_SOFT (1<<0) 347 + #define QC_INO_HARD (1<<1) 348 + #define QC_SPC_SOFT (1<<2) 349 + #define QC_SPC_HARD (1<<3) 350 + #define QC_RT_SPC_SOFT (1<<4) 351 + #define QC_RT_SPC_HARD (1<<5) 352 + #define QC_LIMIT_MASK (QC_INO_SOFT | QC_INO_HARD | QC_SPC_SOFT | QC_SPC_HARD | \ 353 + QC_RT_SPC_SOFT | QC_RT_SPC_HARD) 354 + #define QC_SPC_TIMER (1<<6) 355 + #define QC_INO_TIMER (1<<7) 356 + #define QC_RT_SPC_TIMER (1<<8) 357 + #define QC_TIMER_MASK (QC_SPC_TIMER | QC_INO_TIMER | QC_RT_SPC_TIMER) 358 + #define QC_SPC_WARNS (1<<9) 359 + #define QC_INO_WARNS (1<<10) 360 + #define QC_RT_SPC_WARNS (1<<11) 361 + #define QC_WARNS_MASK (QC_SPC_WARNS | QC_INO_WARNS | QC_RT_SPC_WARNS) 362 + #define QC_SPACE (1<<12) 363 + #define QC_INO_COUNT (1<<13) 364 + #define QC_RT_SPACE (1<<14) 365 + #define QC_ACCT_MASK (QC_SPACE | QC_INO_COUNT | QC_RT_SPACE) 366 + 324 367 /* Operations handling requests from userspace */ 325 368 struct quotactl_ops { 326 369 int (*quota_on)(struct super_block *, int, int, struct path *); ··· 372 329 int (*quota_sync)(struct super_block *, int); 373 330 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 374 331 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 375 - int (*get_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); 376 - int (*set_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); 332 + int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); 333 + int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); 377 334 int (*get_xstate)(struct super_block *, struct fs_quota_stat *); 378 335 int (*set_xstate)(struct super_block *, unsigned int, int); 379 336 int (*get_xstatev)(struct super_block *, struct fs_quota_statv *);
+2 -2
include/linux/quotaops.h
··· 98 98 int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 99 99 int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 100 100 int dquot_get_dqblk(struct super_block *sb, struct kqid id, 101 - struct fs_disk_quota *di); 101 + struct qc_dqblk *di); 102 102 int dquot_set_dqblk(struct super_block *sb, struct kqid id, 103 - struct fs_disk_quota *di); 103 + struct qc_dqblk *di); 104 104 105 105 int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); 106 106 int dquot_transfer(struct inode *inode, struct iattr *iattr);