summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/fs'Sascha Hauer2015-03-0913-59/+59
|\
| * fs: rename inode member of struct filep to privSascha Hauer2015-03-0913-59/+59
| | | | | | | | | | | | | | Because that's what it is. 'inode' will become confusing once we support real inodes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: make "offset" parameter of erase() and protect() 64 bit safeMarc Kleine-Budde2015-03-031-2/+2
|/ | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* linux/kernel.h: rename USHORT_MAX, SHORT_MAX, SHORT_MINMasahiro Yamada2015-01-211-1/+1
| | | | | | | | Linux uses SHRT_* instead of SHORT_*. The <limits.h> of C does the same. Let's follow this standard. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: ubifs: remove redundant macro definesMasahiro Yamada2015-01-211-4/+0
| | | | | | | | | | fs/ubifs/ubifs.h includes <common.h> and the macros INT_MAX, INT_MIN, LLONG_MAX are already defined there. The same defines in fs/ubifs/ubifs.h are redundant. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-01-092-2/+2
|\
| * sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: efivars: implement write supportLucas Stach2014-12-091-0/+105
| | | | | | | | | | | | | | | | Implement the standard FS ops for writing/manipulating efivars. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: efivars: don't store attributes in fileLucas Stach2014-12-091-7/+6
| | | | | | | | | | | | | | | | | | We don't have a use-case yet where we need to manipulate the attributes of a variable and it confuses "normal" users of the variables. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: efivar: preserve more info in inodeLucas Stach2014-12-091-5/+10
| | | | | | | | | | | | | | Preserve info needed for easy manipulation of variables. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: efivar: move variable discovery into probeLucas Stach2014-12-091-51/+58
| | | | | | | | | | | | | | So we can manipulate things easier. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: efivar: switch to standard list implementationLucas Stach2014-12-091-21/+13
| | | | | | | | | | | | | | | | Cleans the code a bit and will allow us to implement removing of vars quite a bit easier. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: efivars: cosmetic changesLucas Stach2014-12-091-4/+4
|/ | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/randconfig-1'Sascha Hauer2014-12-081-0/+1
|\
| * fs: bpkfs: select CRC32Sascha Hauer2014-11-281-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: uImagefs: select crc32Sascha Hauer2014-11-271-0/+1
|/ | | | | | It needs it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: implement fstatSascha Hauer2014-10-081-0/+16
| | | | | | | fstat is useful to get information about an already opened file. Add it to barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: Store the path in struct filepSascha Hauer2014-10-081-0/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: do not lookup global FILE * when the file is already availableSascha Hauer2014-10-081-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: store pointer to fsdev instead of dev in struct filepSascha Hauer2014-10-082-50/+29
| | | | | | | | The struct device_d * in struct filep is never of interest, instead it is always converted to a struct fs_device_d *, so simplify the code by storing the struct fs_device_d * directly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/metadata'Sascha Hauer2014-08-072-72/+1
|\ | | | | | | | | | | | | Conflicts: arch/arm/dts/Makefile common/Makefile lib/Makefile
| * move file helper functions to separate fileSascha Hauer2014-08-072-72/+1
| | | | | | | | | | | | | | | | | | | | We have our file helper functions in several places. Move them all to lib/libfile.c. With this we no longer have file helpers in fs/fs.c which contains the core fs functions and no functions in lib/libbb.c which are not from busybox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/efi'Sascha Hauer2014-08-075-2/+922
|\ \ | |/ |/| | | | | | | | | Conflicts: .gitignore Makefile drivers/serial/Makefile
| * fs: implement EFI variable filesystem driverSascha Hauer2014-07-163-0/+348
| | | | | | | | | | | | | | | | This implements a filesystem for accessing EFI variables. It is compatible to the Linux Kernel efivarfs filesystem. Currently the variables can only be accessed readonly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fs: implement EFI filesystem driverSascha Hauer2014-07-163-0/+572
| | | | | | | | | | | | | | This implements a filesystem driver which uses the EFI Simple File System Protocol to provide files from EFI to barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fat: Use correct format specifierSascha Hauer2014-07-111-2/+2
| | | | | | | | | | | | Use %zd to print size_t arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: ext4: le32_to_cpu() used on a 16-bit fieldSascha Hauer2014-07-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From U-Boot commit: | commit 8b415f703f88d1d3b0466830047affbbf7f24913 | Author: Rommel Custodio <sessyargc+uboot@gmail.com> | Date: Sun Jul 21 10:53:25 2013 +0200 | | ext4fs: le32_to_cpu() used on a 16-bit field | | Fix reading ext4_extent_header struture on BE machines. Some 16 bit | fields where converted to 32 bit fields, due to the byte swap on BE | machines the containing value was corrupted. Therefore reading ext4 | filesystems on BE machines where broken before. | | Signed-off-by: Rommel Custodio <sessyargc+uboot@gmail.com> | [sent via git-send-email; rework commit message] | Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> | Reviewed-by: Simon Glass <sjg@chromium.org> | Tested-by: Simon Glass <sjg@chromium.org> | Tested-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: ext4: use EXT2_BLOCK_SIZE instead of fs->blkszSascha Hauer2014-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From U-Boot commit: | commit 470173274d9ceb18a7140ef93e20be6c2236e7d9 | Author: Ionut Nicu <ioan.nicu.ext@nsn.com> | Date: Mon Jan 13 11:59:24 2014 +0100 | | ext4fs: use EXT2_BLOCK_SIZE instead of fs->blksz | | Using fs->blksz in ext4fs_get_extent_block() is not | correct since fs->blksz is not initialized on the | read path. Use EXT2_BLOCK_SIZE() instead which will | produce the desired output. | | Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com> | Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: ext4: fix "invalid extent block" errorSascha Hauer2014-07-251-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From U-Boot commit: | commit b5bbac1a9b07016602559ff483df265fef6c1f83 | Author: Ionut Nicu <ioan.nicu.ext@nsn.com> | Date: Mon Jan 13 12:00:08 2014 +0100 | | ext4fs: fix "invalid extent block" error | | For files where we actually have extent indexes following | an extent header (ext_block->eh_depth != 0), the do/while | loop from ext4fs_get_extent_block() does not select the | proper extent index structure. | | For example, if we have: | | ext_block->eh_depth = 1 | ext_block->eh_entries = 1 | fileblock = 0 | index[0].ei_block = 0 | | the do/while loop will exit with i set to 0 and the | ext4fs_get_extent_block() function will return 0, even if | there was a valid extent index structure following the | header. | | Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com> | Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* automount: check for recursive automountSascha Hauer2014-07-031-1/+9
| | | | | | | | | | | | | automount_mount calls run_command which may trigger an automount again. This results in an endless loop. A simple way to trigger this is: mkdir /x; automount /x false; cd /x; something Use a static variable to detect if we are currently in automount_mount() and bail out if we are. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drop CONFIG_PARTITION_NEED_MTDSascha Hauer2014-05-132-5/+2
| | | | | | | | | | | | | | | | | | | | | | With CONFIG_PARTITION_NEED_MTD enabled we use mtd rather than devfs directly to create partitions on mtd devices. Since: | commit b32cd8df87b87ef744365138e145b829c02eb719 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Wed Apr 9 15:49:32 2014 +0200 | | mtd: nand: bb: use mtd api directly | | The devfs layer just adds an addition indirection between mtd | and the bb devices with no purpose. Drop it. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> The bad block aware device creation doesn't work if this option is disabled. With this we remove CONFIG_PARTITION_NEED_MTD and always use mtd partitions on mtd devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* tftp: add timeframe when remote server is retransmittingChristoph Fritz2014-05-051-3/+5
| | | | | | | | | | | | | If there's packet loss and the remote server needs to retransmit, there is falsely no timeframe left because TIMEOUT (server wait time) and TFTP_TIMEOUT (abort timer) are the same. This patch increases TFTP_TIMEOUT. See RFC2349 for more info: http://tools.ietf.org/html/rfc2349 Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubifs: Remove unused variableAlexander Shiyan2014-04-231-4/+0
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs-core: return new cdev also for mtd partitionsSascha Hauer2014-04-091-1/+1
| | | | | | | __devfs_add_partition returns the newly created cdev, but in case of mtd partitions it accidently returns 0. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ubi'Sascha Hauer2014-03-073-16/+29
|\ | | | | | | | | Conflicts: drivers/mtd/ubi/cdev.c
| * fs: ubifs: rework loggingSascha Hauer2014-02-283-16/+27
| | | | | | | | | | | | | | | | By default UBIFS is very verbose. Decrease the verbosity, turn printf messages into ubifs_ messages and add device parameters for the values which are not printed anymore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fs: ubifs: Fix unused function warningSascha Hauer2014-02-281-0/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/partitionhelper'Sascha Hauer2014-03-071-17/+83
|\ \ | | | | | | | | | | | | Conflicts: fs/devfs-core.c
| * | devfs: partitioning: add new helper devfs_create_partitionsUwe Kleine-König2014-02-281-17/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compared to devfs_add_partition which adds a single partition devfs_create_partitions creates several partitions at once. One nice benefit is that this simplifies appending partitions because the start of the latter partition doesn't need to be specified explicitly. Also dev_add_bb_dev() is called by the new helper if the bbname is specified for a partition. Note that adding partitions is also more flexible now (also via devfs_add_partition) because negative values for offset and size now have a proper meaning instead of creating broken partitions. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | devfs_add_partition: make flags parameter unsignedUwe Kleine-König2014-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The value is only used to assign to a (*struct cdev)->flags which is an unsigned int and it is passed as fourth parameter of mtd_add_partition which is an unsigned long. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | devfs: partitioning: add missing free in error pathUwe Kleine-König2014-02-281-0/+1
| |/ | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/nfs'Sascha Hauer2014-03-075-319/+702
|\ \ | | | | | | | | | | | | Conflicts: defaultenv/defaultenv-2-base/bin/ifup
| * | run_command: remove unused flag parameterSascha Hauer2014-03-071-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nfs: parse nfsport and mount port from file system optionsUwe Kleine-König2014-02-104-12/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to use unfs3 on the server side which doesn't integrate into portmap/rpcbind which results in the port not being impossible to lookup via rpc calls to the portmap program. Use it like: mount -t nfs -o port=2703,mountport=2703 192.168.77.157:/root /mnt/nfs Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mount: support filesystem options passed via -oUwe Kleine-König2014-02-101-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to mount(8) the barebox command mount now supports passing a string to the file system driver via -o. This is used in the next commit to let the user specify port numbers for nfs mounts. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nfs: switch to nfs3Uwe Kleine-König2014-02-101-269/+625
| | | | | | | | | | | | | | | | | | | | | This was tested against nfs-kernel-server and unfs3. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nfs: drop an unneeded variable from nfs_do_open()Uwe Kleine-König2014-02-101-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | While at it also fix the type of flen holding a string length (int -> size_t). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nfs: simplify rpc_lookup_reqUwe Kleine-König2014-02-101-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | Instead of letting rpc_lookup_req set mount_port and nfs_port, let it return the port found and let the caller use that information. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nfs: shorten and simplify rpc_add_credentials a bitUwe Kleine-König2014-02-101-21/+5
| | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nfs: skip over stale rpc packetsUwe Kleine-König2014-02-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a former transaction was aborted by hitting Ctrl-C the old reply might still hang in the ethernet controller making all further transactions fail. So just skip over old replies. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>