Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38619
b: refs/heads/master
c: 6a6b3d0
h: refs/heads/master
i:
  38617: f93c2cd
  38615: 0cf9731
v: v3
  • Loading branch information
David Teigland authored and Steven Whitehouse committed Feb 23, 2006
1 parent e1c0896 commit ce2794d
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 227 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d3b35a4af87965d1873872b21e504558f62116a
refs/heads/master: 6a6b3d018f4781f108d170f2181281a3c5589dc8
23 changes: 2 additions & 21 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ static void glock_free(struct gfs2_glock *gl)
gfs2_aspace_put(aspace);

kmem_cache_free(gfs2_glock_cachep, gl);

atomic_dec(&sdp->sd_glock_count);
}

/**
Expand Down Expand Up @@ -316,8 +314,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, uint64_t number,
if (error)
goto fail_aspace;

atomic_inc(&sdp->sd_glock_count);

write_lock(&bucket->hb_lock);
tmp = search_bucket(bucket, &name);
if (tmp) {
Expand Down Expand Up @@ -836,13 +832,10 @@ static void state_change(struct gfs2_glock *gl, unsigned int new_state)
held2 = (new_state != LM_ST_UNLOCKED);

if (held1 != held2) {
if (held2) {
atomic_inc(&sdp->sd_glock_held_count);
if (held2)
gfs2_glock_hold(gl);
} else {
atomic_dec(&sdp->sd_glock_held_count);
else
gfs2_glock_put(gl);
}
}

gl->gl_state = new_state;
Expand Down Expand Up @@ -994,8 +987,6 @@ void gfs2_glock_xmote_th(struct gfs2_glock *gl, unsigned int state, int flags)
gfs2_glock_hold(gl);
gl->gl_req_bh = xmote_bh;

atomic_inc(&sdp->sd_lm_lock_calls);

lck_ret = gfs2_lm_lock(sdp, gl->gl_lock, gl->gl_state, state,
lck_flags);

Expand Down Expand Up @@ -1087,8 +1078,6 @@ void gfs2_glock_drop_th(struct gfs2_glock *gl)
gfs2_glock_hold(gl);
gl->gl_req_bh = drop_bh;

atomic_inc(&sdp->sd_lm_unlock_calls);

ret = gfs2_lm_unlock(sdp, gl->gl_lock, gl->gl_state);

if (gfs2_assert_withdraw(sdp, !(ret & LM_OUT_ERROR)))
Expand Down Expand Up @@ -1313,8 +1302,6 @@ int gfs2_glock_nq(struct gfs2_holder *gh)
struct gfs2_sbd *sdp = gl->gl_sbd;
int error = 0;

atomic_inc(&sdp->sd_glock_nq_calls);

restart:
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
set_bit(HIF_ABORTED, &gh->gh_iflags);
Expand Down Expand Up @@ -1406,8 +1393,6 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
struct gfs2_sbd *sdp = gl->gl_sbd;
struct gfs2_glock_operations *glops = gl->gl_ops;

atomic_inc(&sdp->sd_glock_dq_calls);

if (gh->gh_flags & GL_SYNC)
set_bit(GLF_SYNC, &gl->gl_flags);

Expand Down Expand Up @@ -1469,8 +1454,6 @@ void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state, int flags)
spin_unlock(&gl->gl_spin);

glops->go_xmote_th(gl, state, flags);

atomic_inc(&gl->gl_sbd->sd_glock_prefetch_calls);
}

/**
Expand Down Expand Up @@ -1916,8 +1899,6 @@ void gfs2_glock_cb(lm_fsdata_t *fsdata, unsigned int type, void *data)
{
struct gfs2_sbd *sdp = (struct gfs2_sbd *)fsdata;

atomic_inc(&sdp->sd_lm_callbacks);

switch (type) {
case LM_CB_NEED_E:
blocking_cb(sdp, (struct lm_lockname *)data, LM_ST_UNLOCKED);
Expand Down
20 changes: 0 additions & 20 deletions trunk/fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,27 +667,7 @@ struct gfs2_sbd {
atomic_t sd_glock_count;
atomic_t sd_glock_held_count;
atomic_t sd_inode_count;
atomic_t sd_bufdata_count;

atomic_t sd_fh2dentry_misses;
atomic_t sd_reclaimed;
atomic_t sd_log_flush_incore;
atomic_t sd_log_flush_ondisk;

atomic_t sd_glock_nq_calls;
atomic_t sd_glock_dq_calls;
atomic_t sd_glock_prefetch_calls;
atomic_t sd_lm_lock_calls;
atomic_t sd_lm_unlock_calls;
atomic_t sd_lm_callbacks;

atomic_t sd_ops_address;
atomic_t sd_ops_dentry;
atomic_t sd_ops_export;
atomic_t sd_ops_file;
atomic_t sd_ops_inode;
atomic_t sd_ops_super;
atomic_t sd_ops_vm;

char sd_fsname[GFS2_FSNAME_LEN];
char sd_table_name[GFS2_FSNAME_LEN];
Expand Down
4 changes: 0 additions & 4 deletions trunk/fs/gfs2/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,6 @@ static void log_write_header(struct gfs2_sbd *sdp, uint32_t flags, int pull)
unsigned int tail;
uint32_t hash;

atomic_inc(&sdp->sd_log_flush_ondisk);

bh = sb_getblk(sdp->sd_vfs, blkno);
lock_buffer(bh);
memset(bh->b_data, 0, bh->b_size);
Expand Down Expand Up @@ -488,8 +486,6 @@ void gfs2_log_flush_i(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
{
struct gfs2_ail *ai;

atomic_inc(&sdp->sd_log_flush_incore);

ai = kzalloc(sizeof(struct gfs2_ail), GFP_NOFS | __GFP_NOFAIL);
INIT_LIST_HEAD(&ai->ai_ail1_list);
INIT_LIST_HEAD(&ai->ai_ail2_list);
Expand Down
3 changes: 0 additions & 3 deletions trunk/fs/gfs2/meta_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ static int gfs2_aspace_releasepage(struct page *page, gfp_t gfp_mask)
gfs2_assert_warn(sdp, list_empty(&bd->bd_le.le_list));
gfs2_assert_warn(sdp, !bd->bd_ail);
kmem_cache_free(gfs2_bufdata_cachep, bd);
atomic_dec(&sdp->sd_bufdata_count);
set_v2bd(bh, NULL);
}

Expand Down Expand Up @@ -557,8 +556,6 @@ void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, int meta
}

bd = kmem_cache_alloc(gfs2_bufdata_cachep, GFP_NOFS | __GFP_NOFAIL),
atomic_inc(&gl->gl_sbd->sd_bufdata_count);

memset(bd, 0, sizeof(struct gfs2_bufdata));

bd->bd_bh = bh;
Expand Down
12 changes: 0 additions & 12 deletions trunk/fs/gfs2/ops_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
int error;
int done_trans = 0;

atomic_inc(&sdp->sd_ops_address);
if (gfs2_assert_withdraw(sdp, gfs2_glock_is_held_excl(ip->i_gl))) {
unlock_page(page);
return -EIO;
Expand Down Expand Up @@ -265,8 +264,6 @@ static int gfs2_readpage(struct file *file, struct page *page)
struct gfs2_holder gh;
int error;

atomic_inc(&sdp->sd_ops_address);

if (file != &gfs2_internal_file_sentinal) {
gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &gh);
error = gfs2_glock_nq_m_atime(1, &gh);
Expand Down Expand Up @@ -319,8 +316,6 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
loff_t end = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
struct gfs2_alloc *al;

atomic_inc(&sdp->sd_ops_address);

gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME, &ip->i_gh);
error = gfs2_glock_nq_m_atime(1, &ip->i_gh);
if (error)
Expand Down Expand Up @@ -412,9 +407,6 @@ static int gfs2_commit_write(struct file *file, struct page *page,
struct buffer_head *dibh;
struct gfs2_alloc *al = &ip->i_alloc;;

atomic_inc(&sdp->sd_ops_address);


if (gfs2_assert_withdraw(sdp, gfs2_glock_is_locked_by_me(ip->i_gl)))
goto fail_nounlock;

Expand Down Expand Up @@ -493,8 +485,6 @@ static sector_t gfs2_bmap(struct address_space *mapping, sector_t lblock)
sector_t dblock = 0;
int error;

atomic_inc(&ip->i_sbd->sd_ops_address);

error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
if (error)
return 0;
Expand Down Expand Up @@ -615,8 +605,6 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
struct gfs2_inode *ip = get_v2ip(inode);
struct gfs2_sbd *sdp = ip->i_sbd;

atomic_inc(&sdp->sd_ops_address);

if (rw == WRITE)
return gfs2_direct_IO_write(iocb, iov, offset, nr_segs);

Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/gfs2/ops_dentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ static int gfs2_drevalidate(struct dentry *dentry, struct nameidata *nd)

lock_kernel();

atomic_inc(&sdp->sd_ops_dentry);

inode = dentry->d_inode;
if (inode && is_bad_inode(inode))
goto invalid;
Expand Down
12 changes: 0 additions & 12 deletions trunk/fs/gfs2/ops_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ static struct dentry *gfs2_decode_fh(struct super_block *sb,
{
struct gfs2_inum this, parent;

atomic_inc(&get_v2sdp(sb)->sd_ops_export);

if (fh_type != fh_len)
return NULL;

Expand Down Expand Up @@ -66,8 +64,6 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
struct gfs2_inode *ip = get_v2ip(inode);
struct gfs2_sbd *sdp = ip->i_sbd;

atomic_inc(&sdp->sd_ops_export);

if (*len < 4 || (connectable && *len < 8))
return 255;

Expand Down Expand Up @@ -139,8 +135,6 @@ static int gfs2_get_name(struct dentry *parent, char *name,
if (!dir)
return -EINVAL;

atomic_inc(&get_v2sdp(dir->i_sb)->sd_ops_export);

if (!S_ISDIR(dir->i_mode) || !inode)
return -EINVAL;

Expand Down Expand Up @@ -173,8 +167,6 @@ static struct dentry *gfs2_get_parent(struct dentry *child)
struct dentry *dentry;
int error;

atomic_inc(&dip->i_sbd->sd_ops_export);

error = gfs2_lookupi(child->d_inode, &dotdot, 1, &inode);
if (error)
return ERR_PTR(error);
Expand All @@ -199,8 +191,6 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_p)
struct dentry *dentry;
int error;

atomic_inc(&sdp->sd_ops_export);

/* System files? */

