All of lore.kernel.org
 help / color / mirror / Atom feed
* hashes in reiser3.6
@ 2004-11-18 19:45 Grzegorz Jaśkiewicz
  2004-11-18 20:16 ` Jeff Mahoney
  0 siblings, 1 reply; 5+ messages in thread
From: Grzegorz Jaśkiewicz @ 2004-11-18 19:45 UTC (permalink / raw)
  To: ReiserFS List

Hi folks

I have a need to switch from default hashing to TEA on one of my
servers recently.
Want to write something like that, as it doesn't exists now. Only in
manual I digged out that hash= option to mount is just for folks who
want to upgrade their filesystem to 3.6, and choose hash, or
something.
If someone can tell me how deep I should dig to change it, and some
hints are welcomed.
I already did some hacking in reiserfs3.6 for myself (non profit
thing), so I know sources a bit.

Thanks in advance.

I know that reiser4 is supperb, and I am testing it extensively
(already found 2 or more bugs and reported them), but it is stilll way
to much unstable for production.

-- 
GJ

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hashes in reiser3.6
  2004-11-18 19:45 hashes in reiser3.6 Grzegorz Jaśkiewicz
@ 2004-11-18 20:16 ` Jeff Mahoney
  2004-11-20 23:00   ` Grzegorz Jaśkiewicz
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Mahoney @ 2004-11-18 20:16 UTC (permalink / raw)
  To: Grzegorz Jaśkiewicz; +Cc: ReiserFS List

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Grzegorz Ja≈õkiewicz wrote:
| Hi folks
|
| I have a need to switch from default hashing to TEA on one of my
| servers recently.
| Want to write something like that, as it doesn't exists now. Only in
| manual I digged out that hash= option to mount is just for folks who
| want to upgrade their filesystem to 3.6, and choose hash, or
| something.
| If someone can tell me how deep I should dig to change it, and some
| hints are welcomed.
| I already did some hacking in reiserfs3.6 for myself (non profit
| thing), so I know sources a bit.
|
| Thanks in advance.
|
| I know that reiser4 is supperb, and I am testing it extensively
| (already found 2 or more bugs and reported them), but it is stilll way
| to much unstable for production.
|

If the filesystem is already established, you can't switch hashes. The
hash is global to the filesystem, so if you were to change it, lookups
would fail and you wouldn't be able to find any of your files.

If you're creating a new filesystem, you can use the --hash argument to
mkreiserfs. Under most circumstances, the filesystem code will
automatically discover which hash you're using at mount time.

- -Jeff

- --
Jeff Mahoney
SuSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBnQMcLPWxlyuTD7IRAoIdAJ4qY8y4mYHcmjqTy9ItAg6ULWm2OQCeNPlc
j1EY6mzJgadtngrcG1C3m7k=
=5kiE
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hashes in reiser3.6
  2004-11-18 20:16 ` Jeff Mahoney
@ 2004-11-20 23:00   ` Grzegorz Jaśkiewicz
  2004-11-25  9:03     ` Vladimir Saveliev
  2004-11-28 19:30     ` Jeff Mahoney
  0 siblings, 2 replies; 5+ messages in thread
From: Grzegorz Jaśkiewicz @ 2004-11-20 23:00 UTC (permalink / raw)
  To: ReiserFS List

On Thu, 18 Nov 2004 15:16:29 -0500, Jeff Mahoney <jeffm@novell.com> wrote:

> If the filesystem is already established, you can't switch hashes. The
> hash is global to the filesystem, so if you were to change it, lookups
> would fail and you wouldn't be able to find any of your files.
>
> If you're creating a new filesystem, you can use the --hash argument to
> mkreiserfs. Under most circumstances, the filesystem code will
> automatically discover which hash you're using at mount time.

Thanks, but the trick is that I would like to switch over existing
partition to other hash.
I know, I can copy over all data on side, and recreate partition from
scratch, but it's just way too painfull. It should be possible to do
this in much easier way.
So you say, that reiserfs doesn't store filenames in strucures, but
uses just hashes to lookup ? Shouldn't it be possible to go through
all structures on the partition, and recreate hashes, but using
different key function ?
I am prepared to spend some time,and do this.

-- 
GJ

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hashes in reiser3.6
  2004-11-20 23:00   ` Grzegorz Jaśkiewicz
