Commit Graph
69 Commits
Author SHA1 Message Date
Jeff Mahoney 6bdb171b9e reiserfslib: add basic extended attribute helpers
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2014-03-11 16:39:52 -04:00
Jeff Mahoney e51777cf55 reiserfslib: add file data and directory iterators
This adds reiserfs_iterate_dir and reiserfs_iterate_file_data to
iterate over directories and file block/tail mapping.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2014-03-11 15:44:45 -04:00
Jeff Mahoney 1f65941572 mkreiserfs: move block_size_ok out of reiserfscore
block_size_ok is only used in mkreiserfs. We can pull it out of the
library.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2014-01-24 11:21:19 -05:00
Jeff Mahoney 31a4390ca6 debugreiserfs: fix incorrect memset size in unpack_stat_data
The memsets to initialize the stat data items were using the
size of the pointer rather than the structure.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2014-01-23 17:42:45 -05:00
Jeff Mahoney c3084a6d48 reiserfsprogs: remove dead code
gcc with -Wall was complaining about defined but unused code. I've removed
the functions/variables that weren't used.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2014-01-23 17:42:39 -05:00
Jeff Mahoney fe448aeac4 debugreiserfs: fix use after free while closing log
reiserfs_close(fs) frees fs and we were using it after freeing
to close the log.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-11-06 13:48:49 -05:00
Jeff Mahoney 57eac8416c reiserfsprogs: add helpers for constant endian routines
Initializing structures with little endian values requires a const
value. This means that the endian routines that are macro blocks
cause build failures.

This patch introduces constant_ macros that don't involve an
assignment. These can only be used with constant values or
unexpected results may occur.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-09-17 13:28:53 -04:00
Jeff Mahoney 19566d0878 build: introduce shared libreiserfscore.so and export it
In order to use reiserfs functionality in external programs, we need to
make a shared library and includes available.

This converts both libmisc and libreiserfscore into shared libraries, and
links libmisc into libreiserfscore. We also export the includes and
a pkg-config file.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:02:20 -04:00
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 20357cf349 reiserfsprogs: Fix sparse "warning: Using plain integer as NULL pointer"
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:02:18 -04:00
Jeff Mahoney dd29f49a6c sparse: move bitops functions to include/misc.h
The bitops functions were declared as 'extern inline' in include/misc.h but
weren't actually defined there. They were also defined as inline in
lib/misc.c, which can't actually happen if they're used elsewhere.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:00:03 -04:00
Jeff Mahoney a1623ca6b3 reiserfscore: rename usearch_by_position to reiserfs_search_by_position
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:00:03 -04:00
Jeff Mahoney b94873771b reiserfscore: make reiserfs_open's filename argument const
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:00:03 -04:00
Jeff Mahoney 0a714b0477 swab: protect le32_to_cpu and friends against being defined twice
When used as part of another project, these macros may already be defined.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 19:00:02 -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 a465518a51 .gitignore: Ignore the now-generated man page files. 2013-08-26 17:03:46 -04:00
Jeff Mahoney fe11487be9 Release 3.6.24. 2013-08-26 16:55:43 -04:00
Jeff Mahoney 98b84706a3 reiserfsprogs: autogenerate the version number in the man pages
The version string in the man pages was manually updated. Now it updates
when configure runs.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-26 16:35:40 -04:00
Victor Leschuck 14e8805a08 journal: fix division by 0 with one transaction in log
We have met a situation when reiserfsck segfaulted on one of our
partitions. I have performed a small research and the cause appeared
to be wrong detection of transaction count.

Our FS had only one journal transaction, however trans_count which was
passed to progbar_update() as maximum transaction value was detected
as (last_transaction - first_transaction) which in our case was 0.
Thus progbar_update() resulted in segmentation fault:

(gdb) bt
"Replaying journal", curr=1, max=0, dpynum=1) at progbar.c:80

Here is part of debugreiserfs -j output

