From: "Theodore Ts'o" <tytso@mit.edu>
To: Avi Deitcher <avi@deitcher.net>
Cc: linux-ext4@vger.kernel.org
Subject: Re: algorithm for half-md4 used in htree directories
Date: Fri, 15 Oct 2021 16:30:28 -0400 [thread overview]
Message-ID: <YWnk5K5+h/Ddd4Rr@mit.edu> (raw)
In-Reply-To: <CAF1vpki7HqHgXxWsTwMEo4yz592agzZ9c=F09o-1py+jtJpLSw@mail.gmail.com>
On Fri, Oct 15, 2021 at 12:43:33PM -0700, Avi Deitcher wrote:
> Thanks, Ted, I will try yours and step through it to figure out what is off.
>
> You ask a fair question: other than madness, why would someone want to
> recreate the exact algorithm?
>
> I have had a number of cases where I have needed to manipulate disks,
> filesystems, partition tables, etc. from within a non-C-source
> program. The options have been: fork/exec to some external program;
> run a VM where I can mount the fs and manipulate content as needed.
> Those both work, but have had issues in various environments.
>
> I made the mistake of saying, "well, all of this is just manipulating
> bytes on a disk image or block device; how hard could it be?" :-)
> So understanding the algorithm actually becomes important.
I think once you take a look at all of the "byte manipulation" that is
needed for any kind of non-trivial file system operation, you're
probably better off trying to figure out how to link the library in.
> I probably could link the library in if I am working on languages that
> support it (go, rust), but not all do, and there are reasons that is
> more difficult for the target use case.
Have you looked at SWIG? SWIG suppotrs a *lot* of lanaguages,
including Tcl, Python, Perl, Guile, Java, Ruby, Mzscheme, PHP, OCaml,
C#, Lua, R, Octave, Go, D, Javascript, Scilab, etc. If you end up
writing the equivalent of libext2fs for one language, it's really not
going to help you all that much for another language.
I also note you've not really been specific about "the target use
case". Is that something you'd be willing to say more about?
In any case, if you're interested in implementing SWIG bindings for
libext2fs, that is certainly something we could discuss integrating
into e2fsprogs, so that other people could also benefit from that
work. Let me know if you're interested!
- Ted
next prev parent reply other threads:[~2021-10-15 20:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 11:49 algorithm for half-md4 used in htree directories Avi Deitcher
2021-10-03 12:47 ` Avi Deitcher
2021-10-03 16:43 ` Andreas Dilger
2021-10-04 7:57 ` Avi Deitcher
2021-10-11 15:30 ` Avi Deitcher
2021-10-11 20:20 ` Theodore Ts'o
2021-10-12 2:58 ` Avi Deitcher
2021-10-12 17:30 ` Theodore Ts'o
2021-10-13 2:20 ` Avi Deitcher
2021-10-15 18:43 ` Avi Deitcher
2021-10-15 19:10 ` Theodore Ts'o
2021-10-15 19:43 ` Avi Deitcher
2021-10-15 20:30 ` Theodore Ts'o [this message]
2021-10-15 19:50 ` Theodore Ts'o
2021-10-18 16:56 ` Avi Deitcher
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=YWnk5K5+h/Ddd4Rr@mit.edu \
--to=tytso@mit.edu \
--cc=avi@deitcher.net \
--cc=linux-ext4@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox