diff options
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r-- | fs/gfs2/ops_file.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index cf2e26e07245..0f80e9306016 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c | |||
@@ -129,8 +129,6 @@ static loff_t gfs2_llseek(struct file *file, loff_t offset, int origin) | |||
129 | struct gfs2_holder i_gh; | 129 | struct gfs2_holder i_gh; |
130 | loff_t error; | 130 | loff_t error; |
131 | 131 | ||
132 | atomic_inc(&ip->i_sbd->sd_ops_file); | ||
133 | |||
134 | if (origin == 2) { | 132 | if (origin == 2) { |
135 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, | 133 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, |
136 | &i_gh); | 134 | &i_gh); |
@@ -278,8 +276,6 @@ static ssize_t gfs2_read(struct file *filp, char __user *buf, size_t size, | |||
278 | struct kiocb kiocb; | 276 | struct kiocb kiocb; |
279 | ssize_t ret; | 277 | ssize_t ret; |
280 | 278 | ||
281 | atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file); | ||
282 | |||
283 | init_sync_kiocb(&kiocb, filp); | 279 | init_sync_kiocb(&kiocb, filp); |
284 | ret = __gfs2_file_aio_read(&kiocb, &local_iov, 1, offset); | 280 | ret = __gfs2_file_aio_read(&kiocb, &local_iov, 1, offset); |
285 | if (-EIOCBQUEUED == ret) | 281 | if (-EIOCBQUEUED == ret) |
@@ -293,8 +289,6 @@ static ssize_t gfs2_file_readv(struct file *filp, const struct iovec *iov, | |||
293 | struct kiocb kiocb; | 289 | struct kiocb kiocb; |
294 | ssize_t ret; | 290 | ssize_t ret; |
295 | 291 | ||
296 | atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file); | ||
297 | |||
298 | init_sync_kiocb(&kiocb, filp); | 292 | init_sync_kiocb(&kiocb, filp); |
299 | ret = __gfs2_file_aio_read(&kiocb, iov, nr_segs, ppos); | 293 | ret = __gfs2_file_aio_read(&kiocb, iov, nr_segs, ppos); |
300 | if (-EIOCBQUEUED == ret) | 294 | if (-EIOCBQUEUED == ret) |
@@ -308,8 +302,6 @@ static ssize_t gfs2_file_aio_read(struct kiocb *iocb, char __user *buf, | |||
308 | struct file *filp = iocb->ki_filp; | 302 | struct file *filp = iocb->ki_filp; |
309 | struct iovec local_iov = { .iov_base = buf, .iov_len = count }; | 303 | struct iovec local_iov = { .iov_base = buf, .iov_len = count }; |
310 | 304 | ||
311 | atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file); | ||
312 | |||
313 | BUG_ON(iocb->ki_pos != pos); | 305 | BUG_ON(iocb->ki_pos != pos); |
314 | return __gfs2_file_aio_read(iocb, &local_iov, 1, &iocb->ki_pos); | 306 | return __gfs2_file_aio_read(iocb, &local_iov, 1, &iocb->ki_pos); |
315 | } | 307 | } |
@@ -529,8 +521,6 @@ static int gfs2_readdir(struct file *file, void *dirent, filldir_t filldir) | |||
529 | { | 521 | { |
530 | int error; | 522 | int error; |
531 | 523 | ||
532 | atomic_inc(&get_v2sdp(file->f_mapping->host->i_sb)->sd_ops_file); | ||
533 | |||
534 | if (strcmp(current->comm, "nfsd") != 0) | 524 | if (strcmp(current->comm, "nfsd") != 0) |
535 | error = readdir_reg(file, dirent, filldir); | 525 | error = readdir_reg(file, dirent, filldir); |
536 | else | 526 | else |
@@ -539,7 +529,8 @@ static int gfs2_readdir(struct file *file, void *dirent, filldir_t filldir) | |||
539 | return error; | 529 | return error; |
540 | } | 530 | } |
541 | 531 | ||
542 | static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd, unsigned long arg) | 532 | static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd, |
533 | unsigned long arg) | ||
543 | { | 534 | { |
544 | unsigned int lmode = (cmd == GFS2_IOCTL_SETFLAGS) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; | 535 | unsigned int lmode = (cmd == GFS2_IOCTL_SETFLAGS) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; |
545 | struct buffer_head *dibh; | 536 | struct buffer_head *dibh; |
@@ -618,8 +609,6 @@ static int gfs2_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
618 | { | 609 | { |
619 | struct gfs2_inode *ip = get_v2ip(inode); | 610 | struct gfs2_inode *ip = get_v2ip(inode); |
620 | 611 | ||
621 | atomic_inc(&ip->i_sbd->sd_ops_file); | ||
622 | |||
623 | switch (cmd) { | 612 | switch (cmd) { |
624 | case GFS2_IOCTL_SETFLAGS: | 613 | case GFS2_IOCTL_SETFLAGS: |
625 | case GFS2_IOCTL_GETFLAGS: | 614 | case GFS2_IOCTL_GETFLAGS: |
@@ -644,8 +633,6 @@ static int gfs2_mmap(struct file *file, struct vm_area_struct *vma) | |||
644 | struct gfs2_holder i_gh; | 633 | struct gfs2_holder i_gh; |
645 | int error; | 634 | int error; |
646 | 635 | ||
647 | atomic_inc(&ip->i_sbd->sd_ops_file); | ||
648 | |||
649 | gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &i_gh); | 636 | gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &i_gh); |
650 | error = gfs2_glock_nq_atime(&i_gh); | 637 | error = gfs2_glock_nq_atime(&i_gh); |
651 | if (error) { | 638 | if (error) { |
@@ -682,8 +669,6 @@ static int gfs2_open(struct inode *inode, struct file *file) | |||
682 | struct gfs2_file *fp; | 669 | struct gfs2_file *fp; |
683 | int error; | 670 | int error; |
684 | 671 | ||
685 | atomic_inc(&ip->i_sbd->sd_ops_file); | ||
686 | |||
687 | fp = kzalloc(sizeof(struct gfs2_file), GFP_KERNEL); | 672 | fp = kzalloc(sizeof(struct gfs2_file), GFP_KERNEL); |
688 | if (!fp) | 673 | if (!fp) |
689 | return -ENOMEM; | 674 | return -ENOMEM; |
@@ -741,8 +726,6 @@ static int gfs2_close(struct inode *inode, struct file *file) | |||
741 | struct gfs2_sbd *sdp = get_v2sdp(inode->i_sb); | 726 | struct gfs2_sbd *sdp = get_v2sdp(inode->i_sb); |
742 | struct gfs2_file *fp; | 727 | struct gfs2_file *fp; |
743 | 728 | ||
744 | atomic_inc(&sdp->sd_ops_file); | ||
745 | |||
746 | fp = get_v2fp(file); | 729 | fp = get_v2fp(file); |
747 | set_v2fp(file, NULL); | 730 | set_v2fp(file, NULL); |
748 | 731 | ||
@@ -766,7 +749,6 @@ static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
766 | { | 749 | { |
767 | struct gfs2_inode *ip = get_v2ip(dentry->d_inode); | 750 | struct gfs2_inode *ip = get_v2ip(dentry->d_inode); |
768 | 751 | ||
769 | atomic_inc(&ip->i_sbd->sd_ops_file); | ||
770 | gfs2_log_flush_glock(ip->i_gl); | 752 | gfs2_log_flush_glock(ip->i_gl); |
771 | 753 | ||
772 | return 0; | 754 | return 0; |
@@ -789,8 +771,6 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) | |||
789 | { .ln_number = ip->i_num.no_addr, | 771 | { .ln_number = ip->i_num.no_addr, |
790 | .ln_type = LM_TYPE_PLOCK }; | 772 | .ln_type = LM_TYPE_PLOCK }; |
791 | 773 | ||
792 | atomic_inc(&sdp->sd_ops_file); | ||
793 | |||
794 | if (!(fl->fl_flags & FL_POSIX)) | 774 | if (!(fl->fl_flags & FL_POSIX)) |
795 | return -ENOLCK; | 775 | return -ENOLCK; |
796 | if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID) | 776 | if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID) |
@@ -839,9 +819,6 @@ static ssize_t gfs2_sendfile(struct file *in_file, loff_t *offset, size_t count, | |||
839 | read_actor_t actor, void *target) | 819 | read_actor_t actor, void *target) |
840 | { | 820 | { |
841 | struct gfs2_inode *ip = get_v2ip(in_file->f_mapping->host); | 821 | struct gfs2_inode *ip = get_v2ip(in_file->f_mapping->host); |
842 | |||
843 | atomic_inc(&ip->i_sbd->sd_ops_file); | ||
844 | |||
845 | return generic_file_sendfile(in_file, offset, count, actor, target); | 822 | return generic_file_sendfile(in_file, offset, count, actor, target); |
846 | } | 823 | } |
847 | 824 | ||
@@ -921,8 +898,6 @@ static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl) | |||
921 | struct gfs2_inode *ip = get_v2ip(file->f_mapping->host); | 898 | struct gfs2_inode *ip = get_v2ip(file->f_mapping->host); |
922 | struct gfs2_sbd *sdp = ip->i_sbd; | 899 | struct gfs2_sbd *sdp = ip->i_sbd; |
923 | 900 | ||
924 | atomic_inc(&ip->i_sbd->sd_ops_file); | ||
925 | |||
926 | if (!(fl->fl_flags & FL_FLOCK)) | 901 | if (!(fl->fl_flags & FL_FLOCK)) |
927 | return -ENOLCK; | 902 | return -ENOLCK; |
928 | if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID) | 903 | if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID) |