aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-02-27 17:23:27 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-02-27 17:23:27 -0500
commit5c676f6d359b0404d53f542f02e1359583cb2895 (patch)
tree8741011990ec0a3d0d41fee9f0d7abf6a16834cc /fs/gfs2/glock.c
parentf3b270a47882b958e9e3c5bd86894e3a7072899a (diff)
[GFS2] Macros removal in gfs2.h
As suggested by Pekka Enberg <penberg@cs.helsinki.fi>. The DIV_RU macro is renamed DIV_ROUND_UP and and moved to kernel.h The other macros are gone from gfs2.h as (although not requested by Pekka Enberg) are a number of included header file which are now included individually. The inode number comparison function is now an inline function. The DT2IF and IF2DT may be addressed in a future patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index f30fde91d14a..81b06812b329 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -16,10 +16,13 @@
16#include <linux/sort.h> 16#include <linux/sort.h>
17#include <linux/jhash.h> 17#include <linux/jhash.h>
18#include <linux/kref.h> 18#include <linux/kref.h>
19#include <linux/gfs2_ondisk.h>
19#include <asm/semaphore.h> 20#include <asm/semaphore.h>
20#include <asm/uaccess.h> 21#include <asm/uaccess.h>
21 22
22#include "gfs2.h" 23#include "gfs2.h"
24#include "lm_interface.h"
25#include "incore.h"
23#include "glock.h" 26#include "glock.h"
24#include "glops.h" 27#include "glops.h"
25#include "inode.h" 28#include "inode.h"
@@ -28,6 +31,7 @@
28#include "meta_io.h" 31#include "meta_io.h"
29#include "quota.h" 32#include "quota.h"
30#include "super.h" 33#include "super.h"
34#include "util.h"
31 35
32/* Must be kept in sync with the beginning of struct gfs2_glock */ 36/* Must be kept in sync with the beginning of struct gfs2_glock */
33struct glock_plug { 37struct glock_plug {
@@ -1962,7 +1966,7 @@ void gfs2_try_toss_inode(struct gfs2_sbd *sdp, struct gfs2_inum *inum)
1962 if (!gfs2_glmutex_trylock(gl)) 1966 if (!gfs2_glmutex_trylock(gl))
1963 goto out; 1967 goto out;
1964 1968
1965 ip = get_gl2ip(gl); 1969 ip = gl->gl_object;
1966 if (!ip) 1970 if (!ip)
1967 goto out_unlock; 1971 goto out_unlock;
1968 1972
@@ -1994,7 +1998,7 @@ void gfs2_iopen_go_callback(struct gfs2_glock *io_gl, unsigned int state)
1994 return; 1998 return;
1995 1999
1996 spin_lock(&io_gl->gl_spin); 2000 spin_lock(&io_gl->gl_spin);
1997 i_gl = get_gl2gl(io_gl); 2001 i_gl = io_gl->gl_object;
1998 if (i_gl) { 2002 if (i_gl) {
1999 gfs2_glock_hold(i_gl); 2003 gfs2_glock_hold(i_gl);
2000 spin_unlock(&io_gl->gl_spin); 2004 spin_unlock(&io_gl->gl_spin);
@@ -2004,7 +2008,7 @@ void gfs2_iopen_go_callback(struct gfs2_glock *io_gl, unsigned int state)
2004 } 2008 }
2005 2009
2006 if (gfs2_glmutex_trylock(i_gl)) { 2010 if (gfs2_glmutex_trylock(i_gl)) {
2007 struct gfs2_inode *ip = get_gl2ip(i_gl); 2011 struct gfs2_inode *ip = i_gl->gl_object;
2008 if (ip) { 2012 if (ip) {
2009 gfs2_try_toss_vnode(ip); 2013 gfs2_try_toss_vnode(ip);
2010 gfs2_glmutex_unlock(i_gl); 2014 gfs2_glmutex_unlock(i_gl);
@@ -2093,7 +2097,7 @@ void gfs2_reclaim_glock(struct gfs2_sbd *sdp)
2093 2097
2094 if (gfs2_glmutex_trylock(gl)) { 2098 if (gfs2_glmutex_trylock(gl)) {
2095 if (gl->gl_ops == &gfs2_inode_glops) { 2099 if (gl->gl_ops == &gfs2_inode_glops) {
2096 struct gfs2_inode *ip = get_gl2ip(gl); 2100 struct gfs2_inode *ip = gl->gl_object;
2097 if (ip && !atomic_read(&ip->i_count)) 2101 if (ip && !atomic_read(&ip->i_count))
2098 gfs2_inode_destroy(ip); 2102 gfs2_inode_destroy(ip);
2099 } 2103 }
@@ -2174,7 +2178,7 @@ static void scan_glock(struct gfs2_glock *gl)
2174{ 2178{
2175 if (gfs2_glmutex_trylock(gl)) { 2179 if (gfs2_glmutex_trylock(gl)) {
2176 if (gl->gl_ops == &gfs2_inode_glops) { 2180 if (gl->gl_ops == &gfs2_inode_glops) {
2177 struct gfs2_inode *ip = get_gl2ip(gl); 2181 struct gfs2_inode *ip = gl->gl_object;
2178 if (ip && !atomic_read(&ip->i_count)) 2182 if (ip && !atomic_read(&ip->i_count))
2179 goto out_schedule; 2183 goto out_schedule;
2180 } 2184 }
@@ -2234,7 +2238,7 @@ static void clear_glock(struct gfs2_glock *gl)
2234 2238
2235 if (gfs2_glmutex_trylock(gl)) { 2239 if (gfs2_glmutex_trylock(gl)) {
2236 if (gl->gl_ops == &gfs2_inode_glops) { 2240 if (gl->gl_ops == &gfs2_inode_glops) {
2237 struct gfs2_inode *ip = get_gl2ip(gl); 2241 struct gfs2_inode *ip = gl->gl_object;
2238 if (ip && !atomic_read(&ip->i_count)) 2242 if (ip && !atomic_read(&ip->i_count))
2239 gfs2_inode_destroy(ip); 2243 gfs2_inode_destroy(ip);
2240 } 2244 }
@@ -2430,10 +2434,10 @@ static int dump_glock(struct gfs2_glock *gl)
2430 if (error) 2434 if (error)
2431 goto out; 2435 goto out;
2432 } 2436 }
2433 if (gl->gl_ops == &gfs2_inode_glops && get_gl2ip(gl)) { 2437 if (gl->gl_ops == &gfs2_inode_glops && gl->gl_object) {
2434 if (!test_bit(GLF_LOCK, &gl->gl_flags) && 2438 if (!test_bit(GLF_LOCK, &gl->gl_flags) &&
2435 list_empty(&gl->gl_holders)) { 2439 list_empty(&gl->gl_holders)) {
2436 error = dump_inode(get_gl2ip(gl)); 2440 error = dump_inode(gl->gl_object);
2437 if (error) 2441 if (error)
2438 goto out; 2442 goto out;
2439 } else { 2443 } else {