@ 2004-11-25  9:03     ` Vladimir Saveliev
  2004-11-28 19:30     ` Jeff Mahoney
  1 sibling, 0 replies; 5+ messages in thread
From: Vladimir Saveliev @ 2004-11-25  9:03 UTC (permalink / raw)
  To: Grzegorz Jaśkiewicz; +Cc: ReiserFS List

Hello

On Sun, 2004-11-21 at 02:00, Grzegorz Ja¶kiewicz wrote:
> On Thu, 18 Nov 2004 15:16:29 -0500, Jeff Mahoney <jeffm@novell.com> wrote:
> 
> > If the filesystem is already established, you can't switch hashes. The
> > hash is global to the filesystem, so if you were to change it, lookups
> > would fail and you wouldn't be able to find any of your files.
> >
> > If you're creating a new filesystem, you can use the --hash argument to
> > mkreiserfs. Under most circumstances, the filesystem code will
> > automatically discover which hash you're using at mount time.
> 
> Thanks, but the trick is that I would like to switch over existing
> partition to other hash.
> I know, I can copy over all data on side, and recreate partition from
> scratch, but it's just way too painfull. It should be possible to do
> this in much easier way.
> So you say, that reiserfs doesn't store filenames in strucures, but
> uses just hashes to lookup ? Shouldn't it be possible to go through
> all structures on the partition, and recreate hashes, but using
> different key function ?
> I am prepared to spend some time,and do this.


I am afraid you will have to create a special tool to do this trick.
If such tool does not exist  - it is much easier to rehash using spare
partition.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hashes in reiser3.6
  2004-11-20 23:00   ` Grzegorz Jaśkiewicz
  2004-11-25  9:03     ` Vladimir Saveliev
@ 2004-11-28 19:30     ` Jeff Mahoney
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Mahoney @ 2004-11-28 19:30 UTC (permalink / raw)
  To: Grzegorz Jaśkiewicz; +Cc: ReiserFS List

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Grzegorz Ja≈õkiewicz wrote:
| On Thu, 18 Nov 2004 15:16:29 -0500, Jeff Mahoney <jeffm@novell.com> wrote:
|
|
|>If the filesystem is already established, you can't switch hashes. The
|>hash is global to the filesystem, so if you were to change it, lookups
|>would fail and you wouldn't be able to find any of your files.
|>
|>If you're creating a new filesystem, you can use the --hash argument to
|>mkreiserfs. Under most circumstances, the filesystem code will
|>automatically discover which hash you're using at mount time.
|
|
| Thanks, but the trick is that I would like to switch over existing
| partition to other hash.
| I know, I can copy over all data on side, and recreate partition from
| scratch, but it's just way too painfull. It should be possible to do
| this in much easier way.
| So you say, that reiserfs doesn't store filenames in strucures, but
| uses just hashes to lookup ? Shouldn't it be possible to go through
| all structures on the partition, and recreate hashes, but using
| different key function ?
| I am prepared to spend some time,and do this.
|

As Vladimir said, you'd need to write a special tool to do this. It
would be far more cost effective to use a spare drive or tape backup to
backup your filesystem and restore it again.

To highlight why this would be such a complex operation, consider that
the hashed entries are sorted by the hash. With small directories, this
is fairly trivial since you can just shuffle the entries around inside
the same item. However, with a large directory (where large is defined
as the length of all filenames + associated keys is larger than a disk
block), the directory can be split over several nodes. Once you start
shuffling nodes around, you're essentially rebuilding the tree, and
that's far more complex and time consuming than simply copying the data
off and restoring it back.

Sorry we don't have an easier answer for you. :(

- -Jeff

- --
Jeff Mahoney
SuSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBqidcLPWxlyuTD7IRAnb9AJ93lAymaFd2O6jotBU/56nU77e5bgCdF124
KzpH9IKqR+nG0c+jIGDTN98=
=UDnU
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-11-28 19:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-18 19:45 hashes in reiser3.6 Grzegorz Jaśkiewicz
2004-11-18 20:16 ` Jeff Mahoney
2004-11-20 23:00   ` Grzegorz Jaśkiewicz
2004-11-25  9:03     ` Vladimir Saveliev
2004-11-28 19:30     ` Jeff Mahoney

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.