summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6Linus Torvalds2009-01-0221-474/+927
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'linux-next' of git://git.infradead.org/ubifs-2.6: (33 commits) UBIFS: add more useful debugging prints UBIFS: print debugging messages properly UBIFS: fix numerous spelling mistakes UBIFS: allow mounting when short of space UBIFS: fix writing uncompressed files UBIFS: fix checkpatch.pl warnings UBIFS: fix sparse warnings UBIFS: simplify make_free_space UBIFS: do not lie about used blocks UBIFS: restore budg_uncommitted_idx UBIFS: always commit on unmount UBIFS: use ubi_sync UBIFS: always commit in sync_fs UBIFS: fix file-system synchronization UBIFS: fix constants initialization UBIFS: avoid unnecessary calculations UBIFS: re-calculate min_idx_size after the commit UBIFS: use nicer 64-bit math UBIFS: fix available blocks count UBIFS: various comment improvements and fixes ...
| * UBIFS: add more useful debugging printsArtem Bityutskiy2008-12-311-0/+12
| | | | | | | | | | | | Print node sizes and maximum node sizes. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: print debugging messages properlyArtem Bityutskiy2008-12-311-10/+10
| | | | | | | | | | | | | | | | We cannot use ubifs_err() macro with DBGKEY() and DBGKEY1(), because this is racy and holding dbg_lock is needed. Use dbg_err() instead, which does have the lock held. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix numerous spelling mistakesArtem Bityutskiy2008-12-314-15/+14
| | | | | | | | Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: allow mounting when short of spaceArtem Bityutskiy2008-12-311-11/+29
| | | | | | | | | | | | | | | | It is fine if there is not free space - we should still allow mounting this FS. This patch relaxes the free space requirements and adds info dumps. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix writing uncompressed filesArtem Bityutskiy2008-12-312-1/+3
| | | | | | | | | | | | | | | | | | UBIFS does not disable compression if ui->flags is non-zero, e.g. if the file has "sync" flag. This is because of the typo which is fixed by this patch. The patch also adds a couple of useful debugging prints. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix checkpatch.pl warningsArtem Bityutskiy2008-12-316-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are mostly long lines and wrong indentation warning fixes. But also there are two volatile variables and checkpatch.pl complains about them: WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt + volatile int gc_seq; WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt + volatile int gced_lnum; Well, we anyway use smp_wmb() for c->gc_seq and c->gced_lnum, so these 'volatile' modifiers can be just dropped. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix sparse warningsArtem Bityutskiy2008-12-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fs/ubifs/compress.c:111:8: warning: incorrect type in argument 5 (different signedness) fs/ubifs/compress.c:111:8: expected unsigned int *dlen fs/ubifs/compress.c:111:8: got int *out_len fs/ubifs/compress.c:175:10: warning: incorrect type in argument 5 (different signedness) fs/ubifs/compress.c:175:10: expected unsigned int *dlen fs/ubifs/compress.c:175:10: got int *out_len Fix this by adding a cast to (unsigned int *). We guarantee that our lengths are small and no overflow is possible. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: simplify make_free_spaceArtem Bityutskiy2008-12-311-102/+49
| | | | | | | | | | | | | | | | The 'make_free_space()' function was too complex and this patch simplifies it. It also fixes a bug - the freespace test failed straight away on UBI volumes with 512 bytes LEB size. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: do not lie about used blocksArtem Bityutskiy2008-12-311-10/+0
| | | | | | | | | | | | | | | | | | | | Do not force UBIFS return 0 used space when it is empty. It leads to a situation when creating any file immediately produces tens of used blocks, which looks very weird. It is better to be honest and say that some blocks are used even if the FS is empty. And ext2 does the same. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: restore budg_uncommitted_idxArtem Bityutskiy2008-12-311-3/+12
| | | | | | | | | | | | | | | | | | UBIFS stores uncommitted index size in c->budg_uncommitted_idx, and this affect budgeting calculations. When mounting and replaying, this variable is not updated, so we may end up with "over-budgeting". This patch fixes the issue. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: always commit on unmountArtem Bityutskiy2008-12-311-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | UBIFS commits on unmount to make the next mount faster. Currently, it commits only if there is more than LEB size bytes in the journal. This is not very good, because journal size may be large (512KiB). And there may be few deletions in the journal which do not take much journal space, but which do introduce a lot of TNC changes and make mount slow. Thus, jurt remove this condition and always commit. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: use ubi_syncArtem Bityutskiy2008-12-311-6/+1
| | | | | | | | | | | | | | UBI now has (fake for now, though) synchronization call - use it. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: always commit in sync_fsArtem Bityutskiy2008-12-311-20/+18
| | | | | | | | | | | | | | | | | | | | Always run commit in sync_fs, because even if the journal seems to be almost empty, there may be a deletion which removes a large file, which affects the index greatly. And because we want better free space predictions after 'sync_fs()', we have to commit. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix file-system synchronizationArtem Bityutskiy2008-12-311-0/+18
| | | | | | | | | | | | | | | | | | | | Argh. The ->sync_fs call is called _before_ all inodes are flushed. This means we first sync write buffers and commit, then all inodes are synced, and we end up with unflushed write buffers! Fix this by forcing synching all indoes from 'ubifs_sync_fs()'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix constants initializationArtem Bityutskiy2008-12-311-5/+20
| | | | | | | | | | | | | | | | | | The c->min_idx_lebs constant depends on c->old_idx_sz, which is read from the master node. This means that we have to initialize c->min_idx_lebs only after we have read the master node. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: avoid unnecessary calculationsArtem Bityutskiy2008-12-231-1/+2
| | | | | | | | | | | | | | Do not calculate min_idx_lebs, because it is available in c->min_idx_lebs Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: re-calculate min_idx_size after the commitArtem Bityutskiy2008-12-231-0/+2
| | | | | | | | | | | | | | | | When we commit, but before we try to write anything to the flash media, @c->min_idx_size is inaccurate, because we do not re-calculate it after the commit. Do not forget to do this. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: use nicer 64-bit mathArtem Bityutskiy2008-12-236-35/+30
| | | | | | | | | | | | | | Instead of using do_div(), use better primitives from linux/math64.h. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix available blocks countArtem Bityutskiy2008-12-233-9/+13
| | | | | | | | | | | | | | | | | | | | Take into account that 2 eraseblocks are never available because they are reserved for the index. This gives more realistic count of FS blocks. To avoid future confusions like this, introduce a constant. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: various comment improvements and fixesArtem Bityutskiy2008-12-232-22/+24
| | | | | | | | Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: improve budgeting dumpArtem Bityutskiy2008-12-233-3/+16
| | | | | | | | | | | | Dump available space calculated by budgeting subsystem. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix tnc dumpingArtem Bityutskiy2008-12-231-1/+1
| | | | | | | | | | | | debugfs tnc dumping was broken because of an obvious typo. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: use PAGE_CACHE_MASK correctlyArtem Bityutskiy2008-12-231-2/+2
| | | | | | | | | | | | | | It has high bits set, not low bits set as the UBIFS code assumed. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: fix section mismatchAlexey Dobriyan2008-12-042-2/+2
| | | | | | | | | | | | | | | | This patch fixes the following section mismatch: WARNING: fs/ubifs/ubifs.o(.init.text+0xec): Section mismatch in reference from the function init_module() to the function .exit.text:ubifs_compressors_exit() Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: introduce LPT dump functionArtem Bityutskiy2008-12-035-48/+186
| | | | | | | | Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: dump stack in LPT check functionsArtem Bityutskiy2008-12-031-1/+6
| | | | | | | | | | | | | | It is useful to know how we got to the checking function when hunting the bugs. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: run debugging checks only if they are enabledArtem Bityutskiy2008-12-032-2/+10
| | | | | | | | | | | | | | | | Do not forget to check whether lpt debugging is enabled before running the check functions. This commit also makes some spelling fixes. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: add debugfs supportArtem Bityutskiy2008-12-034-20/+193
| | | | | | | | | | | | | | | | We need to have a possibility to see various UBIFS variables and ask UBIFS to dump various information. Debugfs is what we need. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: separate debugging fields outArtem Bityutskiy2008-12-039-113/+156
| | | | | | | | | | | | | | | | Introduce a new data structure which contains all debugging stuff inside. This is cleaner than having debugging stuff directly in 'c'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: avoid unnecessary checksKukkonen Mika2008-12-031-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have a habit of compiling kernel with EXTRA_CFLAGS="-Wextra -Wno-unused -Wno-sign-compare -Wno-missing-field-initializers" and so fs/ubifs/key.h give lots (~10) of these every time: CC fs/ubifs/tnc_misc.o In file included from fs/ubifs/ubifs.h:1725, from fs/ubifs/tnc_misc.c:30: fs/ubifs/key.h: In function 'key_r5_hash': fs/ubifs/key.h:64: warning: comparison of unsigned expression >= 0 is always true fs/ubifs/key.h: In function 'key_test_hash': fs/ubifs/key.h:81: warning: comparison of unsigned expression >= 0 is always true This patch fixes the warnings. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: introduce compression mount optionsArtem Bityutskiy2008-12-035-16/+59
| | | | | | | | | | | | | | | | It is very handy to be able to change default UBIFS compressor via mount options. Introduce -o compr=<name> mount option support. Currently only "none", "lzo" and "zlib" compressors are supported. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: use bit-fields to store compression typeArtem Bityutskiy2008-12-032-3/+11
| | | | | | | | | | | | | | Save a 4 bytes of RAM per 'struct inode' by stroring inode compression type in bit-filed, instead of using 'int'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * UBIFS: slight compression optimizationArtem Bityutskiy2008-12-032-3/+10
| | | | | | | | | | | | | | | | If data does not compress, it is better to leave it uncompressed because we'll read it faster then. So do not compress data if we save less than 64 bytes. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* | Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6Linus Torvalds2009-01-028-330/+305
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6: UBI: fix checkpatch.pl warnings UBI: simplify PEB protection code UBI: prepare for protection tree improvements UBI: return -ENOMEM upon failing vmalloc UBI: document UBI ioctls UBI: handle write errors in WL worker UBI: fix error path UBI: some code re-structuring UBI: fix deadlock UBI: fix warnings when debugging is enabled
| * | UBI: fix checkpatch.pl warningsArtem Bityutskiy2008-12-283-7/+8
| | | | | | | | | | | | | | | | | | Just minor indentation and "over 80 characters" fixes. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: simplify PEB protection codeXiaochuan-Xu2008-12-162-241/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UBI has 2 RB-trees to implement PEB protection, which is too much for simply prevent PEB from being moved for some time. This patch implements this using lists. The benefits: 1. No need to allocate protection entry on each PEB get. 2. No need to maintain balanced trees and walk them. Signed-off-by: Xiaochuan-Xu <xiaochuan-xu@cqu.edu.cn> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: prepare for protection tree improvementsXiaochuan-Xu2008-12-152-24/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch modifies @struct ubi_wl_entry and adds union which contains only one element so far. This is just a preparation for further changes which will kill the protection tree and make UBI use a list instead. Signed-off-by: Xiaochuan-Xu <xiaochuan-xu@cqu.edu.cn> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: return -ENOMEM upon failing vmallocStefan Roese2008-12-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Return with correct error code (-ENOMEM) from ubi_attach_mtd_dev() upon failing vmalloc(). Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: document UBI ioctlsArtem Bityutskiy2008-12-091-0/+4
| | | | | | | | | | | | | | | | | | | | | Update the ioctl-numbers.txt file, add UBI and DVB there (because they use the same ioctl numbers). Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: handle write errors in WL workerArtem Bityutskiy2008-12-052-25/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a PEB is moved and a write error happens, UBI switches to R/O mode, which is wrong, because we just copy the data and may select a different PEB and re-try this. This patch fixes WL worker's behavior. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: fix error pathArtem Bityutskiy2008-12-051-9/+18
| | | | | | | | | | | | | | | | | | | | | Make sure the resources had not already been freed before freeing them in the error path of the WL worker function. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: some code re-structuringArtem Bityutskiy2008-12-051-16/+23
| | | | | | | | | | | | | | | | | | Minor code re-structuring and commentaries fixes to improve readability. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: fix deadlockArtem Bityutskiy2008-12-051-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot call 'ubi_wl_get_peb()' with @ubi->buf_mutex locked, because 'ubi_wl_get_peb()' may force erasure, which, in turn, may call 'torture_peb()' which also locks the @ubi->buf_mutex and deadlocks. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: fix warnings when debugging is enabledArtem Bityutskiy2008-12-031-8/+18
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'ubi_io_read_vid_hdr()' and 'ubi_io_read_ec_hdr()' function have the 'verbose' argument which controls whether they should print a warning if the VID/EC header was not found or was corrupted. Some callers require the headers to be OK, and pass 1. Some allow a corrupted/not present header, and pass 0. if (UBI_IO_DEBUG) verbose = 1; And UBI_IO_DEBUG is 1 if CONFIG_MTD_UBI_DEBUG_MSG_BLD is true. So in this case the warning is printed all the time. This confuses people. Thus, do not print the messages as warnings if UBI_IO_DEBUG is true, but print them as debugging messages instead. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-nextLinus Torvalds2009-01-0212-50/+476
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: kbuild: ignore a few files in headers_check kbuild: add checks for include of linux/types in userspace headers kbuild: drop debugging leftover in tags.sh kbuild: document environment variables kbuild: make *config usage docs kbuild: disable sparse warning "returning void-valued expression" kbuild: in headers_install autoconvert asm/inline/volatile to __xxx__ kbuild: check for leaked CONFIG_ symbols to userspace headers_check.pl: disallow extern's kconfig: improve error messages for bad source statements kconfig: struct property commented kconfig: add comments to symbol flags kconfig: explain symbol value defaults m68k: fix recursive dependency in Kconfig
| * | kbuild: ignore a few files in headers_checkSam Ravnborg2009-01-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new check for asm/types.h and linux/types.h had a few false positives. o We cannot let linux/types.h include linux/types.h o The int-ll64.h and int-ll64.h define the types and are included by linux/types.h Handle this by hardcoding the filenames in the headers_check script. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
| * | kbuild: add checks for include of linux/types in userspace headersSam Ravnborg2009-01-021-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we see __[us](8|16|32|64) then we must include <linux/types.h> If wee see include of <asm/types.h> then we recommend <linux/types.h> Original script from Mike but modified by me. Cc: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
| * | kbuild: drop debugging leftover in tags.shSam Ravnborg2009-01-021-1/+0
| | | | | | | | | | | | | | | | | | | | | Noticed by Jike. Reported-by: "Jike Song" <albcamus@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
| * | kbuild: document environment variablesSam Ravnborg2009-01-022-3/+131
| | | | | | | | | | | | | | | | | | | | | | | | Add kbuild.txt to Documentation/kbuild More stuff can be added later - at least we have som of the varous environment variables documented now. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>