diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2007-10-11 03:43:56 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-07 00:47:45 -0500 |
commit | 007c61c68640ea17c036785b698d05da67b4365e (patch) | |
tree | d4d4bc3d9268d174f42f45dc67844905f0e5933d | |
parent | 36e41eebdafc8b5fabdf66f59d0d43b0b60f0fdb (diff) |
[XFS] Remove spin.h
remove spinlock init abstraction macro in spin.h, remove the callers, and
remove the file. Move no-op spinlock_destroy to xfs_linux.h Cleanup
spinlock locals in xfs_mount.c
SGI-PV: 970382
SGI-Modid: xfs-linux-melb:xfs-kern:29751a
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Donald Douwsma <donaldd@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
-rw-r--r-- | fs/xfs/linux-2.6/spin.h | 27 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_linux.h | 4 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 2 | ||||
-rw-r--r-- | fs/xfs/support/debug.c | 1 | ||||
-rw-r--r-- | fs/xfs/support/ktrace.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_alloc.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_log.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.c | 11 | ||||
-rw-r--r-- | fs/xfs/xfs_mru_cache.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_vfsops.c | 2 |
11 files changed, 14 insertions, 45 deletions
diff --git a/fs/xfs/linux-2.6/spin.h b/fs/xfs/linux-2.6/spin.h deleted file mode 100644 index aa23557801b3..000000000000 --- a/fs/xfs/linux-2.6/spin.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. | ||
3 | * All Rights Reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it would be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write the Free Software Foundation, | ||
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | #ifndef __XFS_SUPPORT_SPIN_H__ | ||
19 | #define __XFS_SUPPORT_SPIN_H__ | ||
20 | |||
21 | #include <linux/sched.h> /* preempt needs this */ | ||
22 | #include <linux/spinlock.h> | ||
23 | |||
24 | #define spinlock_init(lock, name) spin_lock_init(lock) | ||
25 | #define spinlock_destroy(lock) | ||
26 | |||
27 | #endif /* __XFS_SUPPORT_SPIN_H__ */ | ||
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index a49dd8d4b069..522cfaa70258 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -1572,7 +1572,7 @@ xfs_alloc_delwrite_queue( | |||
1572 | 1572 | ||
1573 | INIT_LIST_HEAD(&btp->bt_list); | 1573 | INIT_LIST_HEAD(&btp->bt_list); |
1574 | INIT_LIST_HEAD(&btp->bt_delwrite_queue); | 1574 | INIT_LIST_HEAD(&btp->bt_delwrite_queue); |
1575 | spinlock_init(&btp->bt_delwrite_lock, "delwri_lock"); | 1575 | spin_lock_init(&btp->bt_delwrite_lock); |
1576 | btp->bt_flags = 0; | 1576 | btp->bt_flags = 0; |
1577 | btp->bt_task = kthread_run(xfsbufd, btp, "xfsbufd"); | 1577 | btp->bt_task = kthread_run(xfsbufd, btp, "xfsbufd"); |
1578 | if (IS_ERR(btp->bt_task)) { | 1578 | if (IS_ERR(btp->bt_task)) { |
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index dc3752de22da..ec51ecd13877 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h | |||
@@ -43,7 +43,6 @@ | |||
43 | 43 | ||
44 | #include <kmem.h> | 44 | #include <kmem.h> |
45 | #include <mrlock.h> | 45 | #include <mrlock.h> |
46 | #include <spin.h> | ||
47 | #include <sv.h> | 46 | #include <sv.h> |
48 | #include <mutex.h> | 47 | #include <mutex.h> |
49 | #include <sema.h> | 48 | #include <sema.h> |
@@ -75,6 +74,7 @@ | |||
75 | #include <linux/notifier.h> | 74 | #include <linux/notifier.h> |
76 | #include <linux/delay.h> | 75 | #include <linux/delay.h> |
77 | #include <linux/log2.h> | 76 | #include <linux/log2.h> |
77 | #include <linux/spinlock.h> | ||
78 | 78 | ||
79 | #include <asm/page.h> | 79 | #include <asm/page.h> |
80 | #include <asm/div64.h> | 80 | #include <asm/div64.h> |
@@ -136,6 +136,8 @@ | |||
136 | #define current_restore_flags_nested(sp, f) \ | 136 | #define current_restore_flags_nested(sp, f) \ |
137 | (current->flags = ((current->flags & ~(f)) | (*(sp) & (f)))) | 137 | (current->flags = ((current->flags & ~(f)) | (*(sp) & (f)))) |
138 | 138 | ||
139 | #define spinlock_destroy(lock) | ||
140 | |||
139 | #define NBPP PAGE_SIZE | 141 | #define NBPP PAGE_SIZE |
140 | #define NDPP (1 << (PAGE_SHIFT - 9)) | 142 | #define NDPP (1 << (PAGE_SHIFT - 9)) |
141 | 143 | ||
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 08b44758035e..35582fe9d648 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -1138,7 +1138,7 @@ xfs_qm_init_quotainfo( | |||
1138 | return error; | 1138 | return error; |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | spinlock_init(&qinf->qi_pinlock, "xfs_qinf_pin"); | 1141 | spin_lock_init(&qinf->qi_pinlock); |
1142 | xfs_qm_list_init(&qinf->qi_dqlist, "mpdqlist", 0); | 1142 | xfs_qm_list_init(&qinf->qi_dqlist, "mpdqlist", 0); |
1143 | qinf->qi_dqreclaims = 0; | 1143 | qinf->qi_dqreclaims = 0; |
1144 | 1144 | ||
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c index f45a49ffd3a3..fa4fb1820e75 100644 --- a/fs/xfs/support/debug.c +++ b/fs/xfs/support/debug.c | |||
@@ -17,7 +17,6 @@ | |||
17 | */ | 17 | */ |
18 | #include <xfs.h> | 18 | #include <xfs.h> |
19 | #include "debug.h" | 19 | #include "debug.h" |
20 | #include "spin.h" | ||
21 | 20 | ||
22 | static char message[1024]; /* keep it off the stack */ | 21 | static char message[1024]; /* keep it off the stack */ |
23 | static DEFINE_SPINLOCK(xfs_err_lock); | 22 | static DEFINE_SPINLOCK(xfs_err_lock); |
diff --git a/fs/xfs/support/ktrace.h b/fs/xfs/support/ktrace.h index 1e6d4a38ba28..56e72b40a859 100644 --- a/fs/xfs/support/ktrace.h +++ b/fs/xfs/support/ktrace.h | |||
@@ -18,8 +18,6 @@ | |||
18 | #ifndef __XFS_SUPPORT_KTRACE_H__ | 18 | #ifndef __XFS_SUPPORT_KTRACE_H__ |
19 | #define __XFS_SUPPORT_KTRACE_H__ | 19 | #define __XFS_SUPPORT_KTRACE_H__ |
20 | 20 | ||
21 | #include <spin.h> | ||
22 | |||
23 | /* | 21 | /* |
24 | * Trace buffer entry structure. | 22 | * Trace buffer entry structure. |
25 | */ | 23 | */ |
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index c23fb2aaa339..ea6aa60ace06 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c | |||
@@ -2206,7 +2206,7 @@ xfs_alloc_read_agf( | |||
2206 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi]); | 2206 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi]); |
2207 | pag->pagf_levels[XFS_BTNUM_CNTi] = | 2207 | pag->pagf_levels[XFS_BTNUM_CNTi] = |
2208 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]); | 2208 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]); |
2209 | spinlock_init(&pag->pagb_lock, "xfspagb"); | 2209 | spin_lock_init(&pag->pagb_lock); |
2210 | pag->pagb_list = kmem_zalloc(XFS_PAGB_NUM_SLOTS * | 2210 | pag->pagb_list = kmem_zalloc(XFS_PAGB_NUM_SLOTS * |
2211 | sizeof(xfs_perag_busy_t), KM_SLEEP); | 2211 | sizeof(xfs_perag_busy_t), KM_SLEEP); |
2212 | pag->pagf_init = 1; | 2212 | pag->pagf_init = 1; |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index f1f1f36876e4..615638201284 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -1189,8 +1189,8 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1189 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); | 1189 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); |
1190 | log->l_xbuf = bp; | 1190 | log->l_xbuf = bp; |
1191 | 1191 | ||
1192 | spinlock_init(&log->l_icloglock, "iclog"); | 1192 | spin_lock_init(&log->l_icloglock); |
1193 | spinlock_init(&log->l_grant_lock, "grhead_iclog"); | 1193 | spin_lock_init(&log->l_grant_lock); |
1194 | initnsema(&log->l_flushsema, 0, "ic-flush"); | 1194 | initnsema(&log->l_flushsema, 0, "ic-flush"); |
1195 | xlog_state_ticket_alloc(log); /* wait until after icloglock inited */ | 1195 | xlog_state_ticket_alloc(log); /* wait until after icloglock inited */ |
1196 | 1196 | ||
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 6bc92c85733f..6115f371663d 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -136,8 +136,8 @@ xfs_mount_init(void) | |||
136 | mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; | 136 | mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; |
137 | } | 137 | } |
138 | 138 | ||
139 | spinlock_init(&mp->m_ail_lock, "xfs_ail"); | 139 | spin_lock_init(&mp->m_ail_lock); |
140 | spinlock_init(&mp->m_sb_lock, "xfs_sb"); | 140 | spin_lock_init(&mp->m_sb_lock); |
141 | mutex_init(&mp->m_ilock); | 141 | mutex_init(&mp->m_ilock); |
142 | mutex_init(&mp->m_growlock); | 142 | mutex_init(&mp->m_growlock); |
143 | /* | 143 | /* |
@@ -616,7 +616,7 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp) | |||
616 | int i; | 616 | int i; |
617 | 617 | ||
618 | mp->m_agfrotor = mp->m_agirotor = 0; | 618 | mp->m_agfrotor = mp->m_agirotor = 0; |
619 | spinlock_init(&mp->m_agirotor_lock, "m_agirotor_lock"); | 619 | spin_lock_init(&mp->m_agirotor_lock); |
620 | mp->m_maxagi = mp->m_sb.sb_agcount; | 620 | mp->m_maxagi = mp->m_sb.sb_agcount; |
621 | mp->m_blkbit_log = sbp->sb_blocklog + XFS_NBBYLOG; | 621 | mp->m_blkbit_log = sbp->sb_blocklog + XFS_NBBYLOG; |
622 | mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT; | 622 | mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT; |
@@ -1916,7 +1916,6 @@ xfs_icsb_cpu_notify( | |||
1916 | { | 1916 | { |
1917 | xfs_icsb_cnts_t *cntp; | 1917 | xfs_icsb_cnts_t *cntp; |
1918 | xfs_mount_t *mp; | 1918 | xfs_mount_t *mp; |
1919 | int s; | ||
1920 | 1919 | ||
1921 | mp = (xfs_mount_t *)container_of(nfb, xfs_mount_t, m_icsb_notifier); | 1920 | mp = (xfs_mount_t *)container_of(nfb, xfs_mount_t, m_icsb_notifier); |
1922 | cntp = (xfs_icsb_cnts_t *) | 1921 | cntp = (xfs_icsb_cnts_t *) |
@@ -2190,7 +2189,6 @@ xfs_icsb_sync_counters_flags( | |||
2190 | int flags) | 2189 | int flags) |
2191 | { | 2190 | { |
2192 | xfs_icsb_cnts_t cnt; | 2191 | xfs_icsb_cnts_t cnt; |
2193 | int s; | ||
2194 | 2192 | ||
2195 | /* Pass 1: lock all counters */ | 2193 | /* Pass 1: lock all counters */ |
2196 | if ((flags & XFS_ICSB_SB_LOCKED) == 0) | 2194 | if ((flags & XFS_ICSB_SB_LOCKED) == 0) |
@@ -2248,7 +2246,6 @@ xfs_icsb_balance_counter( | |||
2248 | { | 2246 | { |
2249 | uint64_t count, resid; | 2247 | uint64_t count, resid; |
2250 | int weight = num_online_cpus(); | 2248 | int weight = num_online_cpus(); |
2251 | int s; | ||
2252 | uint64_t min = (uint64_t)min_per_cpu; | 2249 | uint64_t min = (uint64_t)min_per_cpu; |
2253 | 2250 | ||
2254 | if (!(flags & XFS_ICSB_SB_LOCKED)) | 2251 | if (!(flags & XFS_ICSB_SB_LOCKED)) |
@@ -2298,7 +2295,7 @@ xfs_icsb_modify_counters( | |||
2298 | { | 2295 | { |
2299 | xfs_icsb_cnts_t *icsbp; | 2296 | xfs_icsb_cnts_t *icsbp; |
2300 | long long lcounter; /* long counter for 64 bit fields */ | 2297 | long long lcounter; /* long counter for 64 bit fields */ |
2301 | int cpu, ret = 0, s; | 2298 | int cpu, ret = 0; |
2302 | 2299 | ||
2303 | might_sleep(); | 2300 | might_sleep(); |
2304 | again: | 2301 | again: |
diff --git a/fs/xfs/xfs_mru_cache.c b/fs/xfs/xfs_mru_cache.c index dc64630e870e..012209eda35d 100644 --- a/fs/xfs/xfs_mru_cache.c +++ b/fs/xfs/xfs_mru_cache.c | |||
@@ -368,7 +368,7 @@ xfs_mru_cache_create( | |||
368 | */ | 368 | */ |
369 | INIT_RADIX_TREE(&mru->store, GFP_ATOMIC); | 369 | INIT_RADIX_TREE(&mru->store, GFP_ATOMIC); |
370 | INIT_LIST_HEAD(&mru->reap_list); | 370 | INIT_LIST_HEAD(&mru->reap_list); |
371 | spinlock_init(&mru->lock, "xfs_mru_cache"); | 371 | spin_lock_init(&mru->lock); |
372 | INIT_DELAYED_WORK(&mru->work, _xfs_mru_cache_reap); | 372 | INIT_DELAYED_WORK(&mru->work, _xfs_mru_cache_reap); |
373 | 373 | ||
374 | mru->grp_time = grp_time; | 374 | mru->grp_time = grp_time; |
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 44f0216c03e9..f5844678d45e 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
@@ -68,7 +68,7 @@ xfs_init(void) | |||
68 | extern kmem_zone_t *xfs_dabuf_zone; | 68 | extern kmem_zone_t *xfs_dabuf_zone; |
69 | #ifdef XFS_DABUF_DEBUG | 69 | #ifdef XFS_DABUF_DEBUG |
70 | extern spinlock_t xfs_dabuf_global_lock; | 70 | extern spinlock_t xfs_dabuf_global_lock; |
71 | spinlock_init(&xfs_dabuf_global_lock, "xfsda"); | 71 | spin_lock_init(&xfs_dabuf_global_lock); |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | /* | 74 | /* |