[Cluster-devel] [GFS2] Remove flags no longer required
From abadedd83f6f70d5acb32d0fcfad564557d50797 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse [EMAIL PROTECTED] Date: Fri, 2 Nov 2007 09:14:31 + Subject: [PATCH] [GFS2] Remove flags no longer required The HIF_MUTEX and HIF_PROMOTE flags were set on the glock holders depending upon which of the two waiters lists they were going to be queued upon. They were then tested when the holders were taken off the lists to ensure that the right type of holder was being dequeued. Since we are already using separate lists, there doesn't seem a lot of point having these flags as well, and since setting them and testing them is in the fast path for locking and unlocking glock, this patch removes them. Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index e668808..5fbd9d3 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -594,12 +594,7 @@ static void run_queue(struct gfs2_glock *gl) if (!list_empty(gl-gl_waiters1)) { gh = list_entry(gl-gl_waiters1.next, struct gfs2_holder, gh_list); - - if (test_bit(HIF_MUTEX, gh-gh_iflags)) - blocked = rq_mutex(gh); - else - gfs2_assert_warn(gl-gl_sbd, 0); - + blocked = rq_mutex(gh); } else if (test_bit(GLF_DEMOTE, gl-gl_flags)) { blocked = rq_demote(gl); if (gl-gl_waiters2 !blocked) { @@ -610,12 +605,7 @@ static void run_queue(struct gfs2_glock *gl) } else if (!list_empty(gl-gl_waiters3)) { gh = list_entry(gl-gl_waiters3.next, struct gfs2_holder, gh_list); - - if (test_bit(HIF_PROMOTE, gh-gh_iflags)) - blocked = rq_promote(gh); - else - gfs2_assert_warn(gl-gl_sbd, 0); - + blocked = rq_promote(gh); } else break; @@ -636,7 +626,6 @@ static void gfs2_glmutex_lock(struct gfs2_glock *gl) struct gfs2_holder gh; gfs2_holder_init(gl, 0, 0, gh); - set_bit(HIF_MUTEX, gh.gh_iflags); if (test_and_set_bit(HIF_WAIT, gh.gh_iflags)) BUG(); @@ -1160,8 +1149,6 @@ restart: return -EIO; } - set_bit(HIF_PROMOTE, gh-gh_iflags); - spin_lock(gl-gl_spin); add_to_queue(gh); run_queue(gl); diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 089dba4..478023e 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -141,10 +141,6 @@ struct gfs2_glock_operations { }; enum { - /* Actions */ - HIF_MUTEX = 0, - HIF_PROMOTE = 1, - /* States */ HIF_HOLDER = 6, HIF_FIRST = 7, -- 1.5.1.2
Re: [Cluster-devel] [PATCH][GFS2] Given device ID rather than s_id in id sysfs file
On Fri, Nov 02, 2007 at 09:37:15AM -0500, Bob Peterson wrote: Hi, This patch changes the /sys/fs/gfs2/s_id/id file to give the device id major:minor rather than the s_id. That enables gfs2_tool to match devices properly (by id, not name) when locating the tuning files. We have to be extremely cautious when changing the kernel abi like this; have you verified that it doesn't break any existing programs? Regards, Bob Peterson -- Signed-off-by: Bob Peterson [EMAIL PROTECTED] -- fs/gfs2/sys.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 06e0b77..10807b7 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c @@ -32,7 +32,8 @@ spinlock_t gfs2_sys_margs_lock; static ssize_t id_show(struct gfs2_sbd *sdp, char *buf) { - return snprintf(buf, PAGE_SIZE, %s\n, sdp-sd_vfs-s_id); + return snprintf(buf, PAGE_SIZE, %u:%u\n, + MAJOR(sdp-sd_vfs-s_dev), MINOR(sdp-sd_vfs-s_dev)); } static ssize_t fsname_show(struct gfs2_sbd *sdp, char *buf)
[Cluster-devel] [PATCH][GFS2] Given device ID rather than s_id in id sysfs file
Hi, This patch changes the /sys/fs/gfs2/s_id/id file to give the device id major:minor rather than the s_id. That enables gfs2_tool to match devices properly (by id, not name) when locating the tuning files. Regards, Bob Peterson -- Signed-off-by: Bob Peterson [EMAIL PROTECTED] -- fs/gfs2/sys.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 06e0b77..10807b7 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c @@ -32,7 +32,8 @@ spinlock_t gfs2_sys_margs_lock; static ssize_t id_show(struct gfs2_sbd *sdp, char *buf) { - return snprintf(buf, PAGE_SIZE, %s\n, sdp-sd_vfs-s_id); + return snprintf(buf, PAGE_SIZE, %u:%u\n, + MAJOR(sdp-sd_vfs-s_dev), MINOR(sdp-sd_vfs-s_dev)); } static ssize_t fsname_show(struct gfs2_sbd *sdp, char *buf)
[Cluster-devel] [GFS2] Reorder writeback for glock sync
From 601765436dd953ef0749bf90d1f467aa35f9dd77 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse [EMAIL PROTECTED] Date: Fri, 2 Nov 2007 08:39:34 + Subject: [PATCH] [GFS2] Reorder writeback for glock sync Previously we were doing (write data, wait for data, write metadata, wait for metadata). After this patch we so (write metadata, write data, wait for data, wait for metadata) which should be more efficient. Also I noticed that the drop_bh and xmote_bh functions were almost identical. In fact the only difference was a single test, and that test is such that in the drop_bh case, it would always evaluate to the correct result. As such we can use the xmote_bh functions in all the places where we were using the drop_bh function and remove the drop_bh functions. Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 159a547..e668808 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -947,8 +947,8 @@ static void gfs2_glock_drop_th(struct gfs2_glock *gl) const struct gfs2_glock_operations *glops = gl-gl_ops; unsigned int ret; - if (glops-go_drop_th) - glops-go_drop_th(gl); + if (glops-go_xmote_th) + glops-go_xmote_th(gl); gfs2_assert_warn(sdp, test_bit(GLF_LOCK, gl-gl_flags)); gfs2_assert_warn(sdp, list_empty(gl-gl_holders)); @@ -1252,12 +1252,11 @@ void gfs2_glock_dq(struct gfs2_holder *gh) list_del_init(gh-gh_list); if (list_empty(gl-gl_holders)) { - spin_unlock(gl-gl_spin); - - if (glops-go_unlock) + if (glops-go_unlock) { + spin_unlock(gl-gl_spin); glops-go_unlock(gh); - - spin_lock(gl-gl_spin); + spin_lock(gl-gl_spin); + } gl-gl_stamp = jiffies; } diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index ba12423..c663b7a 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -138,44 +138,34 @@ static void meta_go_inval(struct gfs2_glock *gl, int flags) static void inode_go_sync(struct gfs2_glock *gl) { struct gfs2_inode *ip = gl-gl_object; + struct address_space *metamapping = gl-gl_aspace-i_mapping; + int error; + + if (gl-gl_state != LM_ST_UNLOCKED) + gfs2_pte_inval(gl); + if (gl-gl_state != LM_ST_EXCLUSIVE) + return; if (ip !S_ISREG(ip-i_inode.i_mode)) ip = NULL; if (test_bit(GLF_DIRTY, gl-gl_flags)) { - if (ip !gfs2_is_jdata(ip)) - filemap_fdatawrite(ip-i_inode.i_mapping); gfs2_log_flush(gl-gl_sbd, gl); - if (ip gfs2_is_jdata(ip)) - filemap_fdatawrite(ip-i_inode.i_mapping); - gfs2_meta_sync(gl); + filemap_fdatawrite(metamapping); if (ip) { struct address_space *mapping = ip-i_inode.i_mapping; - int error = filemap_fdatawait(mapping); + filemap_fdatawrite(mapping); + error = filemap_fdatawait(mapping); mapping_set_error(mapping, error); } + error = filemap_fdatawait(metamapping); + mapping_set_error(metamapping, error); clear_bit(GLF_DIRTY, gl-gl_flags); gfs2_ail_empty_gl(gl); } } /** - * inode_go_xmote_th - promote/demote a glock - * @gl: the glock - * @state: the requested state - * @flags: - * - */ - -static void inode_go_xmote_th(struct gfs2_glock *gl) -{ - if (gl-gl_state != LM_ST_UNLOCKED) - gfs2_pte_inval(gl); - if (gl-gl_state == LM_ST_EXCLUSIVE) - inode_go_sync(gl); -} - -/** * inode_go_xmote_bh - After promoting/demoting a glock * @gl: the glock * @@ -196,22 +186,6 @@ static void inode_go_xmote_bh(struct gfs2_glock *gl) } /** - * inode_go_drop_th - unlock a glock - * @gl: the glock - * - * Invoked from rq_demote(). - * Another node needs the lock in EXCLUSIVE mode, or lock (unused for too long) - * is being purged from our node's glock cache; we're dropping lock. - */ - -static void inode_go_drop_th(struct gfs2_glock *gl) -{ - gfs2_pte_inval(gl); - if (gl-gl_state == LM_ST_EXCLUSIVE) - inode_go_sync(gl); -} - -/** * inode_go_inval - prepare a inode glock to be released * @gl: the glock * @flags: @@ -326,14 +300,14 @@ static void rgrp_go_unlock(struct gfs2_holder *gh) } /** - * trans_go_xmote_th - promote/demote the transaction glock + * trans_go_sync - promote/demote the transaction glock * @gl: the glock * @state: the requested state * @flags: * */ -static void trans_go_xmote_th(struct gfs2_glock *gl) +static void trans_go_sync(struct gfs2_glock *gl) { struct gfs2_sbd *sdp = gl-gl_sbd; @@ -377,24 +351,6 @@ static void trans_go_xmote_bh(struct gfs2_glock
Re: [Cluster-devel] [PATCH][GFS2] Given device ID rather than s_id in id sysfs file
On Fri, 2007-11-02 at 09:55 -0500, David Teigland wrote: We have to be extremely cautious when changing the kernel abi like this; have you verified that it doesn't break any existing programs? Dave has a good point here. I've verified that no other gfs2 util uses the id except for gfs2_tool. However, this kernel change makes previous userland versions of gfs2_tool stop working in some cases, for example, gfs2_tool gettune and settune. Customers would need to upgrade their gfs2_tool to use the new gfs2 kernel module. For that reason, perhaps we should revert this patch and instead export the device id to a separate /sys/fs file called /sys/fs/gfs2/s_id/device_id or some such. That would ensure backward compatibility with older userland tools. BTW, this also led me to discover that the gfs2 quota tool uses /sys/fs/gfs2/lock table/xxx which, in the case of stand-alone file systems, would be a NULL string. The quota tool should be changed to use the same interface as gfs2_tool to determine the proper path in sysfs. Perhaps I'll open a bugzilla record on it. Regards, Bob Peterson Red Hat Cluster Suite
[Cluster-devel] conga/luci plone-custom/configured.png plone-c ...
CVSROOT:/cvs/cluster Module name:conga Changes by: [EMAIL PROTECTED] 2007-11-02 20:49:55 Modified files: luci/plone-custom: configured.png installed.png joined.png notstarted.png rebooted.png luci/site/luci/Extensions: conga_constants.py luci/storage : storage_probing.js storage_utils.js storage_validation.js Log message: Fix typos in the storage javascript code Update the graphics Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/configured.png.diff?cvsroot=clusterr1=1.1r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/installed.png.diff?cvsroot=clusterr1=1.1r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/joined.png.diff?cvsroot=clusterr1=1.1r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/notstarted.png.diff?cvsroot=clusterr1=1.1r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/rebooted.png.diff?cvsroot=clusterr1=1.1r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=clusterr1=1.45r2=1.46 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/storage_probing.js.diff?cvsroot=clusterr1=1.3r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/storage_utils.js.diff?cvsroot=clusterr1=1.4r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/storage_validation.js.diff?cvsroot=clusterr1=1.3r2=1.4 Binary files /cvs/cluster/conga/luci/plone-custom/configured.png 2007/09/25 03:51:42 1.1 and /cvs/cluster/conga/luci/plone-custom/configured.png 2007/11/02 20:49:55 1.2 differ rcsdiff: /cvs/cluster/conga/luci/plone-custom/configured.png: diff failed Binary files /cvs/cluster/conga/luci/plone-custom/installed.png 2007/09/25 03:51:42 1.1 and /cvs/cluster/conga/luci/plone-custom/installed.png 2007/11/02 20:49:55 1.2 differ rcsdiff: /cvs/cluster/conga/luci/plone-custom/installed.png: diff failed Binary files /cvs/cluster/conga/luci/plone-custom/joined.png2007/09/25 03:51:42 1.1 and /cvs/cluster/conga/luci/plone-custom/joined.png 2007/11/02 20:49:55 1.2 differ rcsdiff: /cvs/cluster/conga/luci/plone-custom/joined.png: diff failed Binary files /cvs/cluster/conga/luci/plone-custom/notstarted.png 2007/09/25 03:51:42 1.1 and /cvs/cluster/conga/luci/plone-custom/notstarted.png 2007/11/02 20:49:55 1.2 differ rcsdiff: /cvs/cluster/conga/luci/plone-custom/notstarted.png: diff failed Binary files /cvs/cluster/conga/luci/plone-custom/rebooted.png 2007/09/25 03:51:42 1.1 and /cvs/cluster/conga/luci/plone-custom/rebooted.png 2007/11/02 20:49:55 1.2 differ rcsdiff: /cvs/cluster/conga/luci/plone-custom/rebooted.png: diff failed --- conga/luci/site/luci/Extensions/conga_constants.py 2007/10/09 20:20:02 1.45 +++ conga/luci/site/luci/Extensions/conga_constants.py 2007/11/02 20:49:55 1.46 @@ -152,5 +152,5 @@ # to = 2 to get full debugging output in syslog (LOG_DAEMON/LOG_DEBUG). LUCI_DEBUG_MODE= True -LUCI_DEBUG_NET = False -LUCI_DEBUG_VERBOSITY = 3 +LUCI_DEBUG_NET = True +LUCI_DEBUG_VERBOSITY = 5 --- conga/luci/storage/storage_probing.js 2007/10/22 19:49:06 1.3 +++ conga/luci/storage/storage_probing.js 2007/11/02 20:49:55 1.4 @@ -7,7 +7,7 @@ ** Free Software Foundation. */ -function strip_left(txt) { +function strip_left(res_txt) { return(res_txt.replace(/^\s+/g, )); } --- conga/luci/storage/storage_utils.js 2007/10/22 19:49:06 1.4 +++ conga/luci/storage/storage_utils.js 2007/11/02 20:49:55 1.5 @@ -7,7 +7,7 @@ ** Free Software Foundation. */ -function strip_left(txt) { +function strip_left(res_txt) { return(res_txt.replace(/^\s+/g, )); } --- conga/luci/storage/storage_validation.js2007/10/22 19:49:06 1.3 +++ conga/luci/storage/storage_validation.js2007/11/02 20:49:55 1.4 @@ -303,7 +303,7 @@ return false; } -function strip_left(txt) { +function strip_left(res_txt) { return(res_txt.replace(/^\s+/g, )); }
[Cluster-devel] cluster/ccs/ccs_tool ccs_tool.c
CVSROOT:/cvs/cluster Module name:cluster Branch: RHEL4 Changes by: [EMAIL PROTECTED] 2007-11-02 21:08:50 Modified files: ccs/ccs_tool : ccs_tool.c Log message: BZ 364661 - Fix ccs_tool to return EXIT_SUCCESS for most commands. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/ccs_tool.c.diff?cvsroot=clusteronly_with_tag=RHEL4r1=1.1.2.3r2=1.1.2.4 --- cluster/ccs/ccs_tool/ccs_tool.c 2007/02/14 10:15:46 1.1.2.3 +++ cluster/ccs/ccs_tool/ccs_tool.c 2007/11/02 21:08:50 1.1.2.4 @@ -56,35 +56,35 @@ else if(!strcmp(argv[optind], addnode)){ add_node(argc-1, argv+1); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } else if(!strcmp(argv[optind], delnode)){ del_node(argc-1, argv+1); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } else if(!strcmp(argv[optind], addfence)){ add_fence(argc-1, argv+1); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } else if(!strcmp(argv[optind], delfence)){ del_fence(argc-1, argv+1); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } else if(!strcmp(argv[optind], lsnode)){ list_nodes(argc-1, argv+1); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } else if(!strcmp(argv[optind], lsfence)){ list_fences(argc-1, argv+1); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } else if(!strcmp(argv[optind], create)){ create_skeleton(argc-1, argv+1); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } else if(!strcmp(argv[optind], addnodeids)){ add_nodeids(argc-1, argv+1); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } else {