]> git.neil.brown.name Git - lafs-utils.git/log
lafs-utils.git
13 years agolafs: allow some commands to open busy devices with --force master
NeilBrown [Thu, 5 May 2011 06:14:53 +0000 (16:14 +1000)]
lafs: allow some commands to open busy devices with --force

Useful for looking at the filesystem while the kernel is stuck.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoUse cpu_to_le64 for setting timestamp
NeilBrown [Thu, 5 May 2011 06:03:29 +0000 (16:03 +1000)]
Use cpu_to_le64 for setting timestamp

This isn't really needed for '0', but is a good reminded for
if/when we use real timestamps.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoSet correct usagetable in mkfs.
NeilBrown [Thu, 5 May 2011 06:02:26 +0000 (16:02 +1000)]
Set correct usagetable in mkfs.

Recently added this code to 'lafs' but missed 'mkfs.lafs'

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFORMAT CHANGE various changes to superblock
NeilBrown [Wed, 4 May 2011 07:05:29 +0000 (17:05 +1000)]
FORMAT CHANGE various changes to superblock

Simplify version
Add options
Allow reference to readonly base.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoIntroduce new Verify modes for multi-device writing.
NeilBrown [Wed, 4 May 2011 05:18:41 +0000 (15:18 +1000)]
Introduce new Verify modes for multi-device writing.

VerifyDevNext clusters are verified by the next header on the same
device.
VerifyDevNext2 by the next-but-one header on the same device.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFORMAT CHANGE add timestamp to group_head in write cluster
NeilBrown [Wed, 4 May 2011 03:47:43 +0000 (13:47 +1000)]
FORMAT CHANGE add timestamp to group_head in write cluster

This allows exact preservation of time stamp during roll forward

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFORMAT CHANGE use 32bit block counts in segment usage file.
NeilBrown [Wed, 4 May 2011 03:14:35 +0000 (13:14 +1000)]
FORMAT CHANGE use 32bit block counts in segment usage file.

This allows for much bigger segments.
Still use 16bit youth numbers.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFORMAT CHANGE use crc32 for cluster head rather than toy checksum
NeilBrown [Tue, 3 May 2011 05:57:34 +0000 (15:57 +1000)]
FORMAT CHANGE use crc32 for cluster head rather than toy checksum

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFORMAT CHANGE add parent field of InodeFile
NeilBrown [Tue, 3 May 2011 05:39:52 +0000 (15:39 +1000)]
FORMAT CHANGE add parent field of InodeFile

This is used to make it look more like a directory.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoVarious fixes - mostly missing code
NeilBrown [Mon, 2 May 2011 04:28:53 +0000 (14:28 +1000)]
Various fixes - mostly missing code

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs_load - fix crash on error
NeilBrown [Mon, 2 May 2011 02:12:34 +0000 (12:12 +1000)]
lafs_load - fix crash on error

We should be initialising *err, not just 'err'.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoShow seguage
NeilBrown [Mon, 2 May 2011 01:34:41 +0000 (11:34 +1000)]
Show seguage

Provide function to show segusage info, and fix some bugs exposed
by that new visibility.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix two bugs in different structs
NeilBrown [Sun, 27 Mar 2011 21:57:11 +0000 (08:57 +1100)]
Fix two bugs in different structs

1/ set version in state block
2/ increment cluster seq on each write out.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAssorted changes to scheduling
NeilBrown [Sun, 27 Mar 2011 20:12:50 +0000 (07:12 +1100)]
Assorted changes to scheduling

and a few 'trace' changes.
This seems to make checkpoint and flush both work properly.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoUse separate list for inodes with dirty blocks.
NeilBrown [Sun, 27 Mar 2011 20:10:00 +0000 (07:10 +1100)]
Use separate list for inodes with dirty blocks.

I was using the dirty/leafs list for tracking inodes with dirty
blocks, but that conflicts with the leafs/leafs lists some times,
so create a new dirty_inodes list.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoPrint uuid out in verbose printout of cluster header.
NeilBrown [Sun, 27 Mar 2011 20:04:27 +0000 (07:04 +1100)]
Print uuid out in verbose printout of cluster header.

