[GFS2] Given device ID rather than s_id in "id" sysfs file
authorBob Peterson <rpeterso@redhat.com>
Fri, 2 Nov 2007 14:37:15 +0000 (09:37 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Fri, 25 Jan 2008 08:07:47 +0000 (08:07 +0000)
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.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/sys.c

index 1359198aed631b8aa2be9fdda21388a52e586934..65dd0657e1f8620f228e9da7fc90374ad8a859f1 100644 (file)
@@ -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)