diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-21 07:51:39 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-21 07:51:39 -0500 |
commit | f55ab26a8f92a23988c3e6da28dae4741933a4e2 (patch) | |
tree | b6f9e89ce1b2ccde8d81314aeea06f6a02f882f7 /fs/gfs2/ops_file.c | |
parent | 5c4e9e036678fae65c9288e1c00a6f33cd447283 (diff) |
[GFS2] Use mutices rather than semaphores
As well as a number of minor bug fixes, this patch changes GFS
to use mutices rather than semaphores. This results in better
information in case there are any locking problems.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r-- | fs/gfs2/ops_file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index b86037832299..cf2e26e07245 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c | |||
@@ -688,7 +688,7 @@ static int gfs2_open(struct inode *inode, struct file *file) | |||
688 | if (!fp) | 688 | if (!fp) |
689 | return -ENOMEM; | 689 | return -ENOMEM; |
690 | 690 | ||
691 | init_MUTEX(&fp->f_fl_mutex); | 691 | mutex_init(&fp->f_fl_mutex); |
692 | 692 | ||
693 | fp->f_inode = ip; | 693 | fp->f_inode = ip; |
694 | fp->f_vfile = file; | 694 | fp->f_vfile = file; |
@@ -858,7 +858,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) | |||
858 | state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; | 858 | state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; |
859 | flags = ((IS_SETLKW(cmd)) ? 0 : LM_FLAG_TRY) | GL_EXACT | GL_NOCACHE; | 859 | flags = ((IS_SETLKW(cmd)) ? 0 : LM_FLAG_TRY) | GL_EXACT | GL_NOCACHE; |
860 | 860 | ||
861 | down(&fp->f_fl_mutex); | 861 | mutex_lock(&fp->f_fl_mutex); |
862 | 862 | ||
863 | gl = fl_gh->gh_gl; | 863 | gl = fl_gh->gh_gl; |
864 | if (gl) { | 864 | if (gl) { |
@@ -890,7 +890,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) | |||
890 | } | 890 | } |
891 | 891 | ||
892 | out: | 892 | out: |
893 | up(&fp->f_fl_mutex); | 893 | mutex_unlock(&fp->f_fl_mutex); |
894 | 894 | ||
895 | return error; | 895 | return error; |
896 | } | 896 | } |
@@ -900,11 +900,11 @@ static void do_unflock(struct file *file, struct file_lock *fl) | |||
900 | struct gfs2_file *fp = get_v2fp(file); | 900 | struct gfs2_file *fp = get_v2fp(file); |
901 | struct gfs2_holder *fl_gh = &fp->f_fl_gh; | 901 | struct gfs2_holder *fl_gh = &fp->f_fl_gh; |
902 | 902 | ||
903 | down(&fp->f_fl_mutex); | 903 | mutex_lock(&fp->f_fl_mutex); |
904 | flock_lock_file_wait(file, fl); | 904 | flock_lock_file_wait(file, fl); |
905 | if (fl_gh->gh_gl) | 905 | if (fl_gh->gh_gl) |
906 | gfs2_glock_dq_uninit(fl_gh); | 906 | gfs2_glock_dq_uninit(fl_gh); |
907 | up(&fp->f_fl_mutex); | 907 | mutex_unlock(&fp->f_fl_mutex); |
908 | } | 908 | } |
909 | 909 | ||
910 | /** | 910 | /** |