aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_file.c
diff options
context:
space:
mode:
authorWendy Cheng <wcheng@redhat.com>2007-11-29 17:56:51 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:08:15 -0500
commitc97bfe4351771675963e02f34d31e206fd2d7150 (patch)
tree9ee4de86cacc54f3e49135a4ce39cf7a236efb31 /fs/gfs2/ops_file.c
parentbcd405599faa16cf32a3d3f1ce6a1e12cb37fede (diff)
[GFS2] Remove lock methods for lock_nolock protocol
GFS2 supports two modes of locking - lock_nolock for single node filesystem and lock_dlm for cluster mode locking. The gfs2 lock methods are removed from file operation table for lock_nolock protocol. This would allow VFS to handle posix lock and flock logics just like other in-tree filesystems without duplication. Signed-off-by: S. Wendy Cheng <wcheng@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r--fs/gfs2/ops_file.c36
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
746const 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
762const 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