Commit Graph
26 Commits
Author SHA1 Message Date
Jeff Mahoney 97fa944851 reiserfsprogs: convert reiserfs_filsys_t from structure to pointer-to-structure
This makes it more consistent with e2fsprogs.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:02:20 -04:00
Jeff Mahoney 81aeadf510 reiserfsprogs: annotate for endian safeness
By annotating structure members and other on-disk structures as little
endian, we can catch bugs more easily.

The code was already endian safe except for three minor spots:
1) The badblock list code was initializing its key in an endian-unsafe way.
2) Indirect block pointer sequence printing was treating cpu-order values
   as little endian.
3) reiserfsck was trying to do endian switching on the lost+found key,
   but it was before it was even initialized to anything, so we can
   just remove that completely.

These issues were fixed as part of this commit.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:02:20 -04:00
Jeff Mahoney 767f7b85df reiserfsprogs: fix remaining sparse warnings
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:02:19 -04:00
Jeff Mahoney 4ff866cd6c reiserfs_fs.h: Eliminate overlays in offset_v2 helpers
The upstream kernel got rid of the per-endian implementations of
the offset_v2 helpers in favor of explicitly accessing by little
endian bitranges.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:00:02 -04:00
Jeff Mahoney ad42b07bcf reiserfscore: move endian helpers for offset_v2 into header
We'll need to use these helpers from library callers.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:00:02 -04:00
Jeff Mahoney 66af734015 reiserfs_fs.h: Fix ifndef for multiple inclusion
The ifndef was keying off REISERFSPROGS_FS_H, but defining REISERFSPRIGS_FS_H

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:00:02 -04:00
Jeff Mahoney d442d18969 cleanup: remove unused argument to reiserfs_invalidate_buffer
reiserfs_invalidate_buffer contains an argument to specify whether a block
should be freed after being invalidated. It is always passed as 1, so
let's just get rid of it.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 17:21:08 -04:00
Jeff Mahoney 863ef57982 cleanup: remove dead code
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 17:17:38 -04:00
Jeff Mahoney 45964148f5 cleanup: remove unnecessary fs pointer passed with buffer_infos
There are a bunch of leaf helpers that accept a reiserfs_filsys_t when
one is passed via the buffer_info.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 17:15:33 -04:00
Jeff Mahoney 867cfbbb3e cleanup: factor out buffer_info initialization into helpers
We open code buffer_info initialization all over the place. Let's
factor that out so we don't reproduce the code everywhere.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 17:15:33 -04:00
Jeff Mahoney c1ff1d5d2d cleanup: rename key and item_head accessors to more friendly names
This patch does a quick search and replace:
B_N_PITEM_HEAD() -> item_head()
B_N_PDELIM_KEY() -> internal_key()
B_N_PKEY() -> leaf_key()
B_N_PITEM() -> item_body()

And the item_head version:
B_I_PITEM() -> ih_item_body()
I_ENTRY_COUNT() -> ih_entry_count()

And the treepath variants:
get_ih() -> tp_item_head()
PATH_PITEM_HEAD() -> tp_item_head()
get_item() -> tp_item_body()

... which makes the code much easier on the eyes.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 17:15:33 -04:00
Jeff Mahoney 290bb8c378 cleanup: remove trailing whitespace
This patch just removes trailing whitespace.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 17:15:32 -04:00
Jeff Mahoney 47cff72748 cleanup: run indent with the Linux Kernel style across all code
Over the years, the reiserfs kernel code has been gradually cleaned up
to be more readable. This patch does the same to the progs code.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 17:14:42 -04:00
Jeff Mahoney b23d40f723 cleanup: rename common structure names
In order to convert reiserfscore into a externally-usable library,
we need to rename structures so they won't collide with other
namespaces.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 17:12:09 -04:00
Jeff Mahoney b337b2b190 reiserfsprogs: fix -Wpointer-sign warnings for blocksize and position
This patch fixes the following warnings:
pointer targets in passing argument 5 of ‘reiserfs_bin_search’ differ in signedness [-Wpointer-sign]
pointer targets in passing argument 2 of ‘init_rollback_file’ differ in signedness [-Wpointer-sign]

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-11 15:57:26 -04:00
Jeff Mahoney 3aa83f72ca reiserfsprogs: fix unsigned char with strlen/strcmp/strncpy warnings
This patch fixes a bunch of the following warnings:
warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness [-Wpointer-sign]
warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness [-Wpointer-sign]

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-11 15:57:25 -04:00
Jeff Mahoney 0265fd70c1 reiserfs: Fix signedness issues for large file systems
Now that we handle file systems > 8 TB, we end up printing large negative
numbers instead of actual block numbers. This patch fixes those places
to use unsigned ints for block numbers.

Signed-by: Jeff Mahoney <jeffm@suse.com>
2012-10-11 11:56:48 -04:00
Jeff Mahoney 149a82e2e9 Imported reiserfsprogs-3.6.21 2012-10-11 11:32:39 -04:00
Jeff Mahoney dac518d099 Imported reiserfsprogs-3.6.20 2012-10-11 11:32:09 -04:00
Jeff Mahoney 0ed773997f Imported reiserfsprogs-3.6.19 2012-10-11 11:31:31 -04:00
Jeff Mahoney 3078c83c48 Imported reiserfsprogs-3.6.18 2012-10-11 11:30:57 -04:00
Jeff Mahoney 18057cdad6 Imported reiserfsprogs-3.6.13 2012-10-11 11:30:27 -04:00
Jeff Mahoney cccefa4d84 Imported reiserfsprogs-3.6.9 2012-10-11 11:29:29 -04:00
Jeff Mahoney 99c89460c3 Imported reiserfsprogs-3.6.4 2012-10-11 11:28:37 -04:00
Jeff Mahoney b69459eb80 Imported reiserfsprogs-3.6.2 2012-10-11 11:27:42 -04:00
Jeff Mahoney e7102bdb66 Initial commit -- seeded with reiserfsprogs 3.x.0j 2012-10-11 11:26:22 -04:00