summaryrefslogtreecommitdiffstats
path: root/fs/devfs-core.c
Commit message (Collapse)AuthorAgeFilesLines
* mtd: Add support for marking blocks as goodSascha Hauer2016-03-151-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Fix erasing of devices >4GiBSascha Hauer2016-02-091-1/+1
| | | | | | | | | When a device >4GiB is erased, not only the offset can be bigger than 4GiB, but also the size. This happens with the simplest command to erase a device: erase /dev/nand0. Make the size argument a 64bit type to make this work. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: Add symlink supportSascha Hauer2016-01-081-13/+63
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: When creating a new cdev, initialize device_nodeTrent Piepho2016-01-081-1/+4
| | | | | | | | | | | | | | | If a new cdev doesn't have a device_node defined when passed to devfs_create(), set it to the device_node of the parent device, if one exists. For non-partitions, like ocotp or eeprom devices, this is the correct thing to do. Partitions need to use, and do use, a different node. The code from commit 274e0b8dc48956babeaa2faf70bf8066e656b621 to set device_node in ocotp can be removed. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: devfs: Allow mount path in cdev_openSascha Hauer2015-10-151-1/+5
| | | | | | | When opening a cdev also allow a path beginning with /dev/ as some users of cdev_open already open coded this behaviour. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: Add function to find cdev by device_nodeSascha Hauer2015-09-011-0/+13
| | | | | | | | | | This adds a device_node member to struct cdev and a function to find a cdev by device_node. This also removes the setting of cdev->dev->device_node in the of partition parser. We must not set the device since it may not refer to a partition but to a whole device with partitions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drop CONFIG_PARTITION_NEED_MTDSascha Hauer2014-05-131-2/+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>
* 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/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>
* | mtd: register mtd partitions as real mtd devicesSascha Hauer2014-02-261-16/+14
|/ | | | | | | | So far mtd partitions were mtd devices, but these were not registered. This patch changes this. mtd partitions are now registered like real mtd devices. This makes them part of the device hierarchy. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Add subpagesize to mtd_info_userSascha Hauer2013-12-201-0/+1
| | | | | | | | | ubiformat needs the subpagesize to work correctly. The kernel uses sysfs to pass the subpagesize, but in barebox we have the possibility to extend struct mtd_info_user. Add a corresponding field and use it in ubiformat. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: add device_find_partitionSascha Hauer2013-07-151-0/+27
| | | | | | | device_find_partition allows to find a partition of a device with a particular name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: allow to open a struct cdevSascha Hauer2013-07-151-5/+11
| | | | | | | cdev_open() opens a cdev by name. This introduces cdev_do_open which allows to open a cdev when the cdev is already found by other means. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: introduce partition namesSascha Hauer2013-07-151-0/+3
| | | | | | | | currently most partition cdevs have the name <devname>.<partname> This makes it hard to find a partition by <partname>. This introduces a partname field in struct cdev so that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: let devfs_add_partition return the new partitionSascha Hauer2013-07-151-6/+6
| | | | | | Useful for unregistering later or for adding addional flags. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs & mtd: add MEMERASE ioctl supportWolfram Sang2012-12-191-1/+2
| | | | | | | | To make that, we need to shift mtd_erase before mtd_ioctl. ubi-utils need that, especially ubiformat. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs-core: add writesize in mtd partition ioctlAlexander Aring2012-10-231-0/+1
| | | | | | | Add writesize in mtd partition MEMGETINFO ioctl. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions: Make 64bit capableSascha Hauer2012-06-301-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make cdev 64bit capableSascha Hauer2012-06-301-4/+5
| | | | | | Next step to 64bit support: Make cdev size a 64bit type. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: fix arguments to bad block ioctlsSascha Hauer2012-06-301-3/+3
| | | | | | | | | In the Kernel the mtd ioctls expect a pointer to the offset, whereas barebox interprets the pointer itself as an offset. Since we want to add 64bit support for file sizes a pointer may not be sufficient, so align with the kernel and convert it to a pointer to the offset. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* complete: add delpart complete supportJean-Christophe PLAGNIOL-VILLARD2012-04-301-0/+19
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* devfs-code: fix warningJean-Christophe PLAGNIOL-VILLARD2012-01-161-1/+2
| | | | | | | | /opt/work/barebox/fs/devfs-core.c: In function 'partition_ioctl': /opt/work/barebox/fs/devfs-core.c:109:27: warning: unused variable 'reg' Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ioctl: add support for ECCGETSTATS and MEMGETREGIONINFOAlexander Aring2012-01-061-6/+33
| | | | | | | | | | Support added for ioctl of ECCGETSTATS and MEMGETREGIONINFO. Fix default handling in core.c to return -EINVAL, if request was unknown. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: pass flags to open functionSascha Hauer2011-12-151-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Create a unique cdev number for on demand devicesJuergen Beisert2011-11-281-0/+14
| | | | | | | | For disk like devices attached to MCI, ATA or USB it depends on the order they will be recognized. So an unique number for all disk like devices is required. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: factor out core devfs functionalitySascha Hauer2011-04-111-0/+236
This makes it possible to compile without devfs. devfs_create/devfs_remove is used by drivers and thus must still be present even without devfs support. Also, this patch adds cdev_open/cdev_close/cdev_flush/cdev_ioctl calls to work with devices without using the file api. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>