Commit 272e42b2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder

xfs: constify xfs_item_ops

The log item ops aren't nessecarily the biggest exploit vector, but marking
them const is easy enough.  Also remove the unused xfs_item_ops_t typedef
while we're at it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
parent b52a360b
...@@ -656,7 +656,7 @@ xfs_buf_item_committing( ...@@ -656,7 +656,7 @@ xfs_buf_item_committing(
/* /*
* This is the ops vector shared by all buf log items. * This is the ops vector shared by all buf log items.
*/ */
static struct xfs_item_ops xfs_buf_item_ops = { static const struct xfs_item_ops xfs_buf_item_ops = {
.iop_size = xfs_buf_item_size, .iop_size = xfs_buf_item_size,
.iop_format = xfs_buf_item_format, .iop_format = xfs_buf_item_format,
.iop_pin = xfs_buf_item_pin, .iop_pin = xfs_buf_item_pin,
......
...@@ -295,7 +295,7 @@ xfs_qm_dquot_logitem_committing( ...@@ -295,7 +295,7 @@ xfs_qm_dquot_logitem_committing(
/* /*
* This is the ops vector for dquots * This is the ops vector for dquots
*/ */
static struct xfs_item_ops xfs_dquot_item_ops = { static const struct xfs_item_ops xfs_dquot_item_ops = {
.iop_size = xfs_qm_dquot_logitem_size, .iop_size = xfs_qm_dquot_logitem_size,
.iop_format = xfs_qm_dquot_logitem_format, .iop_format = xfs_qm_dquot_logitem_format,
.iop_pin = xfs_qm_dquot_logitem_pin, .iop_pin = xfs_qm_dquot_logitem_pin,
...@@ -483,7 +483,7 @@ xfs_qm_qoff_logitem_committing( ...@@ -483,7 +483,7 @@ xfs_qm_qoff_logitem_committing(
{ {
} }
static struct xfs_item_ops xfs_qm_qoffend_logitem_ops = { static const struct xfs_item_ops xfs_qm_qoffend_logitem_ops = {
.iop_size = xfs_qm_qoff_logitem_size, .iop_size = xfs_qm_qoff_logitem_size,
.iop_format = xfs_qm_qoff_logitem_format, .iop_format = xfs_qm_qoff_logitem_format,
.iop_pin = xfs_qm_qoff_logitem_pin, .iop_pin = xfs_qm_qoff_logitem_pin,
...@@ -498,7 +498,7 @@ static struct xfs_item_ops xfs_qm_qoffend_logitem_ops = { ...@@ -498,7 +498,7 @@ static struct xfs_item_ops xfs_qm_qoffend_logitem_ops = {
/* /*
* This is the ops vector shared by all quotaoff-start log items. * This is the ops vector shared by all quotaoff-start log items.
*/ */
static struct xfs_item_ops xfs_qm_qoff_logitem_ops = { static const struct xfs_item_ops xfs_qm_qoff_logitem_ops = {
.iop_size = xfs_qm_qoff_logitem_size, .iop_size = xfs_qm_qoff_logitem_size,
.iop_format = xfs_qm_qoff_logitem_format, .iop_format = xfs_qm_qoff_logitem_format,
.iop_pin = xfs_qm_qoff_logitem_pin, .iop_pin = xfs_qm_qoff_logitem_pin,
......
...@@ -217,7 +217,7 @@ xfs_efi_item_committing( ...@@ -217,7 +217,7 @@ xfs_efi_item_committing(
/* /*
* This is the ops vector shared by all efi log items. * This is the ops vector shared by all efi log items.
*/ */
static struct xfs_item_ops xfs_efi_item_ops = { static const struct xfs_item_ops xfs_efi_item_ops = {
.iop_size = xfs_efi_item_size, .iop_size = xfs_efi_item_size,
.iop_format = xfs_efi_item_format, .iop_format = xfs_efi_item_format,
.iop_pin = xfs_efi_item_pin, .iop_pin = xfs_efi_item_pin,
...@@ -477,7 +477,7 @@ xfs_efd_item_committing( ...@@ -477,7 +477,7 @@ xfs_efd_item_committing(
/* /*
* This is the ops vector shared by all efd log items. * This is the ops vector shared by all efd log items.
*/ */
static struct xfs_item_ops xfs_efd_item_ops = { static const struct xfs_item_ops xfs_efd_item_ops = {
.iop_size = xfs_efd_item_size, .iop_size = xfs_efd_item_size,
.iop_format = xfs_efd_item_format, .iop_format = xfs_efd_item_format,
.iop_pin = xfs_efd_item_pin, .iop_pin = xfs_efd_item_pin,
......
...@@ -795,7 +795,7 @@ xfs_inode_item_committing( ...@@ -795,7 +795,7 @@ xfs_inode_item_committing(
/* /*
* This is the ops vector shared by all buf log items. * This is the ops vector shared by all buf log items.
*/ */
static struct xfs_item_ops xfs_inode_item_ops = { static const struct xfs_item_ops xfs_inode_item_ops = {
.iop_size = xfs_inode_item_size, .iop_size = xfs_inode_item_size,
.iop_format = xfs_inode_item_format, .iop_format = xfs_inode_item_format,
.iop_pin = xfs_inode_item_pin, .iop_pin = xfs_inode_item_pin,
......
...@@ -626,7 +626,7 @@ xfs_log_item_init( ...@@ -626,7 +626,7 @@ xfs_log_item_init(
struct xfs_mount *mp, struct xfs_mount *mp,
struct xfs_log_item *item, struct xfs_log_item *item,
int type, int type,
struct xfs_item_ops *ops) const struct xfs_item_ops *ops)
{ {
item->li_mountp = mp; item->li_mountp = mp;
item->li_ailp = mp->m_ail; item->li_ailp = mp->m_ail;
......
...@@ -137,7 +137,7 @@ struct xfs_trans; ...@@ -137,7 +137,7 @@ struct xfs_trans;
void xfs_log_item_init(struct xfs_mount *mp, void xfs_log_item_init(struct xfs_mount *mp,
struct xfs_log_item *item, struct xfs_log_item *item,
int type, int type,
struct xfs_item_ops *ops); const struct xfs_item_ops *ops);
xfs_lsn_t xfs_log_done(struct xfs_mount *mp, xfs_lsn_t xfs_log_done(struct xfs_mount *mp,
struct xlog_ticket *ticket, struct xlog_ticket *ticket,
......
...@@ -326,7 +326,7 @@ typedef struct xfs_log_item { ...@@ -326,7 +326,7 @@ typedef struct xfs_log_item {
struct xfs_log_item *); struct xfs_log_item *);
/* buffer item iodone */ /* buffer item iodone */
/* callback func */ /* callback func */
struct xfs_item_ops *li_ops; /* function list */ const struct xfs_item_ops *li_ops; /* function list */
/* delayed logging */ /* delayed logging */
struct list_head li_cil; /* CIL pointers */ struct list_head li_cil; /* CIL pointers */
...@@ -341,7 +341,7 @@ typedef struct xfs_log_item { ...@@ -341,7 +341,7 @@ typedef struct xfs_log_item {
{ XFS_LI_IN_AIL, "IN_AIL" }, \ { XFS_LI_IN_AIL, "IN_AIL" }, \
{ XFS_LI_ABORTED, "ABORTED" } { XFS_LI_ABORTED, "ABORTED" }
typedef struct xfs_item_ops { struct xfs_item_ops {
uint (*iop_size)(xfs_log_item_t *); uint (*iop_size)(xfs_log_item_t *);
void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *); void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *);
void (*iop_pin)(xfs_log_item_t *); void (*iop_pin)(xfs_log_item_t *);
...@@ -352,7 +352,7 @@ typedef struct xfs_item_ops { ...@@ -352,7 +352,7 @@ typedef struct xfs_item_ops {
void (*iop_push)(xfs_log_item_t *); void (*iop_push)(xfs_log_item_t *);
bool (*iop_pushbuf)(xfs_log_item_t *); bool (*iop_pushbuf)(xfs_log_item_t *);
void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t); void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t);
} xfs_item_ops_t; };
#define IOP_SIZE(ip) (*(ip)->li_ops->iop_size)(ip) #define IOP_SIZE(ip) (*(ip)->li_ops->iop_size)(ip)
#define IOP_FORMAT(ip,vp) (*(ip)->li_ops->iop_format)(ip, vp) #define IOP_FORMAT(ip,vp) (*(ip)->li_ops->iop_format)(ip, vp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment