GFS2: Move four functions from super.c
From f9ae595f9abd3bdb14fab70584832f15df299eed Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
Date: Wed, 26 Nov 2008 13:30:49 +0000
Subject: [PATCH] GFS2: Move four functions from super.c
The functions which are being moved can all be marked static in their new locations, since they only have a single caller each. Their new locations are more logical than before and some of the functions are small enough that the compiler might well inline them.
Signed-off-by Steven Whitehouse <[email protected]>
fs/gfs2/glock.c +14 -0
@@ -1317,6 +1317,20 @@ static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name,gfs2_glock_put (gl); } +static void gfs2_jdesc_make_dirty (struct gfs2_sbd *sdp,unsigned int jid) +{ +struct gfs2_jdesc *jd; + +spin_lock (&sdp->sd_jindex_spin); +list_for_each_entry (jd, &sdp->sd_jindex_list, jd_list) { +if (jd->jd_jid != jid) +continue ; + jd->jd_dirty =1 ; +break ; + } +spin_unlock (&sdp->sd_jindex_spin); +} +/** * gfs2_glock_cb - Callback used by locking module * @sdp: Pointer to the superblock
fs/gfs2/ops_super.c +131 -0
137 lines not on this page · raw message
fs/gfs2/recovery.c +22 -0
@@ -585,6 +585,28 @@ fail:return error; } +static struct gfs2_jdesc *gfs2_jdesc_find_dirty (struct gfs2_sbd *sdp) +{ +struct gfs2_jdesc *jd; +int found =0 ; + +spin_lock (&sdp->sd_jindex_spin); + +list_for_each_entry (jd, &sdp->sd_jindex_list, jd_list) { +if (jd->jd_dirty) { + jd->jd_dirty =0 ; + found =1 ; +break ; + } + } +spin_unlock (&sdp->sd_jindex_spin); + +if (!found) + jd =NULL ; + +return jd; +} +/** * gfs2_check_journals - Recover any dirty journals * @sdp: the filesystem
fs/gfs2/super.c +0 -164
176 lines not on this page · raw message
fs/gfs2/super.h +0 -4
@@ -28,8 +28,6 @@ static inline unsigned int gfs2_jindex_size(struct gfs2_sbd *sdp)void gfs2_jindex_free (struct gfs2_sbd *sdp);struct gfs2_jdesc *gfs2_jdesc_find (struct gfs2_sbd *sdp,unsigned int jid); -void gfs2_jdesc_make_dirty (struct gfs2_sbd *sdp,unsigned int jid); -struct gfs2_jdesc *gfs2_jdesc_find_dirty (struct gfs2_sbd *sdp);int gfs2_jdesc_check (struct gfs2_jdesc *jd); int gfs2_lookup_in_master_dir(struct gfs2_sbd *sdp, char *filename,
@@ -41,8 +39,6 @@ int gfs2_statfs_init(struct gfs2_sbd *sdp);void gfs2_statfs_change (struct gfs2_sbd *sdp,s64 total,s64 free,s64 dinodes);int gfs2_statfs_sync (struct gfs2_sbd *sdp); -int gfs2_statfs_i (struct gfs2_sbd *sdp,struct gfs2_statfs_change_host *sc); -int gfs2_statfs_slow (struct gfs2_sbd *sdp,struct gfs2_statfs_change_host *sc);int gfs2_freeze_fs (struct gfs2_sbd *sdp);void gfs2_unfreeze_fs (struct gfs2_sbd *sdp);
Signature · 1 line
1.5.5.1