If being verbose, we may as well be complete.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd 'clean' target to Makefiles
NeilBrown [Sat, 26 Mar 2011 00:04:38 +0000 (11:04 +1100)]
Add 'clean' target to Makefiles

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd printing of directory block
NeilBrown [Fri, 25 Mar 2011 23:57:57 +0000 (10:57 +1100)]
Add printing of directory block

Shows avl tree structure of a block given a virtual
address or a file address.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd 'source' command
NeilBrown [Fri, 25 Mar 2011 22:04:02 +0000 (09:04 +1100)]
Add 'source' command

this allows a command file to be sourced.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix setting wrong address in cluster head.
NeilBrown [Fri, 25 Mar 2011 22:03:35 +0000 (09:03 +1100)]
Fix setting wrong address in cluster head.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoLoad and Print cluster header
NeilBrown [Fri, 25 Mar 2011 22:03:34 +0000 (09:03 +1100)]
Load and Print cluster header

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd trace command to adjust tracing level
NeilBrown [Fri, 25 Mar 2011 22:03:32 +0000 (09:03 +1100)]
Add trace command to adjust tracing level

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd name creation in directories, and implement 'store'
NeilBrown [Fri, 25 Mar 2011 21:33:27 +0000 (08:33 +1100)]
Add name creation in directories, and implement 'store'

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix buglet in lafs_imap_set
NeilBrown [Fri, 25 Mar 2011 21:32:30 +0000 (08:32 +1100)]
Fix buglet in lafs_imap_set

condition was backwards so we never set these.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd B_Uninc flag.
NeilBrown [Fri, 25 Mar 2011 21:32:30 +0000 (08:32 +1100)]
Add B_Uninc flag.

We need to know if a block is already on an uninc list so we
don't put it there again.
So use a flag.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd lafs_find_free
NeilBrown [Fri, 25 Mar 2011 21:32:30 +0000 (08:32 +1100)]
Add lafs_find_free

to find some free segments.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoSupport flushing blocks without forcing them into a checkpoint.
NeilBrown [Fri, 25 Mar 2011 21:32:10 +0000 (08:32 +1100)]
Support flushing blocks without forcing them into a checkpoint.

Each inode has a list of blocks that are either dirty or own and
inode which has a list of blocks.

Then 'flush' can go through this list and flush them to a
write_cluster.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoRemove lots of white-space errors
NeilBrown [Thu, 24 Mar 2011 04:39:18 +0000 (15:39 +1100)]
Remove lots of white-space errors

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoinode map allocation
NeilBrown [Mon, 21 Mar 2011 09:19:26 +0000 (20:19 +1100)]
inode map allocation

add lafs_imap_alloc and use it to allocate an inode number for
segment usage file.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd 'remainder' arg to lafs_lookup_path
NeilBrown [Mon, 21 Mar 2011 06:39:29 +0000 (17:39 +1100)]
Add 'remainder' arg to lafs_lookup_path

This allows us to find where to create something.

If 'remainder' is provided, the tail of the path that couldn't
be found is placed there, and the last directory that was found is
returned.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd support for internal path lookup
NeilBrown [Mon, 21 Mar 2011 02:37:05 +0000 (13:37 +1100)]
Add support for internal path lookup

Also auto-completion of 'internal' path names.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd 'ls' command and directory searching.
NeilBrown [Sun, 20 Mar 2011 09:12:35 +0000 (20:12 +1100)]
Add 'ls' command and directory searching.

Also 'lafs_find_next' to find next allocated block.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd blockbits field to struct lafs
NeilBrown [Sun, 20 Mar 2011 07:34:28 +0000 (18:34 +1100)]
Add blockbits field to struct lafs

