From f55ab26a8f92a23988c3e6da28dae4741933a4e2 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Tue, 21 Feb 2006 12:51:39 +0000 Subject: [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 --- fs/gfs2/ops_file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fs/gfs2/ops_file.c') diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index b8603783229..cf2e26e0724 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) if (!fp) return -ENOMEM; - init_MUTEX(&fp->f_fl_mutex); + mutex_init(&fp->f_fl_mutex); fp->f_inode = ip; fp->f_vfile = file; @@ -858,7 +858,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; flags = ((IS_SETLKW(cmd)) ? 0 : LM_FLAG_TRY) | GL_EXACT | GL_NOCACHE; - down(&fp->f_fl_mutex); + mutex_lock(&fp->f_fl_mutex); gl = fl_gh->gh_gl; if (gl) { @@ -890,7 +890,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) } out: - up(&fp->f_fl_mutex); + mutex_unlock(&fp->f_fl_mutex); return error; } @@ -900,11 +900,11 @@ static void do_unflock(struct file *file, struct file_lock *fl) struct gfs2_file *fp = get_v2fp(file); struct gfs2_holder *fl_gh = &fp->f_fl_gh; - down(&fp->f_fl_mutex); + mutex_lock(&fp->f_fl_mutex); flock_lock_file_wait(file, fl); if (fl_gh->gh_gl) gfs2_glock_dq_uninit(fl_gh); - up(&fp->f_fl_mutex); + mutex_unlock(&fp->f_fl_mutex); } /** -- cgit v1.2.3