log.c (c37fe6aff89cb0d842993fe2f69e48bf3ebe0ab0) log.c (f5456b5d67cf812fd31fe3e130ca216b2e0908e5)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
4 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
5 */
6
7#include <linux/sched.h>
8#include <linux/slab.h>

--- 912 unchanged lines hidden (view full) ---

921 flags, op_flags);
922 gfs2_log_incr_head(sdp);
923 log_flush_wait(sdp);
924 log_pull_tail(sdp);
925 gfs2_log_update_head(sdp);
926}
927
928/**
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
4 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
5 */
6
7#include <linux/sched.h>
8#include <linux/slab.h>

--- 912 unchanged lines hidden (view full) ---

921 flags, op_flags);
922 gfs2_log_incr_head(sdp);
923 log_flush_wait(sdp);
924 log_pull_tail(sdp);
925 gfs2_log_update_head(sdp);
926}
927
928/**
929 * ail_drain - drain the ail lists after a withdraw
929 * gfs2_ail_drain - drain the ail lists after a withdraw
930 * @sdp: Pointer to GFS2 superblock
931 */
930 * @sdp: Pointer to GFS2 superblock
931 */
932static void ail_drain(struct gfs2_sbd *sdp)
932void gfs2_ail_drain(struct gfs2_sbd *sdp)
933{
934 struct gfs2_trans *tr;
935
936 spin_lock(&sdp->sd_ail_lock);
937 /*
938 * For transactions on the sd_ail1_list we need to drain both the
939 * ail1 and ail2 lists. That's because function gfs2_ail1_start_one
940 * (temporarily) moves items from its tr_ail1 list to tr_ail2 list

--- 10 unchanged lines hidden (view full) ---

951 }
952 while (!list_empty(&sdp->sd_ail2_list)) {
953 tr = list_first_entry(&sdp->sd_ail2_list, struct gfs2_trans,
954 tr_list);
955 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list);
956 list_del(&tr->tr_list);
957 gfs2_trans_free(sdp, tr);
958 }
933{
934 struct gfs2_trans *tr;
935
936 spin_lock(&sdp->sd_ail_lock);
937 /*
938 * For transactions on the sd_ail1_list we need to drain both the
939 * ail1 and ail2 lists. That's because function gfs2_ail1_start_one
940 * (temporarily) moves items from its tr_ail1 list to tr_ail2 list

--- 10 unchanged lines hidden (view full) ---

951 }
952 while (!list_empty(&sdp->sd_ail2_list)) {
953 tr = list_first_entry(&sdp->sd_ail2_list, struct gfs2_trans,
954 tr_list);
955 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list);
956 list_del(&tr->tr_list);
957 gfs2_trans_free(sdp, tr);
958 }
959 gfs2_drain_revokes(sdp);
959 spin_unlock(&sdp->sd_ail_lock);
960}
961
962/**
963 * empty_ail1_list - try to start IO and empty the ail1 list
964 * @sdp: Pointer to GFS2 superblock
965 */
966static void empty_ail1_list(struct gfs2_sbd *sdp)

--- 190 unchanged lines hidden (view full) ---

1157 * flush that targets a transaction, but the transaction was
1158 * never queued onto any of the ail lists. Here we add it to
1159 * ail1 just so that ail_drain() will find and free it.
1160 */
1161 spin_lock(&sdp->sd_ail_lock);
1162 if (tr && list_empty(&tr->tr_list))
1163 list_add(&tr->tr_list, &sdp->sd_ail1_list);
1164 spin_unlock(&sdp->sd_ail_lock);
960 spin_unlock(&sdp->sd_ail_lock);
961}
962
963/**
964 * empty_ail1_list - try to start IO and empty the ail1 list
965 * @sdp: Pointer to GFS2 superblock
966 */
967static void empty_ail1_list(struct gfs2_sbd *sdp)

--- 190 unchanged lines hidden (view full) ---

1158 * flush that targets a transaction, but the transaction was
1159 * never queued onto any of the ail lists. Here we add it to
1160 * ail1 just so that ail_drain() will find and free it.
1161 */
1162 spin_lock(&sdp->sd_ail_lock);
1163 if (tr && list_empty(&tr->tr_list))
1164 list_add(&tr->tr_list, &sdp->sd_ail1_list);
1165 spin_unlock(&sdp->sd_ail_lock);
1165 ail_drain(sdp); /* frees all transactions */
1166 tr = NULL;
1167 goto out_end;
1168}
1169
1170/**
1171 * gfs2_merge_trans - Merge a new transaction into a cached transaction
1172 * @sdp: the filesystem
1173 * @new: New transaction to be merged

--- 178 unchanged lines hidden ---
1166 tr = NULL;
1167 goto out_end;
1168}
1169
1170/**
1171 * gfs2_merge_trans - Merge a new transaction into a cached transaction
1172 * @sdp: the filesystem
1173 * @new: New transaction to be merged

--- 178 unchanged lines hidden ---