From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Teigland Date: Fri, 2 Nov 2007 09:55:43 -0500 Subject: [Cluster-devel] [PATCH][GFS2] Given device ID rather than s_id in "id" sysfs file In-Reply-To: <1194014236.21497.20.camel@technetium.msp.redhat.com> References: <1194014236.21497.20.camel@technetium.msp.redhat.com> Message-ID: <20071102145543.GA6480@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Nov 02, 2007 at 09:37:15AM -0500, Bob Peterson wrote: > Hi, > > This patch changes the /sys/fs/gfs2//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 > -- > 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) >