diff options
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r-- | fs/gfs2/ops_file.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index ad5daaa6babc..db76ac1947e7 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c | |||
@@ -615,15 +615,6 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) | |||
615 | if (__mandatory_lock(&ip->i_inode)) | 615 | if (__mandatory_lock(&ip->i_inode)) |
616 | return -ENOLCK; | 616 | return -ENOLCK; |
617 | 617 | ||
618 | if (sdp->sd_args.ar_localflocks) { | ||
619 | if (IS_GETLK(cmd)) { | ||
620 | posix_test_lock(file, fl); | ||
621 | return 0; | ||
622 | } else { | ||
623 | return posix_lock_file_wait(file, fl); | ||
624 | } | ||
625 | } | ||
626 | |||
627 | if (cmd == F_CANCELLK) { | 618 | if (cmd == F_CANCELLK) { |
628 | /* Hack: */ | 619 | /* Hack: */ |
629 | cmd = F_SETLK; | 620 | cmd = F_SETLK; |
@@ -716,9 +707,6 @@ static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl) | |||
716 | if (__mandatory_lock(&ip->i_inode)) | 707 | if (__mandatory_lock(&ip->i_inode)) |
717 | return -ENOLCK; | 708 | return -ENOLCK; |
718 | 709 | ||
719 | if (sdp->sd_args.ar_localflocks) | ||
720 | return flock_lock_file_wait(file, fl); | ||
721 | |||
722 | if (fl->fl_type == F_UNLCK) { | 710 | if (fl->fl_type == F_UNLCK) { |
723 | do_unflock(file, fl); | 711 | do_unflock(file, fl); |
724 | return 0; | 712 | return 0; |
@@ -755,3 +743,27 @@ const struct file_operations gfs2_dir_fops = { | |||
755 | .flock = gfs2_flock, | 743 | .flock = gfs2_flock, |
756 | }; | 744 | }; |
757 | 745 | ||
746 | const struct file_operations gfs2_file_fops_nolock = { | ||
747 | .llseek = gfs2_llseek, | ||
748 | .read = do_sync_read, | ||
749 | .aio_read = generic_file_aio_read, | ||
750 | .write = do_sync_write, | ||
751 | .aio_write = generic_file_aio_write, | ||
752 | .unlocked_ioctl = gfs2_ioctl, | ||
753 | .mmap = gfs2_mmap, | ||
754 | .open = gfs2_open, | ||
755 | .release = gfs2_close, | ||
756 | .fsync = gfs2_fsync, | ||
757 | .splice_read = generic_file_splice_read, | ||
758 | .splice_write = generic_file_splice_write, | ||
759 | .setlease = gfs2_setlease, | ||
760 | }; | ||
761 | |||
762 | const struct file_operations gfs2_dir_fops_nolock = { | ||
763 | .readdir = gfs2_readdir, | ||
764 | .unlocked_ioctl = gfs2_ioctl, | ||
765 | .open = gfs2_open, | ||
766 | .release = gfs2_close, | ||
767 | .fsync = gfs2_fsync, | ||
768 | }; | ||
769 | |||