inode = gfs2_iget(sb, inum);
Expand Down Expand Up @@ -256,8 +246,6 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_p)
goto fail;
}

atomic_inc(&sdp->sd_fh2dentry_misses);

out_ip:
error = -EIO;
if (ip->i_di.di_flags & GFS2_DIF_SYSTEM) {
Expand Down
29 changes: 2 additions & 27 deletions trunk/fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ static loff_t gfs2_llseek(struct file *file, loff_t offset, int origin)
struct gfs2_holder i_gh;
loff_t error;

atomic_inc(&ip->i_sbd->sd_ops_file);

if (origin == 2) {
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY,
&i_gh);
Expand Down Expand Up @@ -278,8 +276,6 @@ static ssize_t gfs2_read(struct file *filp, char __user *buf, size_t size,
struct kiocb kiocb;
ssize_t ret;

atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file);

init_sync_kiocb(&kiocb, filp);
ret = __gfs2_file_aio_read(&kiocb, &local_iov, 1, offset);
if (-EIOCBQUEUED == ret)
Expand All @@ -293,8 +289,6 @@ static ssize_t gfs2_file_readv(struct file *filp, const struct iovec *iov,
struct kiocb kiocb;
ssize_t ret;

atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file);

init_sync_kiocb(&kiocb, filp);
ret = __gfs2_file_aio_read(&kiocb, iov, nr_segs, ppos);
if (-EIOCBQUEUED == ret)
Expand All @@ -308,8 +302,6 @@ static ssize_t gfs2_file_aio_read(struct kiocb *iocb, char __user *buf,
struct file *filp = iocb->ki_filp;
struct iovec local_iov = { .iov_base = buf, .iov_len = count };

atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file);

BUG_ON(iocb->ki_pos != pos);
return __gfs2_file_aio_read(iocb, &local_iov, 1, &iocb->ki_pos);
}
Expand Down Expand Up @@ -529,8 +521,6 @@ static int gfs2_readdir(struct file *file, void *dirent, filldir_t filldir)
{
int error;

atomic_inc(&get_v2sdp(file->f_mapping->host->i_sb)->sd_ops_file);

if (strcmp(current->comm, "nfsd") != 0)
error = readdir_reg(file, dirent, filldir);
else
Expand All @@ -539,7 +529,8 @@ static int gfs2_readdir(struct file *file, void *dirent, filldir_t filldir)
return error;
}

