Skip to content

Commit

Permalink
[XFS] Remove spin.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sandeen authored and Lachlan McIlroy committed Feb 7, 2008
1 parent 36e41ee commit 007c61c
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 45 deletions.
27 changes: 0 additions & 27 deletions fs/xfs/linux-2.6/spin.h

This file was deleted.

2 changes: 1 addition & 1 deletion fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ xfs_alloc_delwrite_queue(

INIT_LIST_HEAD(&btp->bt_list);
INIT_LIST_HEAD(&btp->bt_delwrite_queue);
spinlock_init(&btp->bt_delwrite_lock, "delwri_lock");
spin_lock_init(&btp->bt_delwrite_lock);
btp->bt_flags = 0;
btp->bt_task = kthread_run(xfsbufd, btp, "xfsbufd");
if (IS_ERR(btp->bt_task)) {
Expand Down
4 changes: 3 additions & 1 deletion fs/xfs/linux-2.6/xfs_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

#include <kmem.h>
#include <mrlock.h>
#include <spin.h>
#include <sv.h>
#include <mutex.h>
#include <sema.h>
Expand Down Expand Up @@ -75,6 +74,7 @@
#include <linux/notifier.h>
#include <linux/delay.h>
#include <linux/log2.h>
#include <linux/spinlock.h>

#include <asm/page.h>
#include <asm/div64.h>
Expand Down Expand Up @@ -136,6 +136,8 @@
#define current_restore_flags_nested(sp, f) \
(current->flags = ((current->flags & ~(f)) | (*(sp) & (f))))

#define spinlock_destroy(lock)

#define NBPP PAGE_SIZE
#define NDPP (1 << (PAGE_SHIFT - 9))

Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/quota/xfs_qm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ xfs_qm_init_quotainfo(
return error;
}

spinlock_init(&qinf->qi_pinlock, "xfs_qinf_pin");
spin_lock_init(&qinf->qi_pinlock);
xfs_qm_list_init(&qinf->qi_dqlist, "mpdqlist", 0);
qinf->qi_dqreclaims = 0;

Expand Down
1 change: 0 additions & 1 deletion fs/xfs/support/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
#include <xfs.h>
#include "debug.h"
#include "spin.h"

static char message[1024]; /* keep it off the stack */
static DEFINE_SPINLOCK(xfs_err_lock);
Expand Down
2 changes: 0 additions & 2 deletions fs/xfs/support/ktrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#ifndef __XFS_SUPPORT_KTRACE_H__
#define __XFS_SUPPORT_KTRACE_H__

#include <spin.h>

/*
* Trace buffer entry structure.
*/
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,7 @@ xfs_alloc_read_agf(
be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi]);
pag->pagf_levels[XFS_BTNUM_CNTi] =
be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]);
spinlock_init(&pag->pagb_lock, "xfspagb");
spin_lock_init(&pag->pagb_lock);
pag->pagb_list = kmem_zalloc(XFS_PAGB_NUM_SLOTS *
sizeof(xfs_perag_busy_t), KM_SLEEP);
pag->pagf_init = 1;
Expand Down
4 changes: 2 additions & 2 deletions fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,8 +1189,8 @@ xlog_alloc_log(xfs_mount_t *mp,
ASSERT(XFS_BUF_VALUSEMA(bp) <= 0);
log->l_xbuf = bp;

spinlock_init(&log->l_icloglock, "iclog");
spinlock_init(&log->l_grant_lock, "grhead_iclog");
spin_lock_init(&log->l_icloglock);
spin_lock_init(&log->l_grant_lock);
initnsema(&log->l_flushsema, 0, "ic-flush");
xlog_state_ticket_alloc(log); /* wait until after icloglock inited */

Expand Down
11 changes: 4 additions & 7 deletions fs/xfs/xfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ xfs_mount_init(void)
mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB;
}

spinlock_init(&mp->m_ail_lock, "xfs_ail");
spinlock_init(&mp->m_sb_lock, "xfs_sb");
spin_lock_init(&mp->m_ail_lock);
spin_lock_init(&mp->m_sb_lock);
mutex_init(&mp->m_ilock);
mutex_init(&mp->m_growlock);
/*
Expand Down Expand Up @@ -616,7 +616,7 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp)
int i;

mp->m_agfrotor = mp->m_agirotor = 0;
spinlock_init(&mp->m_agirotor_lock, "m_agirotor_lock");
spin_lock_init(&mp->m_agirotor_lock);
mp->m_maxagi = mp->m_sb.sb_agcount;
mp->m_blkbit_log = sbp->sb_blocklog + XFS_NBBYLOG;
mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
Expand Down Expand Up @@ -1916,7 +1916,6 @@ xfs_icsb_cpu_notify(
{
xfs_icsb_cnts_t *cntp;
xfs_mount_t *mp;
int s;

mp = (xfs_mount_t *)container_of(nfb, xfs_mount_t, m_icsb_notifier);
cntp = (xfs_icsb_cnts_t *)
Expand Down Expand Up @@ -2190,7 +2189,6 @@ xfs_icsb_sync_counters_flags(
int flags)
{
xfs_icsb_cnts_t cnt;
int s;

/* Pass 1: lock all counters */
if ((flags & XFS_ICSB_SB_LOCKED) == 0)
Expand Down Expand Up @@ -2248,7 +2246,6 @@ xfs_icsb_balance_counter(
{
uint64_t count, resid;
int weight = num_online_cpus();
int s;
uint64_t min = (uint64_t)min_per_cpu;

if (!(flags & XFS_ICSB_SB_LOCKED))
Expand Down Expand Up @@ -2298,7 +2295,7 @@ xfs_icsb_modify_counters(
{
xfs_icsb_cnts_t *icsbp;
long long lcounter; /* long counter for 64 bit fields */
int cpu, ret = 0, s;
int cpu, ret = 0;

might_sleep();
again:
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_mru_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ xfs_mru_cache_create(
*/
INIT_RADIX_TREE(&mru->store, GFP_ATOMIC);
INIT_LIST_HEAD(&mru->reap_list);
spinlock_init(&mru->lock, "xfs_mru_cache");
spin_lock_init(&mru->lock);
INIT_DELAYED_WORK(&mru->work, _xfs_mru_cache_reap);

mru->grp_time = grp_time;
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ xfs_init(void)
extern kmem_zone_t *xfs_dabuf_zone;
#ifdef XFS_DABUF_DEBUG
extern spinlock_t xfs_dabuf_global_lock;
spinlock_init(&xfs_dabuf_global_lock, "xfsda");
spin_lock_init(&xfs_dabuf_global_lock);
#endif

/*
Expand Down

0 comments on commit 007c61c

Please sign in to comment.