All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jordan Breeding <jordan.breeding@attbi.com>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: reiserfs-list@namesys.com
Subject: Re: [RFC] [PATCH] Label support in mount
Date: Thu, 29 Aug 2002 01:43:24 -0500	[thread overview]
Message-ID: <3D6DC28C.70007@attbi.com> (raw)
In-Reply-To: 20020829052400.GD19435@clusterfs.com

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

Andreas Dilger wrote:
> On Aug 29, 2002  05:20 +0000, jordan.breeding@attbi.com wrote:
> 
>>  This patch was originally intended to try and add
>>support for reiserfs labels to mount from
>>util-linux-2.11u found on ftp.kernel.org.  It is not
>>quite working (if I try to mount something by label the
>>mount program seg. faults), and I won't have time to
>>debug and look at it until at least tomorrow night.  I am
>>sure there is something trivial or stupid that I have
>>done wrong.  At least it is a starting point, if someone
>>knows what is wrong and knows how to fix it quickly then
>>feel free to fix the patch and send it back to me or send
>>it to the util-linux maintainer.
> 
> 
> No patch.
> 
> Cheers, Andreas
> --
> Andreas Dilger
> http://www-mddsp.enel.ucalgary.ca/People/adilger/
> http://sourceforge.net/projects/ext2resize/
> 
> 

Sorry about that.  The patch is attached this time.

Jordan Breeding

[-- Attachment #2: util-linux-2.11u-patch-1 --]
[-- Type: text/plain, Size: 1959 bytes --]

diff -urN util-linux-2.11u/mount/linux_fs.h util-linux-2.11u-patched/mount/linux_fs.h
--- util-linux-2.11u/mount/linux_fs.h	2002-08-03 16:09:43.000000000 -0500
+++ util-linux-2.11u-patched/mount/linux_fs.h	2002-08-29 00:54:27.000000000 -0500
@@ -83,12 +83,24 @@
 	u_char		s_oid_cursize[2];
 	u_char		s_state[2];
 	u_char		s_magic[12];
+	u_char		s_hash_function_code[4];
+	u_char		s_tree_height[2];
+	u_char		s_bmap_nr[2];
+	u_char		s_version[2];
+	u_char		s_reserved[2];
+	u_char		s_inode_generation[4];
+	u_char		s_flags[4];
+	u_char		s_uuid[16];
+	u_char		s_label[16];
+	u_char		s_unused[88];
 };
 #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
 #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
 #define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024)
 /* the spot for the super in versions 3.5 - 3.5.10 (inclusive) */
 #define REISERFS_OLD_DISK_OFFSET_IN_BYTES (8 * 1024)
+#define reiserfsmagic(s)	assemble2le(s.s_magic)
+
 
 #define _XIAFS_SUPER_MAGIC 0x012FD16D
 struct xiafs_super_block {
diff -urN util-linux-2.11u/mount/mount_by_label.c util-linux-2.11u-patched/mount/mount_by_label.c
--- util-linux-2.11u/mount/mount_by_label.c	2002-08-03 19:07:10.000000000 -0500
+++ util-linux-2.11u-patched/mount/mount_by_label.c	2002-08-29 00:55:46.000000000 -0500
@@ -81,6 +81,7 @@
 	struct ext2_super_block e2sb;
 	struct xfs_super_block xfsb;
 	struct jfs_super_block jfssb;
+	struct reiserfs_super_block rfssb;
 
 	fd = open(device, O_RDONLY);
 	if (fd < 0)
@@ -128,6 +129,15 @@
 		    }
 		    rv = 0;
 	}
+	else if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET) == REISERFS_DISK_OFFSET_IN_BYTES
+			&& read(fd, (char *) &rfssb, sizeof(rfssb)) == sizeof(rfssb)
+		&& (reiserfsmagic(rfssb) == REISER2FS_SUPER_MAGIC_STRING)) {
+			memcpy(uuid, rfssb.s_uuid, sizeof(rfssb.s_uuid));
+			namesize = sizeof(rfssb.s_label);
+			if ((*label = calloc(namesize + 1, 1)) != NULL)
+				memcpy(*label, rfssb.s_label, namesize);
+			rv = 0;
+	}
 
 	close(fd);
 	return rv;

  parent reply	other threads:[~2002-08-29  6:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-29  5:20 [RFC] [PATCH] Label support in mount jordan.breeding
     [not found] ` <20020829052400.GD19435@clusterfs.com>
2002-08-29  6:43   ` Jordan Breeding [this message]
2002-08-29  9:14     ` Hans Reiser
2002-08-29 12:14     ` Chris Mason
2002-08-29 13:26       ` Jordan Breeding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D6DC28C.70007@attbi.com \
    --to=jordan.breeding@attbi.com \
    --cc=adilger@clusterfs.com \
    --cc=reiserfs-list@namesys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.