We will need it for directory manipulations.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: save history to ~/.lafs_history
NeilBrown [Sun, 20 Mar 2011 05:29:26 +0000 (16:29 +1100)]
lafs: save history to ~/.lafs_history

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd lafs_print_inode / show inode command
NeilBrown [Sun, 20 Mar 2011 05:23:05 +0000 (16:23 +1100)]
Add lafs_print_inode / show inode command

Plus a few bug-fixes

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMake write_* subcommands for a common 'write'.
NeilBrown [Sat, 19 Mar 2011 08:45:27 +0000 (19:45 +1100)]
Make write_* subcommands for a common 'write'.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoshow state command and library function
NeilBrown [Sat, 19 Mar 2011 08:37:36 +0000 (19:37 +1100)]
show state command and library function

Shows either a state block read of disk, or similar info for
current filesystem.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoadd mount command
NeilBrown [Sat, 19 Mar 2011 07:51:40 +0000 (18:51 +1100)]
add mount command

new command for 'lafs' and lafs_mount in library.

Doesn't load the root inode yet, just locates it.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: save device name in load_dev
NeilBrown [Sat, 19 Mar 2011 03:56:40 +0000 (14:56 +1100)]
lafs: save device name in load_dev

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: add "show device" and associated library routines.
NeilBrown [Sat, 19 Mar 2011 03:32:59 +0000 (14:32 +1100)]
lafs:  add "show device" and associated library routines.

"show device" can show a loaded device, or can show the device block
from an arbitrary location on a device.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: allow "--tag value" as well as "--tag=value"
NeilBrown [Fri, 18 Mar 2011 05:34:08 +0000 (16:34 +1100)]
lafs: allow "--tag value" as well as "--tag=value"

... as fingers seem like this pattern too.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd 'load_dev' command and matching library functions.
NeilBrown [Fri, 18 Mar 2011 05:24:28 +0000 (16:24 +1100)]
Add 'load_dev' command and matching library functions.

These will load the device blocks from a file, then load the
best state block, making sure everything is compatible.

Signed-off-by; NeilBrown <neilb@suse.de>

13 years agolafs: make 'statesize' a choice.
NeilBrown [Tue, 15 Mar 2011 09:28:30 +0000 (20:28 +1100)]
lafs: make 'statesize' a choice.

It must be a power of 2, so it can easily be a 'choice'.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGet lafs_add_device to add free segments to the list.
NeilBrown [Mon, 14 Mar 2011 01:22:17 +0000 (12:22 +1100)]
Get lafs_add_device to add free segments to the list.

This allows a full mkfs to complete.

Also fix a bug in lafs_add_inode.  A subsequent call to
lafs_get_inode would re-initialise the block.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: add write_checkpoint
NeilBrown [Mon, 14 Mar 2011 01:22:17 +0000 (12:22 +1100)]
lafs: add write_checkpoint

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: add write_state command
NeilBrown [Mon, 14 Mar 2011 01:22:17 +0000 (12:22 +1100)]
lafs: add write_state command

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: add write_dev command
NeilBrown [Mon, 14 Mar 2011 01:22:17 +0000 (12:22 +1100)]
lafs: add write_dev command

I probably want to make this "write dev" at some stage, so there will
also be "write state" and "write checkpoint"

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: Add creation of special inodes to newfs/add_device
NeilBrown [Mon, 14 Mar 2011 01:21:55 +0000 (12:21 +1100)]
lafs: Add creation of special inodes to newfs/add_device

Also add "lafs_get_inode" to library.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agolafs: add 'add_device' command
NeilBrown [Sun, 13 Mar 2011 23:12:20 +0000 (10:12 +1100)]
lafs: add 'add_device' command

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoSplit out size parsing into separate file
NeilBrown [Sun, 13 Mar 2011 22:46:19 +0000 (09:46 +1100)]
Split out size parsing into separate file

So we have common code for understanding 'K,M,G' suffix.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoSplit open_device out of mkfs.lafs
NeilBrown [Sun, 13 Mar 2011 22:46:17 +0000 (09:46 +1100)]
Split open_device out of mkfs.lafs

