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

xfs: remove the xfs_disk_dquot_t and xfs_dquot_t

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: fix some of the comments]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

authored by

Pavel Reichl and committed by
Darrick J. Wong
aefe69a4 e8777b27

+110 -107
+4 -4
fs/xfs/libxfs/xfs_dquot_buf.c
··· 35 35 36 36 xfs_failaddr_t 37 37 xfs_dquot_verify( 38 - struct xfs_mount *mp, 39 - xfs_disk_dquot_t *ddq, 40 - xfs_dqid_t id, 41 - uint type) /* used only during quotacheck */ 38 + struct xfs_mount *mp, 39 + struct xfs_disk_dquot *ddq, 40 + xfs_dqid_t id, 41 + uint type) /* used only during quotacheck */ 42 42 { 43 43 /* 44 44 * We can encounter an uninitialized dquot buffer for 2 reasons:
+5 -5
fs/xfs/libxfs/xfs_format.h
··· 1144 1144 1145 1145 /* 1146 1146 * This is the main portion of the on-disk representation of quota 1147 - * information for a user. This is the q_core of the xfs_dquot_t that 1147 + * information for a user. This is the q_core of the struct xfs_dquot that 1148 1148 * is kept in kernel memory. We pad this with some more expansion room 1149 1149 * to construct the on disk structure. 1150 1150 */ 1151 - typedef struct xfs_disk_dquot { 1151 + struct xfs_disk_dquot { 1152 1152 __be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */ 1153 1153 __u8 d_version; /* dquot version */ 1154 1154 __u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */ ··· 1171 1171 __be32 d_rtbtimer; /* similar to above; for RT disk blocks */ 1172 1172 __be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */ 1173 1173 __be16 d_pad; 1174 - } xfs_disk_dquot_t; 1174 + }; 1175 1175 1176 1176 /* 1177 1177 * This is what goes on disk. This is separated from the xfs_disk_dquot because 1178 1178 * carrying the unnecessary padding would be a waste of memory. 1179 1179 */ 1180 1180 typedef struct xfs_dqblk { 1181 - xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */ 1182 - char dd_fill[4]; /* filling for posterity */ 1181 + struct xfs_disk_dquot dd_diskdq; /* portion living incore as well */ 1182 + char dd_fill[4];/* filling for posterity */ 1183 1183 1184 1184 /* 1185 1185 * These two are only present on filesystems with the CRC bits set.
+1 -1
fs/xfs/libxfs/xfs_trans_resv.c
··· 718 718 719 719 /* 720 720 * Adjusting quota limits. 721 - * the xfs_disk_dquot_t: sizeof(struct xfs_disk_dquot) 721 + * the disk quota buffer: sizeof(struct xfs_disk_dquot) 722 722 */ 723 723 STATIC uint 724 724 xfs_calc_qm_setqlim_reservation(void)
+9 -9
fs/xfs/xfs_dquot.c
··· 48 48 */ 49 49 void 50 50 xfs_qm_dqdestroy( 51 - xfs_dquot_t *dqp) 51 + struct xfs_dquot *dqp) 52 52 { 53 53 ASSERT(list_empty(&dqp->q_lru)); 54 54 ··· 113 113 */ 114 114 void 115 115 xfs_qm_adjust_dqtimers( 116 - xfs_mount_t *mp, 117 - xfs_disk_dquot_t *d) 116 + struct xfs_mount *mp, 117 + struct xfs_disk_dquot *d) 118 118 { 119 119 ASSERT(d->d_id); 120 120 ··· 497 497 struct xfs_disk_dquot *ddqp = bp->b_addr + dqp->q_bufoffset; 498 498 499 499 /* copy everything from disk dquot to the incore dquot */ 500 - memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t)); 500 + memcpy(&dqp->q_core, ddqp, sizeof(struct xfs_disk_dquot)); 501 501 502 502 /* 503 503 * Reservation counters are defined as reservation plus current usage ··· 989 989 */ 990 990 void 991 991 xfs_qm_dqrele( 992 - xfs_dquot_t *dqp) 992 + struct xfs_dquot *dqp) 993 993 { 994 994 if (!dqp) 995 995 return; ··· 1019 1019 struct xfs_log_item *lip) 1020 1020 { 1021 1021 xfs_dq_logitem_t *qip = (struct xfs_dq_logitem *)lip; 1022 - xfs_dquot_t *dqp = qip->qli_dquot; 1022 + struct xfs_dquot *dqp = qip->qli_dquot; 1023 1023 struct xfs_ail *ailp = lip->li_ailp; 1024 1024 1025 1025 /* ··· 1130 1130 } 1131 1131 1132 1132 /* This is the only portion of data that needs to persist */ 1133 - memcpy(ddqp, &dqp->q_core, sizeof(xfs_disk_dquot_t)); 1133 + memcpy(ddqp, &dqp->q_core, sizeof(struct xfs_disk_dquot)); 1134 1134 1135 1135 /* 1136 1136 * Clear the dirty field and remember the flush lsn for later use. ··· 1188 1188 */ 1189 1189 void 1190 1190 xfs_dqlock2( 1191 - xfs_dquot_t *d1, 1192 - xfs_dquot_t *d2) 1191 + struct xfs_dquot *d1, 1192 + struct xfs_dquot *d2) 1193 1193 { 1194 1194 if (d1 && d2) { 1195 1195 ASSERT(d1 != d2);
+49 -47
fs/xfs/xfs_dquot.h
··· 30 30 /* 31 31 * The incore dquot structure 32 32 */ 33 - typedef struct xfs_dquot { 34 - uint dq_flags; /* various flags (XFS_DQ_*) */ 35 - struct list_head q_lru; /* global free list of dquots */ 36 - struct xfs_mount*q_mount; /* filesystem this relates to */ 37 - uint q_nrefs; /* # active refs from inodes */ 38 - xfs_daddr_t q_blkno; /* blkno of dquot buffer */ 39 - int q_bufoffset; /* off of dq in buffer (# dquots) */ 40 - xfs_fileoff_t q_fileoffset; /* offset in quotas file */ 33 + struct xfs_dquot { 34 + uint dq_flags; 35 + struct list_head q_lru; 36 + struct xfs_mount *q_mount; 37 + uint q_nrefs; 38 + xfs_daddr_t q_blkno; 39 + int q_bufoffset; 40 + xfs_fileoff_t q_fileoffset; 41 41 42 - xfs_disk_dquot_t q_core; /* actual usage & quotas */ 43 - xfs_dq_logitem_t q_logitem; /* dquot log item */ 44 - xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */ 45 - xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */ 46 - xfs_qcnt_t q_res_rtbcount;/* total realtime blks used+reserved */ 47 - xfs_qcnt_t q_prealloc_lo_wmark;/* prealloc throttle wmark */ 48 - xfs_qcnt_t q_prealloc_hi_wmark;/* prealloc disabled wmark */ 49 - int64_t q_low_space[XFS_QLOWSP_MAX]; 50 - struct mutex q_qlock; /* quota lock */ 51 - struct completion q_flush; /* flush completion queue */ 52 - atomic_t q_pincount; /* dquot pin count */ 53 - wait_queue_head_t q_pinwait; /* dquot pinning wait queue */ 54 - } xfs_dquot_t; 42 + struct xfs_disk_dquot q_core; 43 + xfs_dq_logitem_t q_logitem; 44 + /* total regular nblks used+reserved */ 45 + xfs_qcnt_t q_res_bcount; 46 + /* total inos allocd+reserved */ 47 + xfs_qcnt_t q_res_icount; 48 + /* total realtime blks used+reserved */ 49 + xfs_qcnt_t q_res_rtbcount; 50 + xfs_qcnt_t q_prealloc_lo_wmark; 51 + xfs_qcnt_t q_prealloc_hi_wmark; 52 + int64_t q_low_space[XFS_QLOWSP_MAX]; 53 + struct mutex q_qlock; 54 + struct completion q_flush; 55 + atomic_t q_pincount; 56 + struct wait_queue_head q_pinwait; 57 + }; 55 58 56 59 /* 57 60 * Lock hierarchy for q_qlock: 58 61 * XFS_QLOCK_NORMAL is the implicit default, 59 - * XFS_QLOCK_NESTED is the dquot with the higher id in xfs_dqlock2 62 + * XFS_QLOCK_NESTED is the dquot with the higher id in xfs_dqlock2 60 63 */ 61 64 enum { 62 65 XFS_QLOCK_NORMAL = 0, ··· 67 64 }; 68 65 69 66 /* 70 - * Manage the q_flush completion queue embedded in the dquot. This completion 67 + * Manage the q_flush completion queue embedded in the dquot. This completion 71 68 * queue synchronizes processes attempting to flush the in-core dquot back to 72 69 * disk. 73 70 */ 74 - static inline void xfs_dqflock(xfs_dquot_t *dqp) 71 + static inline void xfs_dqflock(struct xfs_dquot *dqp) 75 72 { 76 73 wait_for_completion(&dqp->q_flush); 77 74 } 78 75 79 - static inline bool xfs_dqflock_nowait(xfs_dquot_t *dqp) 76 + static inline bool xfs_dqflock_nowait(struct xfs_dquot *dqp) 80 77 { 81 78 return try_wait_for_completion(&dqp->q_flush); 82 79 } 83 80 84 - static inline void xfs_dqfunlock(xfs_dquot_t *dqp) 81 + static inline void xfs_dqfunlock(struct xfs_dquot *dqp) 85 82 { 86 83 complete(&dqp->q_flush); 87 84 } ··· 115 112 } 116 113 } 117 114 118 - static inline xfs_dquot_t *xfs_inode_dquot(struct xfs_inode *ip, int type) 115 + static inline struct xfs_dquot *xfs_inode_dquot(struct xfs_inode *ip, int type) 119 116 { 120 117 switch (type & XFS_DQ_ALLTYPES) { 121 118 case XFS_DQ_USER: ··· 150 147 #define XFS_QM_ISPDQ(dqp) ((dqp)->dq_flags & XFS_DQ_PROJ) 151 148 #define XFS_QM_ISGDQ(dqp) ((dqp)->dq_flags & XFS_DQ_GROUP) 152 149 153 - extern void xfs_qm_dqdestroy(xfs_dquot_t *); 154 - extern int xfs_qm_dqflush(struct xfs_dquot *, struct xfs_buf **); 155 - extern void xfs_qm_dqunpin_wait(xfs_dquot_t *); 156 - extern void xfs_qm_adjust_dqtimers(xfs_mount_t *, 157 - xfs_disk_dquot_t *); 158 - extern void xfs_qm_adjust_dqlimits(struct xfs_mount *, 159 - struct xfs_dquot *); 160 - extern xfs_dqid_t xfs_qm_id_for_quotatype(struct xfs_inode *ip, 161 - uint type); 162 - extern int xfs_qm_dqget(struct xfs_mount *mp, xfs_dqid_t id, 150 + void xfs_qm_dqdestroy(struct xfs_dquot *dqp); 151 + int xfs_qm_dqflush(struct xfs_dquot *dqp, struct xfs_buf **bpp); 152 + void xfs_qm_dqunpin_wait(struct xfs_dquot *dqp); 153 + void xfs_qm_adjust_dqtimers(struct xfs_mount *mp, 154 + struct xfs_disk_dquot *d); 155 + void xfs_qm_adjust_dqlimits(struct xfs_mount *mp, 156 + struct xfs_dquot *d); 157 + xfs_dqid_t xfs_qm_id_for_quotatype(struct xfs_inode *ip, uint type); 158 + int xfs_qm_dqget(struct xfs_mount *mp, xfs_dqid_t id, 163 159 uint type, bool can_alloc, 164 160 struct xfs_dquot **dqpp); 165 - extern int xfs_qm_dqget_inode(struct xfs_inode *ip, uint type, 166 - bool can_alloc, 167 - struct xfs_dquot **dqpp); 168 - extern int xfs_qm_dqget_next(struct xfs_mount *mp, xfs_dqid_t id, 161 + int xfs_qm_dqget_inode(struct xfs_inode *ip, uint type, 162 + bool can_alloc, 163 + struct xfs_dquot **dqpp); 164 + int xfs_qm_dqget_next(struct xfs_mount *mp, xfs_dqid_t id, 169 165 uint type, struct xfs_dquot **dqpp); 170 - extern int xfs_qm_dqget_uncached(struct xfs_mount *mp, 171 - xfs_dqid_t id, uint type, 172 - struct xfs_dquot **dqpp); 173 - extern void xfs_qm_dqput(xfs_dquot_t *); 166 + int xfs_qm_dqget_uncached(struct xfs_mount *mp, 167 + xfs_dqid_t id, uint type, 168 + struct xfs_dquot **dqpp); 169 + void xfs_qm_dqput(struct xfs_dquot *dqp); 174 170 175 - extern void xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *); 171 + void xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *); 176 172 177 - extern void xfs_dquot_set_prealloc_limits(struct xfs_dquot *); 173 + void xfs_dquot_set_prealloc_limits(struct xfs_dquot *); 178 174 179 175 static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp) 180 176 {
+3 -2
fs/xfs/xfs_log_recover.c
··· 2567 2567 int bit; 2568 2568 int nbits; 2569 2569 xfs_failaddr_t fa; 2570 + const size_t size_disk_dquot = sizeof(struct xfs_disk_dquot); 2570 2571 2571 2572 trace_xfs_log_recover_buf_reg_buf(mp->m_log, buf_f); 2572 2573 ··· 2610 2609 "XFS: NULL dquot in %s.", __func__); 2611 2610 goto next; 2612 2611 } 2613 - if (item->ri_buf[i].i_len < sizeof(xfs_disk_dquot_t)) { 2612 + if (item->ri_buf[i].i_len < size_disk_dquot) { 2614 2613 xfs_alert(mp, 2615 2614 "XFS: dquot too small (%d) in %s.", 2616 2615 item->ri_buf[i].i_len, __func__); ··· 3237 3236 xfs_alert(log->l_mp, "NULL dquot in %s.", __func__); 3238 3237 return -EFSCORRUPTED; 3239 3238 } 3240 - if (item->ri_buf[1].i_len < sizeof(xfs_disk_dquot_t)) { 3239 + if (item->ri_buf[1].i_len < sizeof(struct xfs_disk_dquot)) { 3241 3240 xfs_alert(log->l_mp, "dquot too small (%d) in %s.", 3242 3241 item->ri_buf[1].i_len, __func__); 3243 3242 return -EFSCORRUPTED;
+15 -15
fs/xfs/xfs_qm.c
··· 244 244 245 245 STATIC int 246 246 xfs_qm_dqattach_one( 247 - xfs_inode_t *ip, 248 - xfs_dqid_t id, 249 - uint type, 250 - bool doalloc, 251 - xfs_dquot_t **IO_idqpp) 247 + struct xfs_inode *ip, 248 + xfs_dqid_t id, 249 + uint type, 250 + bool doalloc, 251 + struct xfs_dquot **IO_idqpp) 252 252 { 253 - xfs_dquot_t *dqp; 254 - int error; 253 + struct xfs_dquot *dqp; 254 + int error; 255 255 256 256 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); 257 257 error = 0; ··· 544 544 uint type, 545 545 xfs_quotainfo_t *qinf) 546 546 { 547 - xfs_dquot_t *dqp; 548 - struct xfs_def_quota *defq; 547 + struct xfs_dquot *dqp; 548 + struct xfs_def_quota *defq; 549 549 struct xfs_disk_dquot *ddqp; 550 550 int error; 551 551 ··· 1742 1742 * Actually transfer ownership, and do dquot modifications. 1743 1743 * These were already reserved. 1744 1744 */ 1745 - xfs_dquot_t * 1745 + struct xfs_dquot * 1746 1746 xfs_qm_vop_chown( 1747 - xfs_trans_t *tp, 1748 - xfs_inode_t *ip, 1749 - xfs_dquot_t **IO_olddq, 1750 - xfs_dquot_t *newdq) 1747 + struct xfs_trans *tp, 1748 + struct xfs_inode *ip, 1749 + struct xfs_dquot **IO_olddq, 1750 + struct xfs_dquot *newdq) 1751 1751 { 1752 - xfs_dquot_t *prevdq; 1752 + struct xfs_dquot *prevdq; 1753 1753 uint bfield = XFS_IS_REALTIME_INODE(ip) ? 1754 1754 XFS_TRANS_DQ_RTBCOUNT : XFS_TRANS_DQ_BCOUNT; 1755 1755
+3 -3
fs/xfs/xfs_qm_bhv.c
··· 54 54 */ 55 55 void 56 56 xfs_qm_statvfs( 57 - xfs_inode_t *ip, 57 + struct xfs_inode *ip, 58 58 struct kstatfs *statp) 59 59 { 60 - xfs_mount_t *mp = ip->i_mount; 61 - xfs_dquot_t *dqp; 60 + struct xfs_mount *mp = ip->i_mount; 61 + struct xfs_dquot *dqp; 62 62 63 63 if (!xfs_qm_dqget(mp, ip->i_d.di_projid, XFS_DQ_PROJ, false, &dqp)) { 64 64 xfs_fill_statvfs_from_dquot(statp, dqp);
+21 -21
fs/xfs/xfs_trans_dquot.c
··· 25 25 */ 26 26 void 27 27 xfs_trans_dqjoin( 28 - xfs_trans_t *tp, 29 - xfs_dquot_t *dqp) 28 + struct xfs_trans *tp, 29 + struct xfs_dquot *dqp) 30 30 { 31 31 ASSERT(XFS_DQ_IS_LOCKED(dqp)); 32 32 ASSERT(dqp->q_logitem.qli_dquot == dqp); ··· 49 49 */ 50 50 void 51 51 xfs_trans_log_dquot( 52 - xfs_trans_t *tp, 53 - xfs_dquot_t *dqp) 52 + struct xfs_trans *tp, 53 + struct xfs_dquot *dqp) 54 54 { 55 55 ASSERT(XFS_DQ_IS_LOCKED(dqp)); 56 56 ··· 486 486 */ 487 487 void 488 488 xfs_trans_unreserve_and_mod_dquots( 489 - xfs_trans_t *tp) 489 + struct xfs_trans *tp) 490 490 { 491 491 int i, j; 492 - xfs_dquot_t *dqp; 492 + struct xfs_dquot *dqp; 493 493 struct xfs_dqtrx *qtrx, *qa; 494 - bool locked; 494 + bool locked; 495 495 496 496 if (!tp->t_dqinfo || !(tp->t_flags & XFS_TRANS_DQ_DIRTY)) 497 497 return; ··· 571 571 */ 572 572 STATIC int 573 573 xfs_trans_dqresv( 574 - xfs_trans_t *tp, 575 - xfs_mount_t *mp, 576 - xfs_dquot_t *dqp, 577 - int64_t nblks, 578 - long ninos, 579 - uint flags) 574 + struct xfs_trans *tp, 575 + struct xfs_mount *mp, 576 + struct xfs_dquot *dqp, 577 + int64_t nblks, 578 + long ninos, 579 + uint flags) 580 580 { 581 - xfs_qcnt_t hardlimit; 582 - xfs_qcnt_t softlimit; 583 - time_t timer; 584 - xfs_qwarncnt_t warns; 585 - xfs_qwarncnt_t warnlimit; 586 - xfs_qcnt_t total_count; 587 - xfs_qcnt_t *resbcountp; 588 - xfs_quotainfo_t *q = mp->m_quotainfo; 581 + xfs_qcnt_t hardlimit; 582 + xfs_qcnt_t softlimit; 583 + time_t timer; 584 + xfs_qwarncnt_t warns; 585 + xfs_qwarncnt_t warnlimit; 586 + xfs_qcnt_t total_count; 587 + xfs_qcnt_t *resbcountp; 588 + xfs_quotainfo_t *q = mp->m_quotainfo; 589 589 struct xfs_def_quota *defq; 590 590 591 591