Skip to contentSkip to conversation

Btrfs - use %pU to print fsid

PATCH In review Ilya Dryomov 2 participants 4 messages Feb 9, 2011 – Jun 9, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs - use %pU to print fsid

Get rid of FIXME comment. Uuids from dmesg are now the same as uuids given by btrfs-progs.

---
 fs/btrfs/volumes.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
fs/btrfs/volumes.c +2 -6
index 2636a05..83b789c 100644
@@ -714,12 +714,8 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
 	transid = btrfs_super_generation(disk_super);
 	if (disk_super->label[0])
 		printk(KERN_INFO "device label %s ", disk_super->label);
-	else {
-		/* FIXME, make a readl uuid parser */
-		printk(KERN_INFO "device fsid %llx-%llx ",
-		       *(unsigned long long *)disk_super->fsid,
-		       *(unsigned long long *)(disk_super->fsid + 8));
-	}
+	else
+		printk(KERN_INFO "device fsid %pU ", disk_super->fsid);
 	printk(KERN_CONT "devid %llu transid %llu %s\n",
 	       (unsigned long long)devid, (unsigned long long)transid, path);
 	ret = device_list_add(path, disk_super, devid, fs_devices_ret);
Signature · 1 line
1.7.2.3
#1 lore raw

On Wed, Feb 9, 2011 at 8:05 AM, Ilya Dryomov <[email protected]> wrote= :

Quoted 1 line

Get rid of FIXME comment. =A0Uuids from dmesg are now the same as uui=

ds

fs/btrfs/volumes.c int btrfs_scan_one_device(const char *path, fmod=

Quoted 12 lines

given by btrfs-progs.

---
=A0fs/btrfs/volumes.c | =A0 =A08 ++------ =A01 files changed, 2 insertions(+), 6 deletions(-)

fs/btrfs/volumes.c +0 -0
index 2636a05..83b789c 100644
@@ -714,12 +714,8 @@ int btrfs_scan_one_device(const char *path, fmod=

e_t flags, void *holder,

Quoted 3 lines
fs/btrfs/volumes.c +0 -0
 =A0 =A0 =A0 =A0transid =3D btrfs_super_generation(disk_super);
 =A0 =A0 =A0 =A0if (disk_super->label[0])

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk(KERN_INFO "device label %s ", d=

isk_super->label);

Quoted 3 lines

- =A0 =A0 =A0 else {
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* FIXME, make a readl uuid parser */
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_INFO "device fsid %llx-%llx=

",

Quoted 1 line

- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*(unsigned long long *)d=

isk_super->fsid,

Quoted 1 line

- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*(unsigned long long *)(=

disk_super->fsid + 8));

Quoted 3 lines

- =A0 =A0 =A0 }
+ =A0 =A0 =A0 else
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_INFO "device fsid %pU ", di=

sk_super->fsid);

Quoted 2 lines

=A0 =A0 =A0 =A0printk(KERN_CONT "devid %llu transid %llu %s\n", =A0 =A0 =A0 =A0 =A0 =A0 =A0 (unsigned long long)devid, (unsigned long=

long)transid, path);

Quoted 1 line

=A0 =A0 =A0 =A0ret =3D device_list_add(path, disk_super, devid, fs_de=

vices_ret);

Quoted 3 lines

--
1.7.2.3

I've had this patch in my testing stack for a while now, and it's been working well. The fsid now matches the UUID.

It would be nice if the text string lead off with "Btrfs:" or "btrfs:". This would be similar to the way other drivers send log messages, and would make it easier to pick out the Btrfs mount message from all the other messages.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 1 line · Mitch Harder

On Wed, Feb 9, 2011 at 8:05 AM, Ilya Dryomov <[email protected]> wro=

te:

Quoted 1 line
Quoted 1 line

Get rid of FIXME comment. =C2=A0Uuids from dmesg are now the same a=

s uuids

Quoted 7 lines
Quoted 7 lines

given by btrfs-progs.

---
=C2=A0fs/btrfs/volumes.c | =C2=A0 =C2=A08 ++------ =C2=A01 files changed, 2 insertions(+), 6 deletions(-)

Quoted 5 lines

fs/btrfs/volumes.c int btrfs_scan_one_device(const char *path, fm=

Quoted 5 lines
fs/btrfs/volumes.c +0 -0
index 2636a05..83b789c 100644
@@ -714,12 +714,8 @@ int btrfs_scan_one_device(const char *path, fm=

ode_t flags, void *holder,

Quoted 1 line
Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0transid =3D btrfs_super_generation(disk_=

super);

Quoted 2 lines
Quoted 2 lines

=C2=A0 =C2=A0 =C2=A0 =C2=A0if (disk_super->label[0]) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0printk(KERN_=

INFO "device label %s ", disk_super->label);

Quoted 2 lines
Quoted 2 lines

- =C2=A0 =C2=A0 =C2=A0 else {
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* FIXME, make a=

readl uuid parser */

Quoted 1 line
Quoted 1 line

- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk(KERN_INFO=

"device fsid %llx-%llx ",

Quoted 1 line
Quoted 1 line

- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=

=A0 =C2=A0*(unsigned long long *)disk_super->fsid,

Quoted 1 line
Quoted 1 line

- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=

=A0 =C2=A0*(unsigned long long *)(disk_super->fsid + 8));

Quoted 3 lines
Quoted 3 lines

- =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 =C2=A0 =C2=A0 else
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk(KERN_INFO=

"device fsid %pU ", disk_super->fsid);

Quoted 1 line
Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0printk(KERN_CONT "devid %llu transid %ll=

u %s\n",

Quoted 1 line
Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unsigned long lon=

g)devid, (unsigned long long)transid, path);

Quoted 1 line
Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D device_list_add(path, disk_super=

, devid, fs_devices_ret);

Quoted 5 lines
Quoted 3 lines

--
1.7.2.3

=20
I've had this patch in my testing stack for a while now, and it's bee=

n

Quoted 1 line

working well. The fsid now matches the UUID.

Chris for some reason didn't add it to the pull request, probably because it's minor.

Quoted 3 lines

It would be nice if the text string lead off with "Btrfs:" or "btrfs:". This would be similar to the way other drivers send log messages, and would make it easier to pick out the Btrfs mount messag=

e

Quoted 1 line

from all the other messages.

Currently there is a mix: some of the messages are printed with "btrfs:", others with "btrfs", most of the messages informing about abnormal conditions are printed w/o any prefix. I can resend this one with "btrfs:" prefix, but I think some kind of decision needed, so this whole thing can be fixed in one commit.

Thanks,

Ilya
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Ilya Dryomov

Hi Chris,

Can you pull this into the next -rc ? It's minor, but people think it's useful. I just had another person asking about this patch.

Thanks,

Ilya