static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd, unsigned long arg)
static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd,
unsigned long arg)
{
unsigned int lmode = (cmd == GFS2_IOCTL_SETFLAGS) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
struct buffer_head *dibh;
Expand Down Expand Up @@ -618,8 +609,6 @@ static int gfs2_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{
struct gfs2_inode *ip = get_v2ip(inode);

atomic_inc(&ip->i_sbd->sd_ops_file);

switch (cmd) {
case GFS2_IOCTL_SETFLAGS:
case GFS2_IOCTL_GETFLAGS:
Expand All @@ -644,8 +633,6 @@ static int gfs2_mmap(struct file *file, struct vm_area_struct *vma)
struct gfs2_holder i_gh;
int error;

atomic_inc(&ip->i_sbd->sd_ops_file);

gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &i_gh);
error = gfs2_glock_nq_atime(&i_gh);
if (error) {
Expand Down Expand Up @@ -682,8 +669,6 @@ static int gfs2_open(struct inode *inode, struct file *file)
struct gfs2_file *fp;
int error;

atomic_inc(&ip->i_sbd->sd_ops_file);

fp = kzalloc(sizeof(struct gfs2_file), GFP_KERNEL);
if (!fp)
return -ENOMEM;
Expand Down Expand Up @@ -741,8 +726,6 @@ static int gfs2_close(struct inode *inode, struct file *file)
struct gfs2_sbd *sdp = get_v2sdp(inode->i_sb);
struct gfs2_file *fp;

atomic_inc(&sdp->sd_ops_file);

fp = get_v2fp(file);
set_v2fp(file, NULL);

Expand All @@ -766,7 +749,6 @@ static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync)
{
struct gfs2_inode *ip = get_v2ip(dentry->d_inode);

atomic_inc(&ip->i_sbd->sd_ops_file);
gfs2_log_flush_glock(ip->i_gl);

return 0;
Expand All @@ -789,8 +771,6 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
{ .ln_number = ip->i_num.no_addr,
.ln_type = LM_TYPE_PLOCK };

atomic_inc(&sdp->sd_ops_file);

if (!(fl->fl_flags & FL_POSIX))
return -ENOLCK;
if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
Expand Down Expand Up @@ -839,9 +819,6 @@ static ssize_t gfs2_sendfile(struct file *in_file, loff_t *offset, size_t count,
read_actor_t actor, void *target)
{
struct gfs2_inode *ip = get_v2ip(in_file->f_mapping->host);

atomic_inc(&ip->i_sbd->sd_ops_file);

return generic_file_sendfile(in_file, offset, count, actor, target);
}

Expand Down Expand Up @@ -921,8 +898,6 @@ static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl)
struct gfs2_inode *ip = get_v2ip(file->f_mapping->host);
struct gfs2_sbd *sdp = ip->i_sbd;

atomic_inc(&ip->i_sbd->sd_ops_file);

if (!(fl->fl_flags & FL_FLOCK))
return -ENOLCK;
if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
Expand Down
Loading

0 comments on commit ce2794d

Please sign in to comment.