Skip to contentSkip to conversation

losetup: rewrite

PATCH In review Davidlohr Bueso 2 participants 2 messages Sep 26, 2011 – Sep 30, 2011 Util-Linux package

lore
Share & tools
lore
#0 lore raw

cover losetup: rewrite

This is the first in a number of patchset series to come to rewrite this tool using the loopdev library. We also aim to add it to the sys-utils/ directory in the attempt to start cleaning up mount/.

Instead of a complete rewrite from scratch, like it was initially planned, its better to do it incrementally, which makes it easier to regression test.

Thanks,
Davidlohr

maintainer
#1 lore raw
Quoted 3 lines · Davidlohr Bueso

Instead of a complete rewrite from scratch, like it was initially planned, its better to do it incrementally, which makes it easier to regression test.

I agree, do it incrementally is better for review. Anyway for merge into master branch we need all changes.

Suggestion:

1. use directly lib/loopdev.c stuff in mount.c and umount.c

-- I did this yesterday. So you don't have to fight with
unreadable spaghetti in mount.c (check_loop() is hell)...

2. remove obsolete things (e.g. #ifdef !MAIN)

3. remove code around old non-64bit ioctls

4. remove lomount.h and loop.h (include/loopdev.h has to be enough)

5. move mount/lomount.c to sys-utils/losetup.c

6. use lib/loopdev.c stuff in sys-utils/losetup.c

- it should be possible to initialize one struct loopdev_cxt in main() and use it in all operations

- rather than many variables (capacity, find, all, showdev, assoc, delete, ...) use any enum for requested operation and switch(command) as a core of the main().

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com