* [PATCH 0/5] xfs: remove several typedefs in quota code
@ 2019-11-07 11:35 Pavel Reichl
2019-11-07 11:35 ` [PATCH 1/5] xfs: remove the xfs_disk_dquot_t typedef Pavel Reichl
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Pavel Reichl @ 2019-11-07 11:35 UTC (permalink / raw)
To: linux-xfs; +Cc: Pavel Reichl
Eliminate some typedefs.
Pavel Reichl (5):
xfs: remove the xfs_disk_dquot_t typedef
xfs: remove the xfs_dquot_t typedef
xfs: remove the xfs_quotainfo_t typedef
xfs: remove the xfs_dq_logitem_t typedef
xfs: remove the xfs_qoff_logitem_t typedef
fs/xfs/libxfs/xfs_dquot_buf.c | 8 +++---
fs/xfs/libxfs/xfs_format.h | 10 ++++----
fs/xfs/libxfs/xfs_trans_resv.c | 5 ++--
fs/xfs/xfs_dquot.c | 18 ++++++-------
fs/xfs/xfs_dquot.h | 31 ++++++++++++-----------
fs/xfs/xfs_dquot_item.h | 18 +++++++------
fs/xfs/xfs_log_recover.c | 5 ++--
fs/xfs/xfs_qm.c | 42 +++++++++++++++----------------
fs/xfs/xfs_qm.h | 4 +--
fs/xfs/xfs_qm_bhv.c | 2 +-
fs/xfs/xfs_qm_syscalls.c | 20 +++++++--------
fs/xfs/xfs_trans_dquot.c | 46 +++++++++++++++++-----------------
12 files changed, 106 insertions(+), 103 deletions(-)
--
2.23.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/5] xfs: remove the xfs_disk_dquot_t typedef
2019-11-07 11:35 [PATCH 0/5] xfs: remove several typedefs in quota code Pavel Reichl
@ 2019-11-07 11:35 ` Pavel Reichl
2019-11-07 22:02 ` Darrick J. Wong
2019-11-07 11:35 ` [PATCH 2/5] xfs: remove the xfs_dquot_t typedef Pavel Reichl
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Pavel Reichl @ 2019-11-07 11:35 UTC (permalink / raw)
To: linux-xfs; +Cc: Pavel Reichl
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
fs/xfs/libxfs/xfs_dquot_buf.c | 8 ++++----
fs/xfs/libxfs/xfs_format.h | 10 +++++-----
fs/xfs/libxfs/xfs_trans_resv.c | 1 -
fs/xfs/xfs_dquot.c | 10 +++++-----
fs/xfs/xfs_dquot.h | 8 ++++----
fs/xfs/xfs_log_recover.c | 5 +++--
6 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_dquot_buf.c b/fs/xfs/libxfs/xfs_dquot_buf.c
index e8bd688a4073..67baed82f6a3 100644
--- a/fs/xfs/libxfs/xfs_dquot_buf.c
+++ b/fs/xfs/libxfs/xfs_dquot_buf.c
@@ -35,10 +35,10 @@ xfs_calc_dquots_per_chunk(
xfs_failaddr_t
xfs_dquot_verify(
- struct xfs_mount *mp,
- xfs_disk_dquot_t *ddq,
- xfs_dqid_t id,
- uint type) /* used only during quotacheck */
+ struct xfs_mount *mp,
+ struct xfs_disk_dquot *ddq,
+ xfs_dqid_t id,
+ uint type) /* used only during quotacheck */
{
/*
* We can encounter an uninitialized dquot buffer for 2 reasons:
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index c968b60cee15..4cae17f35e94 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -1144,11 +1144,11 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
/*
* This is the main portion of the on-disk representation of quota
- * information for a user. This is the q_core of the xfs_dquot_t that
+ * information for a user. This is the q_core of the struct xfs_dquot that
* is kept in kernel memory. We pad this with some more expansion room
* to construct the on disk structure.
*/
-typedef struct xfs_disk_dquot {
+struct xfs_disk_dquot {
__be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
__u8 d_version; /* dquot version */
__u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */
@@ -1171,15 +1171,15 @@ typedef struct xfs_disk_dquot {
__be32 d_rtbtimer; /* similar to above; for RT disk blocks */
__be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */
__be16 d_pad;
-} xfs_disk_dquot_t;
+};
/*
* This is what goes on disk. This is separated from the xfs_disk_dquot because
* carrying the unnecessary padding would be a waste of memory.
*/
typedef struct xfs_dqblk {
- xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */
- char dd_fill[4]; /* filling for posterity */
+ struct xfs_disk_dquot dd_diskdq; /* portion living incore as well */
+ char dd_fill[4];/* filling for posterity */
/*
* These two are only present on filesystems with the CRC bits set.
diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
index d12bbd526e7c..271cca13565b 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.c
+++ b/fs/xfs/libxfs/xfs_trans_resv.c
@@ -718,7 +718,6 @@ xfs_calc_clear_agi_bucket_reservation(
/*
* Adjusting quota limits.
- * the xfs_disk_dquot_t: sizeof(struct xfs_disk_dquot)
*/
STATIC uint
xfs_calc_qm_setqlim_reservation(void)
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index bcd4247b5014..edf0e81b3a10 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -48,7 +48,7 @@ static struct lock_class_key xfs_dquot_project_class;
*/
void
xfs_qm_dqdestroy(
- xfs_dquot_t *dqp)
+ struct xfs_dquot *dqp)
{
ASSERT(list_empty(&dqp->q_lru));
@@ -114,7 +114,7 @@ xfs_qm_adjust_dqlimits(
void
xfs_qm_adjust_dqtimers(
xfs_mount_t *mp,
- xfs_disk_dquot_t *d)
+ struct xfs_disk_dquot *d)
{
ASSERT(d->d_id);
@@ -497,7 +497,7 @@ xfs_dquot_from_disk(
struct xfs_disk_dquot *ddqp = bp->b_addr + dqp->q_bufoffset;
/* copy everything from disk dquot to the incore dquot */
- memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t));
+ memcpy(&dqp->q_core, ddqp, sizeof(struct xfs_disk_dquot));
/*
* Reservation counters are defined as reservation plus current usage
@@ -989,7 +989,7 @@ xfs_qm_dqput(
*/
void
xfs_qm_dqrele(
- xfs_dquot_t *dqp)
+ struct xfs_dquot *dqp)
{
if (!dqp)
return;
@@ -1130,7 +1130,7 @@ xfs_qm_dqflush(
}
/* This is the only portion of data that needs to persist */
- memcpy(ddqp, &dqp->q_core, sizeof(xfs_disk_dquot_t));
+ memcpy(ddqp, &dqp->q_core, sizeof(struct xfs_disk_dquot));
/*
* Clear the dirty field and remember the flush lsn for later use.
diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
index 4fe85709d55d..7a580dd09a76 100644
--- a/fs/xfs/xfs_dquot.h
+++ b/fs/xfs/xfs_dquot.h
@@ -39,7 +39,7 @@ typedef struct xfs_dquot {
int q_bufoffset; /* off of dq in buffer (# dquots) */
xfs_fileoff_t q_fileoffset; /* offset in quotas file */
- xfs_disk_dquot_t q_core; /* actual usage & quotas */
+ struct xfs_disk_dquot q_core; /* actual usage & quotas */
xfs_dq_logitem_t q_logitem; /* dquot log item */
xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */
xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */
@@ -49,14 +49,14 @@ typedef struct xfs_dquot {
int64_t q_low_space[XFS_QLOWSP_MAX];
struct mutex q_qlock; /* quota lock */
struct completion q_flush; /* flush completion queue */
- atomic_t q_pincount; /* dquot pin count */
+ atomic_t q_pincount; /* dquot pin count */
wait_queue_head_t q_pinwait; /* dquot pinning wait queue */
} xfs_dquot_t;
/*
* Lock hierarchy for q_qlock:
* XFS_QLOCK_NORMAL is the implicit default,
- * XFS_QLOCK_NESTED is the dquot with the higher id in xfs_dqlock2
+ * XFS_QLOCK_NESTED is the dquot with the higher id in xfs_dqlock2
*/
enum {
XFS_QLOCK_NORMAL = 0,
@@ -151,7 +151,7 @@ extern void xfs_qm_dqdestroy(xfs_dquot_t *);
extern int xfs_qm_dqflush(struct xfs_dquot *, struct xfs_buf **);
extern void xfs_qm_dqunpin_wait(xfs_dquot_t *);
extern void xfs_qm_adjust_dqtimers(xfs_mount_t *,
- xfs_disk_dquot_t *);
+ struct xfs_disk_dquot *);
extern void xfs_qm_adjust_dqlimits(struct xfs_mount *,
struct xfs_dquot *);
extern xfs_dqid_t xfs_qm_id_for_quotatype(struct xfs_inode *ip,
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index c1a514ffff55..afb0ec772bdd 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2576,6 +2576,7 @@ xlog_recover_do_reg_buffer(
int bit;
int nbits;
xfs_failaddr_t fa;
+ const size_t size_disk_dquot = sizeof(struct xfs_disk_dquot);
trace_xfs_log_recover_buf_reg_buf(mp->m_log, buf_f);
@@ -2618,7 +2619,7 @@ xlog_recover_do_reg_buffer(
"XFS: NULL dquot in %s.", __func__);
goto next;
}
- if (item->ri_buf[i].i_len < sizeof(xfs_disk_dquot_t)) {
+ if (item->ri_buf[i].i_len < size_disk_dquot) {
xfs_alert(mp,
"XFS: dquot too small (%d) in %s.",
item->ri_buf[i].i_len, __func__);
@@ -3249,7 +3250,7 @@ xlog_recover_dquot_pass2(
xfs_alert(log->l_mp, "NULL dquot in %s.", __func__);
return -EIO;
}
- if (item->ri_buf[1].i_len < sizeof(xfs_disk_dquot_t)) {
+ if (item->ri_buf[1].i_len < sizeof(struct xfs_disk_dquot)) {
xfs_alert(log->l_mp, "dquot too small (%d) in %s.",
item->ri_buf[1].i_len, __func__);
return -EIO;
--
2.23.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/5] xfs: remove the xfs_dquot_t typedef
2019-11-07 11:35 [PATCH 0/5] xfs: remove several typedefs in quota code Pavel Reichl
2019-11-07 11:35 ` [PATCH 1/5] xfs: remove the xfs_disk_dquot_t typedef Pavel Reichl
@ 2019-11-07 11:35 ` Pavel Reichl
2019-11-07 22:31 ` Darrick J. Wong
2019-11-07 11:35 ` [PATCH 3/5] xfs: remove the xfs_quotainfo_t typedef Pavel Reichl
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Pavel Reichl @ 2019-11-07 11:35 UTC (permalink / raw)
To: linux-xfs; +Cc: Pavel Reichl
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
fs/xfs/xfs_dquot.c | 6 +++---
fs/xfs/xfs_dquot.h | 21 +++++++++++----------
fs/xfs/xfs_qm.c | 28 ++++++++++++++--------------
fs/xfs/xfs_qm_bhv.c | 2 +-
fs/xfs/xfs_trans_dquot.c | 38 +++++++++++++++++++-------------------
5 files changed, 48 insertions(+), 47 deletions(-)
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index edf0e81b3a10..04e38ed97f5f 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -1019,7 +1019,7 @@ xfs_qm_dqflush_done(
struct xfs_log_item *lip)
{
xfs_dq_logitem_t *qip = (struct xfs_dq_logitem *)lip;
- xfs_dquot_t *dqp = qip->qli_dquot;
+ struct xfs_dquot *dqp = qip->qli_dquot;
struct xfs_ail *ailp = lip->li_ailp;
/*
@@ -1188,8 +1188,8 @@ xfs_qm_dqflush(
*/
void
xfs_dqlock2(
- xfs_dquot_t *d1,
- xfs_dquot_t *d2)
+ struct xfs_dquot *d1,
+ struct xfs_dquot *d2)
{
if (d1 && d2) {
ASSERT(d1 != d2);
diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
index 7a580dd09a76..330ba888e74a 100644
--- a/fs/xfs/xfs_dquot.h
+++ b/fs/xfs/xfs_dquot.h
@@ -30,7 +30,7 @@ enum {
/*
* The incore dquot structure
*/
-typedef struct xfs_dquot {
+struct xfs_dquot {
uint dq_flags; /* various flags (XFS_DQ_*) */
struct list_head q_lru; /* global free list of dquots */
struct xfs_mount*q_mount; /* filesystem this relates to */
@@ -51,7 +51,7 @@ typedef struct xfs_dquot {
struct completion q_flush; /* flush completion queue */
atomic_t q_pincount; /* dquot pin count */
wait_queue_head_t q_pinwait; /* dquot pinning wait queue */
-} xfs_dquot_t;
+};
/*
* Lock hierarchy for q_qlock:
@@ -68,17 +68,17 @@ enum {
* queue synchronizes processes attempting to flush the in-core dquot back to
* disk.
*/
-static inline void xfs_dqflock(xfs_dquot_t *dqp)
+static inline void xfs_dqflock(struct xfs_dquot *dqp)
{
wait_for_completion(&dqp->q_flush);
}
-static inline bool xfs_dqflock_nowait(xfs_dquot_t *dqp)
+static inline bool xfs_dqflock_nowait(struct xfs_dquot *dqp)
{
return try_wait_for_completion(&dqp->q_flush);
}
-static inline void xfs_dqfunlock(xfs_dquot_t *dqp)
+static inline void xfs_dqfunlock(struct xfs_dquot *dqp)
{
complete(&dqp->q_flush);
}
@@ -112,7 +112,7 @@ static inline int xfs_this_quota_on(struct xfs_mount *mp, int type)
}
}
-static inline xfs_dquot_t *xfs_inode_dquot(struct xfs_inode *ip, int type)
+static inline struct xfs_dquot *xfs_inode_dquot(struct xfs_inode *ip, int type)
{
switch (type & XFS_DQ_ALLTYPES) {
case XFS_DQ_USER:
@@ -147,9 +147,10 @@ static inline bool xfs_dquot_lowsp(struct xfs_dquot *dqp)
#define XFS_QM_ISPDQ(dqp) ((dqp)->dq_flags & XFS_DQ_PROJ)
#define XFS_QM_ISGDQ(dqp) ((dqp)->dq_flags & XFS_DQ_GROUP)
-extern void xfs_qm_dqdestroy(xfs_dquot_t *);
-extern int xfs_qm_dqflush(struct xfs_dquot *, struct xfs_buf **);
-extern void xfs_qm_dqunpin_wait(xfs_dquot_t *);
+extern void xfs_qm_dqdestroy(struct xfs_dquot *dqp);
+extern int xfs_qm_dqflush(struct xfs_dquot *dqp,
+ struct xfs_buf **bpp);
+extern void xfs_qm_dqunpin_wait(struct xfs_dquot *dqp);
extern void xfs_qm_adjust_dqtimers(xfs_mount_t *,
struct xfs_disk_dquot *);
extern void xfs_qm_adjust_dqlimits(struct xfs_mount *,
@@ -167,7 +168,7 @@ extern int xfs_qm_dqget_next(struct xfs_mount *mp, xfs_dqid_t id,
extern int xfs_qm_dqget_uncached(struct xfs_mount *mp,
xfs_dqid_t id, uint type,
struct xfs_dquot **dqpp);
-extern void xfs_qm_dqput(xfs_dquot_t *);
+extern void xfs_qm_dqput(struct xfs_dquot *dqp);
extern void xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *);
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index ecd8ce152ab1..a8b278348f5a 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -243,14 +243,14 @@ xfs_qm_unmount_quotas(
STATIC int
xfs_qm_dqattach_one(
- xfs_inode_t *ip,
- xfs_dqid_t id,
- uint type,
- bool doalloc,
- xfs_dquot_t **IO_idqpp)
+ xfs_inode_t *ip,
+ xfs_dqid_t id,
+ uint type,
+ bool doalloc,
+ struct xfs_dquot **IO_idqpp)
{
- xfs_dquot_t *dqp;
- int error;
+ struct xfs_dquot *dqp;
+ int error;
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
error = 0;
@@ -543,7 +543,7 @@ xfs_qm_set_defquota(
uint type,
xfs_quotainfo_t *qinf)
{
- xfs_dquot_t *dqp;
+ struct xfs_dquot *dqp;
struct xfs_def_quota *defq;
struct xfs_disk_dquot *ddqp;
int error;
@@ -1737,14 +1737,14 @@ xfs_qm_vop_dqalloc(
* Actually transfer ownership, and do dquot modifications.
* These were already reserved.
*/
-xfs_dquot_t *
+struct xfs_dquot *
xfs_qm_vop_chown(
- xfs_trans_t *tp,
- xfs_inode_t *ip,
- xfs_dquot_t **IO_olddq,
- xfs_dquot_t *newdq)
+ xfs_trans_t *tp,
+ xfs_inode_t *ip,
+ struct xfs_dquot **IO_olddq,
+ struct xfs_dquot *newdq)
{
- xfs_dquot_t *prevdq;
+ struct xfs_dquot *prevdq;
uint bfield = XFS_IS_REALTIME_INODE(ip) ?
XFS_TRANS_DQ_RTBCOUNT : XFS_TRANS_DQ_BCOUNT;
diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
index 5d72e88598b4..1830f52d5975 100644
--- a/fs/xfs/xfs_qm_bhv.c
+++ b/fs/xfs/xfs_qm_bhv.c
@@ -58,7 +58,7 @@ xfs_qm_statvfs(
struct kstatfs *statp)
{
xfs_mount_t *mp = ip->i_mount;
- xfs_dquot_t *dqp;
+ struct xfs_dquot *dqp;
if (!xfs_qm_dqget(mp, xfs_get_projid(ip), XFS_DQ_PROJ, false, &dqp)) {
xfs_fill_statvfs_from_dquot(statp, dqp);
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
index 16457465833b..ceb25d1cfdb1 100644
--- a/fs/xfs/xfs_trans_dquot.c
+++ b/fs/xfs/xfs_trans_dquot.c
@@ -25,8 +25,8 @@ STATIC void xfs_trans_alloc_dqinfo(xfs_trans_t *);
*/
void
xfs_trans_dqjoin(
- xfs_trans_t *tp,
- xfs_dquot_t *dqp)
+ xfs_trans_t *tp,
+ struct xfs_dquot *dqp)
{
ASSERT(XFS_DQ_IS_LOCKED(dqp));
ASSERT(dqp->q_logitem.qli_dquot == dqp);
@@ -49,8 +49,8 @@ xfs_trans_dqjoin(
*/
void
xfs_trans_log_dquot(
- xfs_trans_t *tp,
- xfs_dquot_t *dqp)
+ xfs_trans_t *tp,
+ struct xfs_dquot *dqp)
{
ASSERT(XFS_DQ_IS_LOCKED(dqp));
@@ -489,7 +489,7 @@ xfs_trans_unreserve_and_mod_dquots(
xfs_trans_t *tp)
{
int i, j;
- xfs_dquot_t *dqp;
+ struct xfs_dquot *dqp;
struct xfs_dqtrx *qtrx, *qa;
bool locked;
@@ -571,21 +571,21 @@ xfs_quota_warn(
*/
STATIC int
xfs_trans_dqresv(
- xfs_trans_t *tp,
- xfs_mount_t *mp,
- xfs_dquot_t *dqp,
- int64_t nblks,
- long ninos,
- uint flags)
+ xfs_trans_t *tp,
+ xfs_mount_t *mp,
+ struct xfs_dquot *dqp,
+ int64_t nblks,
+ long ninos,
+ uint flags)
{
- xfs_qcnt_t hardlimit;
- xfs_qcnt_t softlimit;
- time_t timer;
- xfs_qwarncnt_t warns;
- xfs_qwarncnt_t warnlimit;
- xfs_qcnt_t total_count;
- xfs_qcnt_t *resbcountp;
- xfs_quotainfo_t *q = mp->m_quotainfo;
+ xfs_qcnt_t hardlimit;
+ xfs_qcnt_t softlimit;
+ time_t timer;
+ xfs_qwarncnt_t warns;
+ xfs_qwarncnt_t warnlimit;
+ xfs_qcnt_t total_count;
+ xfs_qcnt_t *resbcountp;
+ xfs_quotainfo_t *q = mp->m_quotainfo;
struct xfs_def_quota *defq;
--
2.23.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/5] xfs: remove the xfs_quotainfo_t typedef
2019-11-07 11:35 [PATCH 0/5] xfs: remove several typedefs in quota code Pavel Reichl
2019-11-07 11:35 ` [PATCH 1/5] xfs: remove the xfs_disk_dquot_t typedef Pavel Reichl
2019-11-07 11:35 ` [PATCH 2/5] xfs: remove the xfs_dquot_t typedef Pavel Reichl
@ 2019-11-07 11:35 ` Pavel Reichl
2019-11-08 0:19 ` Darrick J. Wong
2019-11-07 11:35 ` [PATCH 4/5] xfs: remove the xfs_dq_logitem_t typedef Pavel Reichl
2019-11-07 11:35 ` [PATCH 5/5] xfs: remove the xfs_qoff_logitem_t typedef Pavel Reichl
4 siblings, 1 reply; 11+ messages in thread
From: Pavel Reichl @ 2019-11-07 11:35 UTC (permalink / raw)
To: linux-xfs; +Cc: Pavel Reichl
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
fs/xfs/xfs_qm.c | 14 +++++++-------
fs/xfs/xfs_qm.h | 4 ++--
fs/xfs/xfs_trans_dquot.c | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index a8b278348f5a..4088273adb11 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -32,7 +32,7 @@
STATIC int xfs_qm_init_quotainos(xfs_mount_t *);
STATIC int xfs_qm_init_quotainfo(xfs_mount_t *);
-STATIC void xfs_qm_destroy_quotainos(xfs_quotainfo_t *qi);
+STATIC void xfs_qm_destroy_quotainos(struct xfs_quotainfo *qi);
STATIC void xfs_qm_dqfree_one(struct xfs_dquot *dqp);
/*
* We use the batch lookup interface to iterate over the dquots as it
@@ -539,9 +539,9 @@ xfs_qm_shrink_count(
STATIC void
xfs_qm_set_defquota(
- xfs_mount_t *mp,
- uint type,
- xfs_quotainfo_t *qinf)
+ xfs_mount_t *mp,
+ uint type,
+ struct xfs_quotainfo *qinf)
{
struct xfs_dquot *dqp;
struct xfs_def_quota *defq;
@@ -642,7 +642,7 @@ xfs_qm_init_quotainfo(
ASSERT(XFS_IS_QUOTA_RUNNING(mp));
- qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), 0);
+ qinf = mp->m_quotainfo = kmem_zalloc(sizeof(struct xfs_quotainfo), 0);
error = list_lru_init(&qinf->qi_lru);
if (error)
@@ -711,7 +711,7 @@ void
xfs_qm_destroy_quotainfo(
xfs_mount_t *mp)
{
- xfs_quotainfo_t *qi;
+ struct xfs_quotainfo *qi;
qi = mp->m_quotainfo;
ASSERT(qi != NULL);
@@ -1559,7 +1559,7 @@ xfs_qm_init_quotainos(
STATIC void
xfs_qm_destroy_quotainos(
- xfs_quotainfo_t *qi)
+ struct xfs_quotainfo *qi)
{
if (qi->qi_uquotaip) {
xfs_irele(qi->qi_uquotaip);
diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
index b41b75089548..185c9d89a5cd 100644
--- a/fs/xfs/xfs_qm.h
+++ b/fs/xfs/xfs_qm.h
@@ -54,7 +54,7 @@ struct xfs_def_quota {
* Various quota information for individual filesystems.
* The mount structure keeps a pointer to this.
*/
-typedef struct xfs_quotainfo {
+struct xfs_quotainfo {
struct radix_tree_root qi_uquota_tree;
struct radix_tree_root qi_gquota_tree;
struct radix_tree_root qi_pquota_tree;
@@ -77,7 +77,7 @@ typedef struct xfs_quotainfo {
struct xfs_def_quota qi_grp_default;
struct xfs_def_quota qi_prj_default;
struct shrinker qi_shrinker;
-} xfs_quotainfo_t;
+};
static inline struct radix_tree_root *
xfs_dquot_tree(
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
index ceb25d1cfdb1..4789f7e11f53 100644
--- a/fs/xfs/xfs_trans_dquot.c
+++ b/fs/xfs/xfs_trans_dquot.c
@@ -585,7 +585,7 @@ xfs_trans_dqresv(
xfs_qwarncnt_t warnlimit;
xfs_qcnt_t total_count;
xfs_qcnt_t *resbcountp;
- xfs_quotainfo_t *q = mp->m_quotainfo;
+ struct xfs_quotainfo *q = mp->m_quotainfo;
struct xfs_def_quota *defq;
--
2.23.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/5] xfs: remove the xfs_dq_logitem_t typedef
2019-11-07 11:35 [PATCH 0/5] xfs: remove several typedefs in quota code Pavel Reichl
` (2 preceding siblings ...)
2019-11-07 11:35 ` [PATCH 3/5] xfs: remove the xfs_quotainfo_t typedef Pavel Reichl
@ 2019-11-07 11:35 ` Pavel Reichl
2019-11-08 0:20 ` Darrick J. Wong
2019-11-07 11:35 ` [PATCH 5/5] xfs: remove the xfs_qoff_logitem_t typedef Pavel Reichl
4 siblings, 1 reply; 11+ messages in thread
From: Pavel Reichl @ 2019-11-07 11:35 UTC (permalink / raw)
To: linux-xfs; +Cc: Pavel Reichl
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
fs/xfs/xfs_dquot.c | 2 +-
fs/xfs/xfs_dquot.h | 4 ++--
fs/xfs/xfs_dquot_item.h | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 04e38ed97f5f..209d5e4b5850 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -1018,7 +1018,7 @@ xfs_qm_dqflush_done(
struct xfs_buf *bp,
struct xfs_log_item *lip)
{
- xfs_dq_logitem_t *qip = (struct xfs_dq_logitem *)lip;
+ struct xfs_dq_logitem *qip = (struct xfs_dq_logitem *)lip;
struct xfs_dquot *dqp = qip->qli_dquot;
struct xfs_ail *ailp = lip->li_ailp;
diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
index 330ba888e74a..f1e7cc6a383f 100644
--- a/fs/xfs/xfs_dquot.h
+++ b/fs/xfs/xfs_dquot.h
@@ -39,8 +39,8 @@ struct xfs_dquot {
int q_bufoffset; /* off of dq in buffer (# dquots) */
xfs_fileoff_t q_fileoffset; /* offset in quotas file */
- struct xfs_disk_dquot q_core; /* actual usage & quotas */
- xfs_dq_logitem_t q_logitem; /* dquot log item */
+ struct xfs_disk_dquot q_core; /* actual usage & quotas */
+ struct xfs_dq_logitem q_logitem; /* dquot log item */
xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */
xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */
xfs_qcnt_t q_res_rtbcount;/* total realtime blks used+reserved */
diff --git a/fs/xfs/xfs_dquot_item.h b/fs/xfs/xfs_dquot_item.h
index 1aed34ccdabc..e0a24eb7a545 100644
--- a/fs/xfs/xfs_dquot_item.h
+++ b/fs/xfs/xfs_dquot_item.h
@@ -11,11 +11,11 @@ struct xfs_trans;
struct xfs_mount;
struct xfs_qoff_logitem;
-typedef struct xfs_dq_logitem {
+struct xfs_dq_logitem {
struct xfs_log_item qli_item; /* common portion */
struct xfs_dquot *qli_dquot; /* dquot ptr */
xfs_lsn_t qli_flush_lsn; /* lsn at last flush */
-} xfs_dq_logitem_t;
+};
typedef struct xfs_qoff_logitem {
struct xfs_log_item qql_item; /* common portion */
--
2.23.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/5] xfs: remove the xfs_qoff_logitem_t typedef
2019-11-07 11:35 [PATCH 0/5] xfs: remove several typedefs in quota code Pavel Reichl
` (3 preceding siblings ...)
2019-11-07 11:35 ` [PATCH 4/5] xfs: remove the xfs_dq_logitem_t typedef Pavel Reichl
@ 2019-11-07 11:35 ` Pavel Reichl
2019-11-08 0:20 ` Darrick J. Wong
4 siblings, 1 reply; 11+ messages in thread
From: Pavel Reichl @ 2019-11-07 11:35 UTC (permalink / raw)
To: linux-xfs; +Cc: Pavel Reichl
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
fs/xfs/libxfs/xfs_trans_resv.c | 4 ++--
fs/xfs/xfs_dquot_item.h | 14 ++++++++------
fs/xfs/xfs_qm_syscalls.c | 20 ++++++++++----------
fs/xfs/xfs_trans_dquot.c | 8 ++++----
4 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
index 271cca13565b..eb7fe42b1d61 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.c
+++ b/fs/xfs/libxfs/xfs_trans_resv.c
@@ -741,7 +741,7 @@ xfs_calc_qm_dqalloc_reservation(
/*
* Turning off quotas.
- * the xfs_qoff_logitem_t: sizeof(struct xfs_qoff_logitem) * 2
+ * sizeof(struct xfs_qoff_logitem) * 2
* the superblock for the quota flags: sector size
*/
STATIC uint
@@ -754,7 +754,7 @@ xfs_calc_qm_quotaoff_reservation(
/*
* End of turning off quotas.
- * the xfs_qoff_logitem_t: sizeof(struct xfs_qoff_logitem) * 2
+ * sizeof(struct xfs_qoff_logitem) * 2
*/
STATIC uint
xfs_calc_qm_quotaoff_end_reservation(void)
diff --git a/fs/xfs/xfs_dquot_item.h b/fs/xfs/xfs_dquot_item.h
index e0a24eb7a545..e2348a99fa1a 100644
--- a/fs/xfs/xfs_dquot_item.h
+++ b/fs/xfs/xfs_dquot_item.h
@@ -17,18 +17,20 @@ struct xfs_dq_logitem {
xfs_lsn_t qli_flush_lsn; /* lsn at last flush */
};
-typedef struct xfs_qoff_logitem {
+struct xfs_qoff_logitem {
struct xfs_log_item qql_item; /* common portion */
struct xfs_qoff_logitem *qql_start_lip; /* qoff-start logitem, if any */
unsigned int qql_flags;
-} xfs_qoff_logitem_t;
+};
extern void xfs_qm_dquot_logitem_init(struct xfs_dquot *);
-extern xfs_qoff_logitem_t *xfs_qm_qoff_logitem_init(struct xfs_mount *,
- struct xfs_qoff_logitem *, uint);
-extern xfs_qoff_logitem_t *xfs_trans_get_qoff_item(struct xfs_trans *,
- struct xfs_qoff_logitem *, uint);
+extern struct xfs_qoff_logitem *xfs_qm_qoff_logitem_init(struct xfs_mount *mp,
+ struct xfs_qoff_logitem *start,
+ uint flags);
+extern struct xfs_qoff_logitem *xfs_trans_get_qoff_item(struct xfs_trans *tp,
+ struct xfs_qoff_logitem *startqoff,
+ uint flags);
extern void xfs_trans_log_quotaoff_item(struct xfs_trans *,
struct xfs_qoff_logitem *);
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index da7ad0383037..72b476e80ab2 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -19,9 +19,9 @@
#include "xfs_qm.h"
#include "xfs_icache.h"
-STATIC int xfs_qm_log_quotaoff(xfs_mount_t *, xfs_qoff_logitem_t **, uint);
-STATIC int xfs_qm_log_quotaoff_end(xfs_mount_t *, xfs_qoff_logitem_t *,
- uint);
+STATIC int xfs_qm_log_quotaoff(xfs_mount_t *, struct xfs_qoff_logitem **, uint);
+STATIC int xfs_qm_log_quotaoff_end(xfs_mount_t *, struct xfs_qoff_logitem *,
+ uint);
/*
* Turn off quota accounting and/or enforcement for all udquots and/or
@@ -40,7 +40,7 @@ xfs_qm_scall_quotaoff(
uint dqtype;
int error;
uint inactivate_flags;
- xfs_qoff_logitem_t *qoffstart;
+ struct xfs_qoff_logitem *qoffstart;
/*
* No file system can have quotas enabled on disk but not in core.
@@ -541,12 +541,12 @@ xfs_qm_scall_setqlim(
STATIC int
xfs_qm_log_quotaoff_end(
xfs_mount_t *mp,
- xfs_qoff_logitem_t *startqoff,
+ struct xfs_qoff_logitem *startqoff,
uint flags)
{
xfs_trans_t *tp;
int error;
- xfs_qoff_logitem_t *qoffi;
+ struct xfs_qoff_logitem *qoffi;
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_equotaoff, 0, 0, 0, &tp);
if (error)
@@ -569,12 +569,12 @@ xfs_qm_log_quotaoff_end(
STATIC int
xfs_qm_log_quotaoff(
xfs_mount_t *mp,
- xfs_qoff_logitem_t **qoffstartp,
+ struct xfs_qoff_logitem **qoffstartp,
uint flags)
{
- xfs_trans_t *tp;
- int error;
- xfs_qoff_logitem_t *qoffi;
+ xfs_trans_t *tp;
+ int error;
+ struct xfs_qoff_logitem *qoffi;
*qoffstartp = NULL;
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
index 4789f7e11f53..8b6f328f83d5 100644
--- a/fs/xfs/xfs_trans_dquot.c
+++ b/fs/xfs/xfs_trans_dquot.c
@@ -824,13 +824,13 @@ xfs_trans_reserve_quota_nblks(
/*
* This routine is called to allocate a quotaoff log item.
*/
-xfs_qoff_logitem_t *
+struct xfs_qoff_logitem *
xfs_trans_get_qoff_item(
xfs_trans_t *tp,
- xfs_qoff_logitem_t *startqoff,
+ struct xfs_qoff_logitem *startqoff,
uint flags)
{
- xfs_qoff_logitem_t *q;
+ struct xfs_qoff_logitem *q;
ASSERT(tp != NULL);
@@ -853,7 +853,7 @@ xfs_trans_get_qoff_item(
void
xfs_trans_log_quotaoff_item(
xfs_trans_t *tp,
- xfs_qoff_logitem_t *qlp)
+ struct xfs_qoff_logitem *qlp)
{
tp->t_flags |= XFS_TRANS_DIRTY;
set_bit(XFS_LI_DIRTY, &qlp->qql_item.li_flags);
--
2.23.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/5] xfs: remove the xfs_disk_dquot_t typedef
2019-11-07 11:35 ` [PATCH 1/5] xfs: remove the xfs_disk_dquot_t typedef Pavel Reichl
@ 2019-11-07 22:02 ` Darrick J. Wong
0 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2019-11-07 22:02 UTC (permalink / raw)
To: Pavel Reichl; +Cc: linux-xfs
On Thu, Nov 07, 2019 at 12:35:45PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
> fs/xfs/libxfs/xfs_dquot_buf.c | 8 ++++----
> fs/xfs/libxfs/xfs_format.h | 10 +++++-----
> fs/xfs/libxfs/xfs_trans_resv.c | 1 -
> fs/xfs/xfs_dquot.c | 10 +++++-----
> fs/xfs/xfs_dquot.h | 8 ++++----
> fs/xfs/xfs_log_recover.c | 5 +++--
> 6 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_dquot_buf.c b/fs/xfs/libxfs/xfs_dquot_buf.c
> index e8bd688a4073..67baed82f6a3 100644
> --- a/fs/xfs/libxfs/xfs_dquot_buf.c
> +++ b/fs/xfs/libxfs/xfs_dquot_buf.c
> @@ -35,10 +35,10 @@ xfs_calc_dquots_per_chunk(
>
> xfs_failaddr_t
> xfs_dquot_verify(
> - struct xfs_mount *mp,
> - xfs_disk_dquot_t *ddq,
> - xfs_dqid_t id,
> - uint type) /* used only during quotacheck */
> + struct xfs_mount *mp,
> + struct xfs_disk_dquot *ddq,
> + xfs_dqid_t id,
> + uint type) /* used only during quotacheck */
> {
> /*
> * We can encounter an uninitialized dquot buffer for 2 reasons:
> diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
> index c968b60cee15..4cae17f35e94 100644
> --- a/fs/xfs/libxfs/xfs_format.h
> +++ b/fs/xfs/libxfs/xfs_format.h
> @@ -1144,11 +1144,11 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
>
> /*
> * This is the main portion of the on-disk representation of quota
> - * information for a user. This is the q_core of the xfs_dquot_t that
> + * information for a user. This is the q_core of the struct xfs_dquot that
> * is kept in kernel memory. We pad this with some more expansion room
> * to construct the on disk structure.
> */
> -typedef struct xfs_disk_dquot {
> +struct xfs_disk_dquot {
> __be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
> __u8 d_version; /* dquot version */
> __u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */
> @@ -1171,15 +1171,15 @@ typedef struct xfs_disk_dquot {
> __be32 d_rtbtimer; /* similar to above; for RT disk blocks */
> __be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */
> __be16 d_pad;
> -} xfs_disk_dquot_t;
> +};
>
> /*
> * This is what goes on disk. This is separated from the xfs_disk_dquot because
> * carrying the unnecessary padding would be a waste of memory.
> */
> typedef struct xfs_dqblk {
> - xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */
> - char dd_fill[4]; /* filling for posterity */
> + struct xfs_disk_dquot dd_diskdq; /* portion living incore as well */
> + char dd_fill[4];/* filling for posterity */
>
> /*
> * These two are only present on filesystems with the CRC bits set.
> diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
> index d12bbd526e7c..271cca13565b 100644
> --- a/fs/xfs/libxfs/xfs_trans_resv.c
> +++ b/fs/xfs/libxfs/xfs_trans_resv.c
> @@ -718,7 +718,6 @@ xfs_calc_clear_agi_bucket_reservation(
>
> /*
> * Adjusting quota limits.
> - * the xfs_disk_dquot_t: sizeof(struct xfs_disk_dquot)
> */
> STATIC uint
> xfs_calc_qm_setqlim_reservation(void)
> diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
> index bcd4247b5014..edf0e81b3a10 100644
> --- a/fs/xfs/xfs_dquot.c
> +++ b/fs/xfs/xfs_dquot.c
> @@ -48,7 +48,7 @@ static struct lock_class_key xfs_dquot_project_class;
> */
> void
> xfs_qm_dqdestroy(
> - xfs_dquot_t *dqp)
> + struct xfs_dquot *dqp)
> {
> ASSERT(list_empty(&dqp->q_lru));
>
> @@ -114,7 +114,7 @@ xfs_qm_adjust_dqlimits(
> void
> xfs_qm_adjust_dqtimers(
> xfs_mount_t *mp,
So long as you're changing the parameter list, could you please
de-typedef the other parameters too? e.g.
struct xfs_mount *mp,
Our general practice is to clean out all the struct typedefs any time we
touch a clumb of variable declarations or parameters.
(Earlier I was thinking that I might let that slide on the off chance you
were going to follow this up with more struct-typedef removal patches
but then realized there are 119 typedefs even after this series, and
that's too painful to do all at once. :)
> - xfs_disk_dquot_t *d)
> + struct xfs_disk_dquot *d)
> {
> ASSERT(d->d_id);
>
> @@ -497,7 +497,7 @@ xfs_dquot_from_disk(
> struct xfs_disk_dquot *ddqp = bp->b_addr + dqp->q_bufoffset;
>
> /* copy everything from disk dquot to the incore dquot */
> - memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t));
> + memcpy(&dqp->q_core, ddqp, sizeof(struct xfs_disk_dquot));
>
> /*
> * Reservation counters are defined as reservation plus current usage
> @@ -989,7 +989,7 @@ xfs_qm_dqput(
> */
> void
> xfs_qm_dqrele(
> - xfs_dquot_t *dqp)
> + struct xfs_dquot *dqp)
> {
> if (!dqp)
> return;
> @@ -1130,7 +1130,7 @@ xfs_qm_dqflush(
> }
>
> /* This is the only portion of data that needs to persist */
> - memcpy(ddqp, &dqp->q_core, sizeof(xfs_disk_dquot_t));
> + memcpy(ddqp, &dqp->q_core, sizeof(struct xfs_disk_dquot));
>
> /*
> * Clear the dirty field and remember the flush lsn for later use.
> diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
> index 4fe85709d55d..7a580dd09a76 100644
> --- a/fs/xfs/xfs_dquot.h
> +++ b/fs/xfs/xfs_dquot.h
> @@ -39,7 +39,7 @@ typedef struct xfs_dquot {
> int q_bufoffset; /* off of dq in buffer (# dquots) */
> xfs_fileoff_t q_fileoffset; /* offset in quotas file */
>
> - xfs_disk_dquot_t q_core; /* actual usage & quotas */
> + struct xfs_disk_dquot q_core; /* actual usage & quotas */
> xfs_dq_logitem_t q_logitem; /* dquot log item */
> xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */
> xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */
> @@ -49,14 +49,14 @@ typedef struct xfs_dquot {
> int64_t q_low_space[XFS_QLOWSP_MAX];
> struct mutex q_qlock; /* quota lock */
> struct completion q_flush; /* flush completion queue */
> - atomic_t q_pincount; /* dquot pin count */
> + atomic_t q_pincount; /* dquot pin count */
If you're going to fix the indentation of the other fields, please fix
everything to line up again. (Or leave the other fields alone...)
The rest looks ok though. :)
--D
> wait_queue_head_t q_pinwait; /* dquot pinning wait queue */
> } xfs_dquot_t;
>
> /*
> * Lock hierarchy for q_qlock:
> * XFS_QLOCK_NORMAL is the implicit default,
> - * XFS_QLOCK_NESTED is the dquot with the higher id in xfs_dqlock2
> + * XFS_QLOCK_NESTED is the dquot with the higher id in xfs_dqlock2
> */
> enum {
> XFS_QLOCK_NORMAL = 0,
> @@ -151,7 +151,7 @@ extern void xfs_qm_dqdestroy(xfs_dquot_t *);
> extern int xfs_qm_dqflush(struct xfs_dquot *, struct xfs_buf **);
> extern void xfs_qm_dqunpin_wait(xfs_dquot_t *);
> extern void xfs_qm_adjust_dqtimers(xfs_mount_t *,
> - xfs_disk_dquot_t *);
> + struct xfs_disk_dquot *);
> extern void xfs_qm_adjust_dqlimits(struct xfs_mount *,
> struct xfs_dquot *);
> extern xfs_dqid_t xfs_qm_id_for_quotatype(struct xfs_inode *ip,
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index c1a514ffff55..afb0ec772bdd 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -2576,6 +2576,7 @@ xlog_recover_do_reg_buffer(
> int bit;
> int nbits;
> xfs_failaddr_t fa;
> + const size_t size_disk_dquot = sizeof(struct xfs_disk_dquot);
>
> trace_xfs_log_recover_buf_reg_buf(mp->m_log, buf_f);
>
> @@ -2618,7 +2619,7 @@ xlog_recover_do_reg_buffer(
> "XFS: NULL dquot in %s.", __func__);
> goto next;
> }
> - if (item->ri_buf[i].i_len < sizeof(xfs_disk_dquot_t)) {
> + if (item->ri_buf[i].i_len < size_disk_dquot) {
> xfs_alert(mp,
> "XFS: dquot too small (%d) in %s.",
> item->ri_buf[i].i_len, __func__);
> @@ -3249,7 +3250,7 @@ xlog_recover_dquot_pass2(
> xfs_alert(log->l_mp, "NULL dquot in %s.", __func__);
> return -EIO;
> }
> - if (item->ri_buf[1].i_len < sizeof(xfs_disk_dquot_t)) {
> + if (item->ri_buf[1].i_len < sizeof(struct xfs_disk_dquot)) {
> xfs_alert(log->l_mp, "dquot too small (%d) in %s.",
> item->ri_buf[1].i_len, __func__);
> return -EIO;
> --
> 2.23.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/5] xfs: remove the xfs_dquot_t typedef
2019-11-07 11:35 ` [PATCH 2/5] xfs: remove the xfs_dquot_t typedef Pavel Reichl
@ 2019-11-07 22:31 ` Darrick J. Wong
0 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2019-11-07 22:31 UTC (permalink / raw)
To: Pavel Reichl; +Cc: linux-xfs
On Thu, Nov 07, 2019 at 12:35:46PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
> fs/xfs/xfs_dquot.c | 6 +++---
> fs/xfs/xfs_dquot.h | 21 +++++++++++----------
> fs/xfs/xfs_qm.c | 28 ++++++++++++++--------------
> fs/xfs/xfs_qm_bhv.c | 2 +-
> fs/xfs/xfs_trans_dquot.c | 38 +++++++++++++++++++-------------------
> 5 files changed, 48 insertions(+), 47 deletions(-)
>
> diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
> index edf0e81b3a10..04e38ed97f5f 100644
> --- a/fs/xfs/xfs_dquot.c
> +++ b/fs/xfs/xfs_dquot.c
> @@ -1019,7 +1019,7 @@ xfs_qm_dqflush_done(
> struct xfs_log_item *lip)
> {
> xfs_dq_logitem_t *qip = (struct xfs_dq_logitem *)lip;
> - xfs_dquot_t *dqp = qip->qli_dquot;
> + struct xfs_dquot *dqp = qip->qli_dquot;
> struct xfs_ail *ailp = lip->li_ailp;
>
> /*
> @@ -1188,8 +1188,8 @@ xfs_qm_dqflush(
> */
> void
> xfs_dqlock2(
> - xfs_dquot_t *d1,
> - xfs_dquot_t *d2)
> + struct xfs_dquot *d1,
> + struct xfs_dquot *d2)
> {
> if (d1 && d2) {
> ASSERT(d1 != d2);
> diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
> index 7a580dd09a76..330ba888e74a 100644
> --- a/fs/xfs/xfs_dquot.h
> +++ b/fs/xfs/xfs_dquot.h
> @@ -30,7 +30,7 @@ enum {
> /*
> * The incore dquot structure
> */
> -typedef struct xfs_dquot {
> +struct xfs_dquot {
> uint dq_flags; /* various flags (XFS_DQ_*) */
> struct list_head q_lru; /* global free list of dquots */
> struct xfs_mount*q_mount; /* filesystem this relates to */
> @@ -51,7 +51,7 @@ typedef struct xfs_dquot {
> struct completion q_flush; /* flush completion queue */
> atomic_t q_pincount; /* dquot pin count */
> wait_queue_head_t q_pinwait; /* dquot pinning wait queue */
> -} xfs_dquot_t;
> +};
>
> /*
> * Lock hierarchy for q_qlock:
> @@ -68,17 +68,17 @@ enum {
> * queue synchronizes processes attempting to flush the in-core dquot back to
> * disk.
> */
> -static inline void xfs_dqflock(xfs_dquot_t *dqp)
> +static inline void xfs_dqflock(struct xfs_dquot *dqp)
> {
> wait_for_completion(&dqp->q_flush);
> }
>
> -static inline bool xfs_dqflock_nowait(xfs_dquot_t *dqp)
> +static inline bool xfs_dqflock_nowait(struct xfs_dquot *dqp)
> {
> return try_wait_for_completion(&dqp->q_flush);
> }
>
> -static inline void xfs_dqfunlock(xfs_dquot_t *dqp)
> +static inline void xfs_dqfunlock(struct xfs_dquot *dqp)
> {
> complete(&dqp->q_flush);
> }
> @@ -112,7 +112,7 @@ static inline int xfs_this_quota_on(struct xfs_mount *mp, int type)
> }
> }
>
> -static inline xfs_dquot_t *xfs_inode_dquot(struct xfs_inode *ip, int type)
> +static inline struct xfs_dquot *xfs_inode_dquot(struct xfs_inode *ip, int type)
> {
> switch (type & XFS_DQ_ALLTYPES) {
> case XFS_DQ_USER:
> @@ -147,9 +147,10 @@ static inline bool xfs_dquot_lowsp(struct xfs_dquot *dqp)
> #define XFS_QM_ISPDQ(dqp) ((dqp)->dq_flags & XFS_DQ_PROJ)
> #define XFS_QM_ISGDQ(dqp) ((dqp)->dq_flags & XFS_DQ_GROUP)
>
> -extern void xfs_qm_dqdestroy(xfs_dquot_t *);
> -extern int xfs_qm_dqflush(struct xfs_dquot *, struct xfs_buf **);
> -extern void xfs_qm_dqunpin_wait(xfs_dquot_t *);
> +extern void xfs_qm_dqdestroy(struct xfs_dquot *dqp);
> +extern int xfs_qm_dqflush(struct xfs_dquot *dqp,
> + struct xfs_buf **bpp);
> +extern void xfs_qm_dqunpin_wait(struct xfs_dquot *dqp);
> extern void xfs_qm_adjust_dqtimers(xfs_mount_t *,
> struct xfs_disk_dquot *);
> extern void xfs_qm_adjust_dqlimits(struct xfs_mount *,
> @@ -167,7 +168,7 @@ extern int xfs_qm_dqget_next(struct xfs_mount *mp, xfs_dqid_t id,
> extern int xfs_qm_dqget_uncached(struct xfs_mount *mp,
> xfs_dqid_t id, uint type,
> struct xfs_dquot **dqpp);
> -extern void xfs_qm_dqput(xfs_dquot_t *);
> +extern void xfs_qm_dqput(struct xfs_dquot *dqp);
>
> extern void xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *);
>
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index ecd8ce152ab1..a8b278348f5a 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -243,14 +243,14 @@ xfs_qm_unmount_quotas(
>
> STATIC int
> xfs_qm_dqattach_one(
> - xfs_inode_t *ip,
> - xfs_dqid_t id,
> - uint type,
> - bool doalloc,
> - xfs_dquot_t **IO_idqpp)
> + xfs_inode_t *ip,
Same general "kill the other typedefs when you touch a clump of them" (and
our national nightmare will slowly go away) here. :)
Otherwise looks reasonable.
--D
> + xfs_dqid_t id,
> + uint type,
> + bool doalloc,
> + struct xfs_dquot **IO_idqpp)
> {
> - xfs_dquot_t *dqp;
> - int error;
> + struct xfs_dquot *dqp;
> + int error;
>
> ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
> error = 0;
> @@ -543,7 +543,7 @@ xfs_qm_set_defquota(
> uint type,
> xfs_quotainfo_t *qinf)
> {
> - xfs_dquot_t *dqp;
> + struct xfs_dquot *dqp;
> struct xfs_def_quota *defq;
> struct xfs_disk_dquot *ddqp;
> int error;
> @@ -1737,14 +1737,14 @@ xfs_qm_vop_dqalloc(
> * Actually transfer ownership, and do dquot modifications.
> * These were already reserved.
> */
> -xfs_dquot_t *
> +struct xfs_dquot *
> xfs_qm_vop_chown(
> - xfs_trans_t *tp,
> - xfs_inode_t *ip,
> - xfs_dquot_t **IO_olddq,
> - xfs_dquot_t *newdq)
> + xfs_trans_t *tp,
> + xfs_inode_t *ip,
> + struct xfs_dquot **IO_olddq,
> + struct xfs_dquot *newdq)
> {
> - xfs_dquot_t *prevdq;
> + struct xfs_dquot *prevdq;
> uint bfield = XFS_IS_REALTIME_INODE(ip) ?
> XFS_TRANS_DQ_RTBCOUNT : XFS_TRANS_DQ_BCOUNT;
>
> diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
> index 5d72e88598b4..1830f52d5975 100644
> --- a/fs/xfs/xfs_qm_bhv.c
> +++ b/fs/xfs/xfs_qm_bhv.c
> @@ -58,7 +58,7 @@ xfs_qm_statvfs(
> struct kstatfs *statp)
> {
> xfs_mount_t *mp = ip->i_mount;
> - xfs_dquot_t *dqp;
> + struct xfs_dquot *dqp;
>
> if (!xfs_qm_dqget(mp, xfs_get_projid(ip), XFS_DQ_PROJ, false, &dqp)) {
> xfs_fill_statvfs_from_dquot(statp, dqp);
> diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
> index 16457465833b..ceb25d1cfdb1 100644
> --- a/fs/xfs/xfs_trans_dquot.c
> +++ b/fs/xfs/xfs_trans_dquot.c
> @@ -25,8 +25,8 @@ STATIC void xfs_trans_alloc_dqinfo(xfs_trans_t *);
> */
> void
> xfs_trans_dqjoin(
> - xfs_trans_t *tp,
> - xfs_dquot_t *dqp)
> + xfs_trans_t *tp,
> + struct xfs_dquot *dqp)
> {
> ASSERT(XFS_DQ_IS_LOCKED(dqp));
> ASSERT(dqp->q_logitem.qli_dquot == dqp);
> @@ -49,8 +49,8 @@ xfs_trans_dqjoin(
> */
> void
> xfs_trans_log_dquot(
> - xfs_trans_t *tp,
> - xfs_dquot_t *dqp)
> + xfs_trans_t *tp,
> + struct xfs_dquot *dqp)
> {
> ASSERT(XFS_DQ_IS_LOCKED(dqp));
>
> @@ -489,7 +489,7 @@ xfs_trans_unreserve_and_mod_dquots(
> xfs_trans_t *tp)
> {
> int i, j;
> - xfs_dquot_t *dqp;
> + struct xfs_dquot *dqp;
> struct xfs_dqtrx *qtrx, *qa;
> bool locked;
>
> @@ -571,21 +571,21 @@ xfs_quota_warn(
> */
> STATIC int
> xfs_trans_dqresv(
> - xfs_trans_t *tp,
> - xfs_mount_t *mp,
> - xfs_dquot_t *dqp,
> - int64_t nblks,
> - long ninos,
> - uint flags)
> + xfs_trans_t *tp,
> + xfs_mount_t *mp,
> + struct xfs_dquot *dqp,
> + int64_t nblks,
> + long ninos,
> + uint flags)
> {
> - xfs_qcnt_t hardlimit;
> - xfs_qcnt_t softlimit;
> - time_t timer;
> - xfs_qwarncnt_t warns;
> - xfs_qwarncnt_t warnlimit;
> - xfs_qcnt_t total_count;
> - xfs_qcnt_t *resbcountp;
> - xfs_quotainfo_t *q = mp->m_quotainfo;
> + xfs_qcnt_t hardlimit;
> + xfs_qcnt_t softlimit;
> + time_t timer;
> + xfs_qwarncnt_t warns;
> + xfs_qwarncnt_t warnlimit;
> + xfs_qcnt_t total_count;
> + xfs_qcnt_t *resbcountp;
> + xfs_quotainfo_t *q = mp->m_quotainfo;
> struct xfs_def_quota *defq;
>
>
> --
> 2.23.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/5] xfs: remove the xfs_quotainfo_t typedef
2019-11-07 11:35 ` [PATCH 3/5] xfs: remove the xfs_quotainfo_t typedef Pavel Reichl
@ 2019-11-08 0:19 ` Darrick J. Wong
0 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2019-11-08 0:19 UTC (permalink / raw)
To: Pavel Reichl; +Cc: linux-xfs
On Thu, Nov 07, 2019 at 12:35:47PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
> fs/xfs/xfs_qm.c | 14 +++++++-------
> fs/xfs/xfs_qm.h | 4 ++--
> fs/xfs/xfs_trans_dquot.c | 2 +-
> 3 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index a8b278348f5a..4088273adb11 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -32,7 +32,7 @@
> STATIC int xfs_qm_init_quotainos(xfs_mount_t *);
> STATIC int xfs_qm_init_quotainfo(xfs_mount_t *);
>
> -STATIC void xfs_qm_destroy_quotainos(xfs_quotainfo_t *qi);
> +STATIC void xfs_qm_destroy_quotainos(struct xfs_quotainfo *qi);
> STATIC void xfs_qm_dqfree_one(struct xfs_dquot *dqp);
> /*
> * We use the batch lookup interface to iterate over the dquots as it
> @@ -539,9 +539,9 @@ xfs_qm_shrink_count(
>
> STATIC void
> xfs_qm_set_defquota(
> - xfs_mount_t *mp,
> - uint type,
> - xfs_quotainfo_t *qinf)
> + xfs_mount_t *mp,
Please de-typedef this while you're touching the lines.
Otherwise looks good!
--D
> + uint type,
> + struct xfs_quotainfo *qinf)
> {
> struct xfs_dquot *dqp;
> struct xfs_def_quota *defq;
> @@ -642,7 +642,7 @@ xfs_qm_init_quotainfo(
>
> ASSERT(XFS_IS_QUOTA_RUNNING(mp));
>
> - qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), 0);
> + qinf = mp->m_quotainfo = kmem_zalloc(sizeof(struct xfs_quotainfo), 0);
>
> error = list_lru_init(&qinf->qi_lru);
> if (error)
> @@ -711,7 +711,7 @@ void
> xfs_qm_destroy_quotainfo(
> xfs_mount_t *mp)
> {
> - xfs_quotainfo_t *qi;
> + struct xfs_quotainfo *qi;
>
> qi = mp->m_quotainfo;
> ASSERT(qi != NULL);
> @@ -1559,7 +1559,7 @@ xfs_qm_init_quotainos(
>
> STATIC void
> xfs_qm_destroy_quotainos(
> - xfs_quotainfo_t *qi)
> + struct xfs_quotainfo *qi)
> {
> if (qi->qi_uquotaip) {
> xfs_irele(qi->qi_uquotaip);
> diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
> index b41b75089548..185c9d89a5cd 100644
> --- a/fs/xfs/xfs_qm.h
> +++ b/fs/xfs/xfs_qm.h
> @@ -54,7 +54,7 @@ struct xfs_def_quota {
> * Various quota information for individual filesystems.
> * The mount structure keeps a pointer to this.
> */
> -typedef struct xfs_quotainfo {
> +struct xfs_quotainfo {
> struct radix_tree_root qi_uquota_tree;
> struct radix_tree_root qi_gquota_tree;
> struct radix_tree_root qi_pquota_tree;
> @@ -77,7 +77,7 @@ typedef struct xfs_quotainfo {
> struct xfs_def_quota qi_grp_default;
> struct xfs_def_quota qi_prj_default;
> struct shrinker qi_shrinker;
> -} xfs_quotainfo_t;
> +};
>
> static inline struct radix_tree_root *
> xfs_dquot_tree(
> diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
> index ceb25d1cfdb1..4789f7e11f53 100644
> --- a/fs/xfs/xfs_trans_dquot.c
> +++ b/fs/xfs/xfs_trans_dquot.c
> @@ -585,7 +585,7 @@ xfs_trans_dqresv(
> xfs_qwarncnt_t warnlimit;
> xfs_qcnt_t total_count;
> xfs_qcnt_t *resbcountp;
> - xfs_quotainfo_t *q = mp->m_quotainfo;
> + struct xfs_quotainfo *q = mp->m_quotainfo;
> struct xfs_def_quota *defq;
>
>
> --
> 2.23.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 4/5] xfs: remove the xfs_dq_logitem_t typedef
2019-11-07 11:35 ` [PATCH 4/5] xfs: remove the xfs_dq_logitem_t typedef Pavel Reichl
@ 2019-11-08 0:20 ` Darrick J. Wong
0 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2019-11-08 0:20 UTC (permalink / raw)
To: Pavel Reichl; +Cc: linux-xfs
On Thu, Nov 07, 2019 at 12:35:48PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_dquot.c | 2 +-
> fs/xfs/xfs_dquot.h | 4 ++--
> fs/xfs/xfs_dquot_item.h | 4 ++--
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
> index 04e38ed97f5f..209d5e4b5850 100644
> --- a/fs/xfs/xfs_dquot.c
> +++ b/fs/xfs/xfs_dquot.c
> @@ -1018,7 +1018,7 @@ xfs_qm_dqflush_done(
> struct xfs_buf *bp,
> struct xfs_log_item *lip)
> {
> - xfs_dq_logitem_t *qip = (struct xfs_dq_logitem *)lip;
> + struct xfs_dq_logitem *qip = (struct xfs_dq_logitem *)lip;
> struct xfs_dquot *dqp = qip->qli_dquot;
> struct xfs_ail *ailp = lip->li_ailp;
>
> diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
> index 330ba888e74a..f1e7cc6a383f 100644
> --- a/fs/xfs/xfs_dquot.h
> +++ b/fs/xfs/xfs_dquot.h
> @@ -39,8 +39,8 @@ struct xfs_dquot {
> int q_bufoffset; /* off of dq in buffer (# dquots) */
> xfs_fileoff_t q_fileoffset; /* offset in quotas file */
>
> - struct xfs_disk_dquot q_core; /* actual usage & quotas */
> - xfs_dq_logitem_t q_logitem; /* dquot log item */
> + struct xfs_disk_dquot q_core; /* actual usage & quotas */
> + struct xfs_dq_logitem q_logitem; /* dquot log item */
> xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */
> xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */
> xfs_qcnt_t q_res_rtbcount;/* total realtime blks used+reserved */
> diff --git a/fs/xfs/xfs_dquot_item.h b/fs/xfs/xfs_dquot_item.h
> index 1aed34ccdabc..e0a24eb7a545 100644
> --- a/fs/xfs/xfs_dquot_item.h
> +++ b/fs/xfs/xfs_dquot_item.h
> @@ -11,11 +11,11 @@ struct xfs_trans;
> struct xfs_mount;
> struct xfs_qoff_logitem;
>
> -typedef struct xfs_dq_logitem {
> +struct xfs_dq_logitem {
> struct xfs_log_item qli_item; /* common portion */
> struct xfs_dquot *qli_dquot; /* dquot ptr */
> xfs_lsn_t qli_flush_lsn; /* lsn at last flush */
> -} xfs_dq_logitem_t;
> +};
>
> typedef struct xfs_qoff_logitem {
> struct xfs_log_item qql_item; /* common portion */
> --
> 2.23.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 5/5] xfs: remove the xfs_qoff_logitem_t typedef
2019-11-07 11:35 ` [PATCH 5/5] xfs: remove the xfs_qoff_logitem_t typedef Pavel Reichl
@ 2019-11-08 0:20 ` Darrick J. Wong
0 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2019-11-08 0:20 UTC (permalink / raw)
To: Pavel Reichl; +Cc: linux-xfs
On Thu, Nov 07, 2019 at 12:35:49PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
> fs/xfs/libxfs/xfs_trans_resv.c | 4 ++--
> fs/xfs/xfs_dquot_item.h | 14 ++++++++------
> fs/xfs/xfs_qm_syscalls.c | 20 ++++++++++----------
> fs/xfs/xfs_trans_dquot.c | 8 ++++----
> 4 files changed, 24 insertions(+), 22 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
> index 271cca13565b..eb7fe42b1d61 100644
> --- a/fs/xfs/libxfs/xfs_trans_resv.c
> +++ b/fs/xfs/libxfs/xfs_trans_resv.c
> @@ -741,7 +741,7 @@ xfs_calc_qm_dqalloc_reservation(
>
> /*
> * Turning off quotas.
> - * the xfs_qoff_logitem_t: sizeof(struct xfs_qoff_logitem) * 2
> + * sizeof(struct xfs_qoff_logitem) * 2
> * the superblock for the quota flags: sector size
> */
> STATIC uint
> @@ -754,7 +754,7 @@ xfs_calc_qm_quotaoff_reservation(
>
> /*
> * End of turning off quotas.
> - * the xfs_qoff_logitem_t: sizeof(struct xfs_qoff_logitem) * 2
> + * sizeof(struct xfs_qoff_logitem) * 2
> */
> STATIC uint
> xfs_calc_qm_quotaoff_end_reservation(void)
> diff --git a/fs/xfs/xfs_dquot_item.h b/fs/xfs/xfs_dquot_item.h
> index e0a24eb7a545..e2348a99fa1a 100644
> --- a/fs/xfs/xfs_dquot_item.h
> +++ b/fs/xfs/xfs_dquot_item.h
> @@ -17,18 +17,20 @@ struct xfs_dq_logitem {
> xfs_lsn_t qli_flush_lsn; /* lsn at last flush */
> };
>
> -typedef struct xfs_qoff_logitem {
> +struct xfs_qoff_logitem {
> struct xfs_log_item qql_item; /* common portion */
> struct xfs_qoff_logitem *qql_start_lip; /* qoff-start logitem, if any */
> unsigned int qql_flags;
> -} xfs_qoff_logitem_t;
> +};
>
>
> extern void xfs_qm_dquot_logitem_init(struct xfs_dquot *);
> -extern xfs_qoff_logitem_t *xfs_qm_qoff_logitem_init(struct xfs_mount *,
> - struct xfs_qoff_logitem *, uint);
> -extern xfs_qoff_logitem_t *xfs_trans_get_qoff_item(struct xfs_trans *,
> - struct xfs_qoff_logitem *, uint);
> +extern struct xfs_qoff_logitem *xfs_qm_qoff_logitem_init(struct xfs_mount *mp,
> + struct xfs_qoff_logitem *start,
> + uint flags);
> +extern struct xfs_qoff_logitem *xfs_trans_get_qoff_item(struct xfs_trans *tp,
> + struct xfs_qoff_logitem *startqoff,
> + uint flags);
> extern void xfs_trans_log_quotaoff_item(struct xfs_trans *,
> struct xfs_qoff_logitem *);
>
> diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
> index da7ad0383037..72b476e80ab2 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -19,9 +19,9 @@
> #include "xfs_qm.h"
> #include "xfs_icache.h"
>
> -STATIC int xfs_qm_log_quotaoff(xfs_mount_t *, xfs_qoff_logitem_t **, uint);
> -STATIC int xfs_qm_log_quotaoff_end(xfs_mount_t *, xfs_qoff_logitem_t *,
> - uint);
> +STATIC int xfs_qm_log_quotaoff(xfs_mount_t *, struct xfs_qoff_logitem **, uint);
> +STATIC int xfs_qm_log_quotaoff_end(xfs_mount_t *, struct xfs_qoff_logitem *,
> + uint);
>
> /*
> * Turn off quota accounting and/or enforcement for all udquots and/or
> @@ -40,7 +40,7 @@ xfs_qm_scall_quotaoff(
> uint dqtype;
> int error;
> uint inactivate_flags;
> - xfs_qoff_logitem_t *qoffstart;
> + struct xfs_qoff_logitem *qoffstart;
>
> /*
> * No file system can have quotas enabled on disk but not in core.
> @@ -541,12 +541,12 @@ xfs_qm_scall_setqlim(
> STATIC int
> xfs_qm_log_quotaoff_end(
> xfs_mount_t *mp,
> - xfs_qoff_logitem_t *startqoff,
> + struct xfs_qoff_logitem *startqoff,
> uint flags)
> {
> xfs_trans_t *tp;
> int error;
> - xfs_qoff_logitem_t *qoffi;
> + struct xfs_qoff_logitem *qoffi;
>
> error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_equotaoff, 0, 0, 0, &tp);
> if (error)
> @@ -569,12 +569,12 @@ xfs_qm_log_quotaoff_end(
> STATIC int
> xfs_qm_log_quotaoff(
> xfs_mount_t *mp,
> - xfs_qoff_logitem_t **qoffstartp,
> + struct xfs_qoff_logitem **qoffstartp,
> uint flags)
> {
> - xfs_trans_t *tp;
> - int error;
> - xfs_qoff_logitem_t *qoffi;
> + xfs_trans_t *tp;
> + int error;
> + struct xfs_qoff_logitem *qoffi;
>
> *qoffstartp = NULL;
>
> diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
> index 4789f7e11f53..8b6f328f83d5 100644
> --- a/fs/xfs/xfs_trans_dquot.c
> +++ b/fs/xfs/xfs_trans_dquot.c
> @@ -824,13 +824,13 @@ xfs_trans_reserve_quota_nblks(
> /*
> * This routine is called to allocate a quotaoff log item.
> */
> -xfs_qoff_logitem_t *
> +struct xfs_qoff_logitem *
> xfs_trans_get_qoff_item(
> xfs_trans_t *tp,
> - xfs_qoff_logitem_t *startqoff,
> + struct xfs_qoff_logitem *startqoff,
> uint flags)
> {
> - xfs_qoff_logitem_t *q;
> + struct xfs_qoff_logitem *q;
>
> ASSERT(tp != NULL);
>
> @@ -853,7 +853,7 @@ xfs_trans_get_qoff_item(
> void
> xfs_trans_log_quotaoff_item(
> xfs_trans_t *tp,
Might as well convert all these typedefs too, just like the other
patches. Otherwise this looks fine to me.
--D
> - xfs_qoff_logitem_t *qlp)
> + struct xfs_qoff_logitem *qlp)
> {
> tp->t_flags |= XFS_TRANS_DIRTY;
> set_bit(XFS_LI_DIRTY, &qlp->qql_item.li_flags);
> --
> 2.23.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2019-11-08 0:21 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 11:35 [PATCH 0/5] xfs: remove several typedefs in quota code Pavel Reichl
2019-11-07 11:35 ` [PATCH 1/5] xfs: remove the xfs_disk_dquot_t typedef Pavel Reichl
2019-11-07 22:02 ` Darrick J. Wong
2019-11-07 11:35 ` [PATCH 2/5] xfs: remove the xfs_dquot_t typedef Pavel Reichl
2019-11-07 22:31 ` Darrick J. Wong
2019-11-07 11:35 ` [PATCH 3/5] xfs: remove the xfs_quotainfo_t typedef Pavel Reichl
2019-11-08 0:19 ` Darrick J. Wong
2019-11-07 11:35 ` [PATCH 4/5] xfs: remove the xfs_dq_logitem_t typedef Pavel Reichl
2019-11-08 0:20 ` Darrick J. Wong
2019-11-07 11:35 ` [PATCH 5/5] xfs: remove the xfs_qoff_logitem_t typedef Pavel Reichl
2019-11-08 0:20 ` Darrick J. Wong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.