diff options
Diffstat (limited to 'fs/xfs/xfs_icreate_item.c')
| -rw-r--r-- | fs/xfs/xfs_icreate_item.c | 75 |
1 files changed, 4 insertions, 71 deletions
diff --git a/fs/xfs/xfs_icreate_item.c b/fs/xfs/xfs_icreate_item.c index 8381d34cb102..d99a0a3e5f40 100644 --- a/fs/xfs/xfs_icreate_item.c +++ b/fs/xfs/xfs_icreate_item.c | |||
| @@ -6,14 +6,9 @@ | |||
| 6 | #include "xfs.h" | 6 | #include "xfs.h" |
| 7 | #include "xfs_fs.h" | 7 | #include "xfs_fs.h" |
| 8 | #include "xfs_shared.h" | 8 | #include "xfs_shared.h" |
| 9 | #include "xfs_format.h" | ||
| 10 | #include "xfs_log_format.h" | 9 | #include "xfs_log_format.h" |
| 11 | #include "xfs_trans_resv.h" | ||
| 12 | #include "xfs_bit.h" | ||
| 13 | #include "xfs_mount.h" | ||
| 14 | #include "xfs_trans.h" | 10 | #include "xfs_trans.h" |
| 15 | #include "xfs_trans_priv.h" | 11 | #include "xfs_trans_priv.h" |
| 16 | #include "xfs_error.h" | ||
| 17 | #include "xfs_icreate_item.h" | 12 | #include "xfs_icreate_item.h" |
| 18 | #include "xfs_log.h" | 13 | #include "xfs_log.h" |
| 19 | 14 | ||
| @@ -56,80 +51,18 @@ xfs_icreate_item_format( | |||
| 56 | sizeof(struct xfs_icreate_log)); | 51 | sizeof(struct xfs_icreate_log)); |
| 57 | } | 52 | } |
| 58 | 53 | ||
| 59 | |||
| 60 | /* Pinning has no meaning for the create item, so just return. */ | ||
| 61 | STATIC void | 54 | STATIC void |
| 62 | xfs_icreate_item_pin( | 55 | xfs_icreate_item_release( |
| 63 | struct xfs_log_item *lip) | 56 | struct xfs_log_item *lip) |
| 64 | { | 57 | { |
| 58 | kmem_zone_free(xfs_icreate_zone, ICR_ITEM(lip)); | ||
| 65 | } | 59 | } |
| 66 | 60 | ||
| 67 | |||
| 68 | /* pinning has no meaning for the create item, so just return. */ | ||
| 69 | STATIC void | ||
| 70 | xfs_icreate_item_unpin( | ||
| 71 | struct xfs_log_item *lip, | ||
| 72 | int remove) | ||
| 73 | { | ||
| 74 | } | ||
| 75 | |||
| 76 | STATIC void | ||
| 77 | xfs_icreate_item_unlock( | ||
| 78 | struct xfs_log_item *lip) | ||
| 79 | { | ||
| 80 | struct xfs_icreate_item *icp = ICR_ITEM(lip); | ||
| 81 | |||
| 82 | if (test_bit(XFS_LI_ABORTED, &lip->li_flags)) | ||
| 83 | kmem_zone_free(xfs_icreate_zone, icp); | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Because we have ordered buffers being tracked in the AIL for the inode | ||
| 89 | * creation, we don't need the create item after this. Hence we can free | ||
| 90 | * the log item and return -1 to tell the caller we're done with the item. | ||
| 91 | */ | ||
| 92 | STATIC xfs_lsn_t | ||
| 93 | xfs_icreate_item_committed( | ||
| 94 | struct xfs_log_item *lip, | ||
| 95 | xfs_lsn_t lsn) | ||
| 96 | { | ||
| 97 | struct xfs_icreate_item *icp = ICR_ITEM(lip); | ||
| 98 | |||
| 99 | kmem_zone_free(xfs_icreate_zone, icp); | ||
| 100 | return (xfs_lsn_t)-1; | ||
| 101 | } | ||
| 102 | |||
| 103 | /* item can never get into the AIL */ | ||
| 104 | STATIC uint | ||
| 105 | xfs_icreate_item_push( | ||
| 106 | struct xfs_log_item *lip, | ||
| 107 | struct list_head *buffer_list) | ||
| 108 | { | ||
| 109 | ASSERT(0); | ||
| 110 | return XFS_ITEM_SUCCESS; | ||
| 111 | } | ||
| 112 | |||
| 113 | /* Ordered buffers do the dependency tracking here, so this does nothing. */ | ||
| 114 | STATIC void | ||
| 115 | xfs_icreate_item_committing( | ||
| 116 | struct xfs_log_item *lip, | ||
| 117 | xfs_lsn_t lsn) | ||
| 118 | { | ||
| 119 | } | ||
| 120 | |||
| 121 | /* | ||
| 122 | * This is the ops vector shared by all buf log items. | ||
| 123 | */ | ||
| 124 | static const struct xfs_item_ops xfs_icreate_item_ops = { | 61 | static const struct xfs_item_ops xfs_icreate_item_ops = { |
| 62 | .flags = XFS_ITEM_RELEASE_WHEN_COMMITTED, | ||
| 125 | .iop_size = xfs_icreate_item_size, | 63 | .iop_size = xfs_icreate_item_size, |
| 126 | .iop_format = xfs_icreate_item_format, | 64 | .iop_format = xfs_icreate_item_format, |
| 127 | .iop_pin = xfs_icreate_item_pin, | 65 | .iop_release = xfs_icreate_item_release, |
| 128 | .iop_unpin = xfs_icreate_item_unpin, | ||
| 129 | .iop_push = xfs_icreate_item_push, | ||
| 130 | .iop_unlock = xfs_icreate_item_unlock, | ||
| 131 | .iop_committed = xfs_icreate_item_committed, | ||
| 132 | .iop_committing = xfs_icreate_item_committing, | ||
| 133 | }; | 66 | }; |
| 134 | 67 | ||
| 135 | 68 | ||