'lafs' will need this, so make it a separate file.
Not in liblafs as it isn't really that generic.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomkfs.lafs should give an error on size-zero devices.
NeilBrown [Sun, 13 Mar 2011 06:13:37 +0000 (17:13 +1100)]
mkfs.lafs should give an error on size-zero devices.

size==0 sometimes means we have already printed a message..

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd lafs_validate_geometry for mkfs.
NeilBrown [Sun, 13 Mar 2011 06:13:35 +0000 (17:13 +1100)]
Add lafs_validate_geometry for mkfs.

Split this out of mkfs and put it in library for 'lafs' to use.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd 'reset' and 'newfs' commands.
NeilBrown [Sun, 13 Mar 2011 03:39:07 +0000 (14:39 +1100)]
Add 'reset' and 'newfs' commands.

Also fix 'runfile' so it sees EOF, and add 'verbose' state.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoDiscard 'terminal' arg type.
NeilBrown [Sun, 13 Mar 2011 03:10:31 +0000 (14:10 +1100)]
Discard 'terminal' arg type.

At one stage during development, that 'tag' of a positional arg was
NULL so we couldn't used that to mark end-of-list, so we used
a special 'type' instead.
But now 'tag' is always non-NULL we can used tag==NULL to mark
end of list, so get rid of the 'terminal' type.

Fix some bugs too...

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd 'choice' argument type.
NeilBrown [Sun, 13 Mar 2011 02:55:03 +0000 (13:55 +1100)]
Add 'choice' argument type.

A 'choice' must be selected from a set list of options.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd new "lafs" program
NeilBrown [Sat, 12 Mar 2011 07:58:32 +0000 (18:58 +1100)]
Add new "lafs" program

"lafs" is similar to "debugfs" for ext[234].

It allows a LaFS to be examined and modified.
Various commands can be enterred, or read from a file.

This preliminary check-in only provides the infrastructure
for reading and parsing commands together with support for
context sensitive completion and help using readline.

Commands implemented are:
  ?  help  exit quit

Naturally more will follow.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomkfs: allow creation of a filesystem on a regular file.
NeilBrown [Wed, 2 Mar 2011 23:39:26 +0000 (10:39 +1100)]
mkfs: allow creation of a filesystem on a regular file.

Primarily for ease of testing.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomkfs: provide minimal feedback when creating array.
NeilBrown [Wed, 2 Mar 2011 23:23:09 +0000 (10:23 +1100)]
mkfs: provide minimal feedback when creating array.

Rather then silence, report number and size of segments.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomkfs: adjust segment size based on device size, and complain if it didn't work.
NeilBrown [Wed, 2 Mar 2011 23:17:47 +0000 (10:17 +1100)]
mkfs: adjust segment size based on device size, and complain if it didn't work.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd tracing control to liblafs
NeilBrown [Wed, 2 Mar 2011 23:02:31 +0000 (10:02 +1100)]
Add tracing control to liblafs

'printf' becomes 'trace' and can now be turned on/off by an
environment variable.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomkfs: add accesstime file to new filesystem
NeilBrown [Wed, 2 Mar 2011 22:44:45 +0000 (09:44 +1100)]
mkfs: add accesstime file to new filesystem

But allow this to be suppressed with --no-atime-file

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix compilation on 32bit arch.
NeilBrown [Fri, 15 Oct 2010 02:46:57 +0000 (13:46 +1100)]
Fix compilation on 32bit arch.

Some printf warnings.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMake filesystem name field variable-length.
NeilBrown [Sun, 10 Oct 2010 23:59:10 +0000 (10:59 +1100)]
Make filesystem name field variable-length.

This mirrors similar change in kernel module code.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoInitial checking of lafs-utils
NeilBrown [Fri, 1 Oct 2010 12:36:35 +0000 (22:36 +1000)]
Initial checking of lafs-utils

Basic mkfs.lafs works.

Signed-off-by: NeilBrown <neilb@suse.de>