@@ -218,137 +218,3 @@ xfs_qm_dquot_logitem_init(
218218 & xfs_dquot_item_ops );
219219 lp -> qli_dquot = dqp ;
220220}
221-
222- /*------------------ QUOTAOFF LOG ITEMS -------------------*/
223-
224- static inline struct xfs_qoff_logitem * QOFF_ITEM (struct xfs_log_item * lip )
225- {
226- return container_of (lip , struct xfs_qoff_logitem , qql_item );
227- }
228-
229-
230- /*
231- * This returns the number of iovecs needed to log the given quotaoff item.
232- * We only need 1 iovec for an quotaoff item. It just logs the
233- * quotaoff_log_format structure.
234- */
235- STATIC void
236- xfs_qm_qoff_logitem_size (
237- struct xfs_log_item * lip ,
238- int * nvecs ,
239- int * nbytes )
240- {
241- * nvecs += 1 ;
242- * nbytes += sizeof (struct xfs_qoff_logitem );
243- }
244-
245- STATIC void
246- xfs_qm_qoff_logitem_format (
247- struct xfs_log_item * lip ,
248- struct xfs_log_vec * lv )
249- {
250- struct xfs_qoff_logitem * qflip = QOFF_ITEM (lip );
251- struct xfs_log_iovec * vecp = NULL ;
252- struct xfs_qoff_logformat * qlf ;
253-
254- qlf = xlog_prepare_iovec (lv , & vecp , XLOG_REG_TYPE_QUOTAOFF );
255- qlf -> qf_type = XFS_LI_QUOTAOFF ;
256- qlf -> qf_size = 1 ;
257- qlf -> qf_flags = qflip -> qql_flags ;
258- xlog_finish_iovec (lv , vecp , sizeof (struct xfs_qoff_logitem ));
259- }
260-
261- /*
262- * There isn't much you can do to push a quotaoff item. It is simply
263- * stuck waiting for the log to be flushed to disk.
264- */
265- STATIC uint
266- xfs_qm_qoff_logitem_push (
267- struct xfs_log_item * lip ,
268- struct list_head * buffer_list )
269- {
270- return XFS_ITEM_LOCKED ;
271- }
272-
273- STATIC xfs_lsn_t
274- xfs_qm_qoffend_logitem_committed (
275- struct xfs_log_item * lip ,
276- xfs_lsn_t lsn )
277- {
278- struct xfs_qoff_logitem * qfe = QOFF_ITEM (lip );
279- struct xfs_qoff_logitem * qfs = qfe -> qql_start_lip ;
280-
281- xfs_qm_qoff_logitem_relse (qfs );
282-
283- kmem_free (lip -> li_lv_shadow );
284- kmem_free (qfe );
285- return (xfs_lsn_t )- 1 ;
286- }
287-
288- STATIC void
289- xfs_qm_qoff_logitem_release (
290- struct xfs_log_item * lip )
291- {
292- struct xfs_qoff_logitem * qoff = QOFF_ITEM (lip );
293-
294- if (test_bit (XFS_LI_ABORTED , & lip -> li_flags )) {
295- if (qoff -> qql_start_lip )
296- xfs_qm_qoff_logitem_relse (qoff -> qql_start_lip );
297- xfs_qm_qoff_logitem_relse (qoff );
298- }
299- }
300-
301- static const struct xfs_item_ops xfs_qm_qoffend_logitem_ops = {
302- .iop_size = xfs_qm_qoff_logitem_size ,
303- .iop_format = xfs_qm_qoff_logitem_format ,
304- .iop_committed = xfs_qm_qoffend_logitem_committed ,
305- .iop_push = xfs_qm_qoff_logitem_push ,
306- .iop_release = xfs_qm_qoff_logitem_release ,
307- };
308-
309- static const struct xfs_item_ops xfs_qm_qoff_logitem_ops = {
310- .iop_size = xfs_qm_qoff_logitem_size ,
311- .iop_format = xfs_qm_qoff_logitem_format ,
312- .iop_push = xfs_qm_qoff_logitem_push ,
313- .iop_release = xfs_qm_qoff_logitem_release ,
314- };
315-
316- /*
317- * Delete the quotaoff intent from the AIL and free it. On success,
318- * this should only be called for the start item. It can be used for
319- * either on shutdown or abort.
320- */
321- void
322- xfs_qm_qoff_logitem_relse (
323- struct xfs_qoff_logitem * qoff )
324- {
325- struct xfs_log_item * lip = & qoff -> qql_item ;
326-
327- ASSERT (test_bit (XFS_LI_IN_AIL , & lip -> li_flags ) ||
328- test_bit (XFS_LI_ABORTED , & lip -> li_flags ) ||
329- XFS_FORCED_SHUTDOWN (lip -> li_mountp ));
330- xfs_trans_ail_delete (lip , 0 );
331- kmem_free (lip -> li_lv_shadow );
332- kmem_free (qoff );
333- }
334-
335- /*
336- * Allocate and initialize an quotaoff item of the correct quota type(s).
337- */
338- struct xfs_qoff_logitem *
339- xfs_qm_qoff_logitem_init (
340- struct xfs_mount * mp ,
341- struct xfs_qoff_logitem * start ,
342- uint flags )
343- {
344- struct xfs_qoff_logitem * qf ;
345-
346- qf = kmem_zalloc (sizeof (struct xfs_qoff_logitem ), 0 );
347-
348- xfs_log_item_init (mp , & qf -> qql_item , XFS_LI_QUOTAOFF , start ?
349- & xfs_qm_qoffend_logitem_ops : & xfs_qm_qoff_logitem_ops );
350- qf -> qql_item .li_mountp = mp ;
351- qf -> qql_start_lip = start ;
352- qf -> qql_flags = flags ;
353- return qf ;
354- }
0 commit comments