Journal header (block #8210 of ./partition.bug):
    j_last_flush_trans_id 0
    j_first_unflushed_offset 0
    j_mount_id 10
    Device [0x0]
    Magic [0x4f0a099e]
    Size 8193 blocks (including 1 for journal header) (first block 18)
    Max transaction length 1024 blocks
    Max batch size 900 blocks
    Max commit age 30
Mountid 10, transid 10, desc 18, length 2, commit 21

I successfully reproduced it on versions 3.6.21 (which we were using)
and 3.6.23 (which I believe is the latest).

Attaching patch. Let me know your opinion. If I am wrong, please
comment, if I am correct, feel free to include patch into sources.

Thanks.

Signed-off-by: Victor Leschuk <vleschuk@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-23 10:26:41 -04:00
Jeff Mahoney d83a36e872 CREDITS: re-add historical note about namesys.com
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-13 10:32:43 -04:00
Jeff Mahoney e30941ed6f CREDITS/CONTACT: remove references to namesys.com
While Namesys drove almost all reiserfs development and was instrumental
in supporting it for many years, it has been offline for the past
6 years. All of its founders and employees have moved on to other
endeavors or are otherwise unavailable. This can be confusing to users
since the documentation points there either for background information
or to have bugs fixed.

This patch removes most of the non-historical references to
namesys.com and directs users to the reiserfs-devel list on vger.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-08-12 22:38:41 -04:00
Jeff Mahoney 79286a2382 resize_reiserfs: fix > 8TB printf formatting
When performing an offline resize of a file system that will grow
beyond 8 TB, we see negative block counts:

ReiserFS report:
blocksize             4096
block count           -1610612480 (1879048192)
free blocks           -1610702612 (1878982637)
bitmap block count    0 (57344)

The values are passed around appropriately but are printed
incorrectly.

Reported-by: Jimb Esser <wasteland@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-07-29 11:28:25 -04:00
Jeff Mahoney b4582fed40 Release 3.6.23. 2013-07-01 15:05:13 -04:00
Jeff Mahoney 1f028bced7 man: create links to common-prefix command names
We create links like fsck.reiserfs to reiserfsck but don't provide
the corresponding links to the man pages.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-07-01 14:50:36 -04:00
Jeff Mahoney 2b9f863109 reiserfsprogs: add symlinks for debugreiserfs and reiserfstune
We have convenience links for fsck and mkfs. Let's add them for
debug and tune.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2013-07-01 14:48:15 -04:00
Mike Frysinger 90d328136c fix out of tree builds
This allows you to build out of tree like:
	mkdir build
	../configure
	make

This also fixes `make distcheck` since that uses the above mechanism.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-30 17:51:42 -04:00
Mike Frysinger ecb8f6ed3c clean up io-failure-emulation logic a bit
Use standard autoconf macros rather than open coding the logic.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-30 17:51:38 -04:00
Mike Frysinger 942e488bcd clean up compiler flag handling
ENABLE_DEBUG isn't used anywhere, so punt it.

--enable-debug is only used to control whether to enable -W flags by
default.  But there's no harm just always doing that, so drop the
configure flag and enable the -W flags when they're available.

AC_CACHE_CHECK requires cache vars have "_cv_" in their name, so tweak
all the cache var names to include that.

That leaves us with the PRESET_CFLAGS logic which is pointless nowadays
as autoconf largely does the same thing for us.  It'll default to using
'-O2 -g -Wall' if the compiler supports it, so no need to do it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-30 17:51:35 -04:00
Mike Frysinger 2537d91514 drop -fPIC usage
We don't create any libraries so there's no need to build with -fPIC.
Drop it all.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-30 17:51:21 -04:00
Mike Frysinger 0a4186212d update gitignore
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-30 17:51:03 -04:00
Mike Frysinger 0964757ec7 configure: update automake invocation
This converts away from the old/deprecated AM_INIT_AUTOMAKE method.

Also enable the nice silent build by default.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-30 17:50:55 -04:00
Mike Frysinger d0cf6adf13 fix version number
We're at 3.6.22 now, not 3.6.21.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-30 17:48:00 -04:00
Mike Frysinger da62161095 rename configure.in -> configure.ac
Newer autotools complains if you use the old style name.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-30 17:47:07 -04:00
Jeff Mahoney 8105f5769b Updated changelog for 3.6.22 release. 2012-10-16 13:45:40 -04:00
Jeff Mahoney 4447ac6eb3 mkreiserfs: stop printing credits
The CREDITS file contains the credits for the reiserfsprogs. Users
have been complaining for years that they don't need to see them
at every invokation.

This patch removes it.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-11 15:57:28 -04:00
Jeff Mahoney 3466b34d99 reiserfscore: add support for register_printf_specifier
register_printf_modifier is causing build warnings complaining that
it is deprecated. This patch adds support for register_printf_specifier
and uses it if it's present. Otherwise, it will fall back to
register_printf_modifier.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-11 15:57:28 -04:00
Roy Marples d3e67ae2f4 reiserfsck: support fsck -f -n
Every other fsck util out there supports non-interactive forcing and this
change brings reiserfsck into line.

Signed-off-by: Roy Marples <roy@marples.name>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-11 15:57:27 -04:00
Jeff Mahoney f8b66d8084 reiserfscore: fix uninitialized variable warning in print_indirect_item
This patch fixes the following warning:
prints.c:403:20: warning: ‘num’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-10-11 15:57:26 -04:00