summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2016-03-17 11:00:29 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-08 13:33:18 +0200
commita63059d753680ce249942e2e6c4eba56c4840542 (patch)
tree5d6d708d353e9f90968a9e945f6eda100279b2c5 /include/linux
parent84abb49171ac2f7c7f52842a88ab7ebb31b015f6 (diff)
downloadbarebox-a63059d753680ce249942e2e6c4eba56c4840542.tar.gz
barebox-a63059d753680ce249942e2e6c4eba56c4840542.tar.xz
ubifs: update implementation from u-boot v2016.03
This updated code supports recovering from unclean unmounts when write buffer size is larger than 8. Linux uses takes information into consideration when checking for writes. The following list shows the changes for each file done compared to u-boot v2016.03 code. Makefile * Add gc.o, do not include header as in u-boot budget.c: * Replace __UBOOT__ with __BAREBOX__ debug.c: * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> * Replace current->pid with 0 debug.h * Replace __UBOOT__ with __BAREBOX__ * Add "0 &&" to ubifs_assert condition check U-Boot essentially disabled pr_crit output and dump_stack() is defined to do { } while (0), so ubifs_assert does nothing despite condition. gc.c: * Replace __UBOOT__ with __BAREBOX__ io.c: * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> key.h: * No changes log.c: * No changes lprops.c: * Replace __UBOOT__ with __BAREBOX__ lpt.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> * Remove #include <ubi_uboot.h> lpt_commit.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> master.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> * Remove #include <ubi_uboot.h> misc.h * Replace __UBOOT__ with __BAREBOX__ * Add #ifndef __BAREBOX__ around unneeded ubifs_current_time orphan.c * No changes recovery.c * Replace __UBOOT__ with __BAREBOX__ replay.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> sb.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> * Remove #include <ubi_uboot.h> * rp_uid and rp_gid are still uid_t, not kuid_t, so remove .val scan.c * Replace __UBOOT__ with __BAREBOX__ super.c: * Replaced current->pid with 0 * Replaced __UBOOT__ with __BAREBOX__ * Removed #include <ubi_uboot.h> * Removed #include <memalign.h> * Added #include <init.h> * Replaced malloc_cache_aligned with kzalloc * Replaced I_LOCK with I_SYNC * i_uid and i_gid are still uid_t, not kuid_t, so remove .val * Replaced string "U-Boot" with "Barebox" * Add #ifndef __BAREBOX__ around open_ubi, sb_test, sb_set, ubifs_mount, kill_ubifs_super, ubifs_fs_type * Do not call ubi_open_volume or ubi_close_volume in ubifs_fill_super Those will already be handled in ubifs_probe * Replaced uboot_ubifs_mount with new ubifs_get_super implementation using existing functions alloc_super, alloc_ubifs_info tnc.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> tnc_misc.c * Replace __UBOOT__ with __BAREBOX__ ubifs-media.h * Replace __UBOOT__ with __BAREBOX__ ubifs.c: * Replaced __UBOOT__ with __BAREBOX__ * Adjusted header includes * Removed DECLARE_GLOBAL_DATA_PTR * Add static struct z_stream_s variable * Add struct ubifs_priv delcaration * Replaced zunzip with deflate_decompress call * Add ifdef for disabling ZLIB and/or LZO support * Replaced malloc_cache_aligned with kzalloc * Added #ifndef __BAREBOX__ around filldir, ubifs_printdir, ubifs_set_blk_dev, ubifs_ls, ubifs_exists, ubifs_size, do_readpage, ubifs_read, ubifs_close, ubifs_load * Make parameter filename const char* in ubifs_findfile * Add UBIFS fs_driver_d implementation * Add zlib_decomp_init, ubifs_init ubifs.h: * Replaced __UBOOT__ with __BAREBOX__ * Adjusted header includes * Added old #define crc32 * Added helper around kmem* * Added XATTR_LIST_MAX define * Added #ifndef __BAREBOX__ around current_fs_time struct inode, struct super_block, file_system_type, dentry and friends which barebox already has * Added #ifndef __BAREBOX__ around write_inode in super_operations to avoid declaration of writeback_control * Change rp_uid and rp_gid to uid_t and gui_t * Added struct device_d to struct ubifs_info * Added forward declaration of ubifs_get_super linux/fs.h: * Make struct inode's i_nlink a union containing a non-const int __i_nlink while making i_nlink a const int linux/fs.h: * Add s_remove_count linux/fs.h: * Convert struct super_block.s_instances and struct file_system_type.fs_supers to hlist_head Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index d5b232b48f..c1a5802eea 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -81,7 +81,17 @@ struct inode {
struct list_head i_sb_list;
struct list_head i_dentry;
unsigned long i_ino;
- unsigned int i_nlink;
+ /*
+ * Filesystems may only read i_nlink directly. They shall use the
+ * following functions for modification:
+ *
+ * (set|clear|inc|drop)_nlink
+ * inode_(inc|dec)_link_count
+ */
+ union {
+ const unsigned int i_nlink;
+ unsigned int __i_nlink;
+ };
uid_t i_uid;
gid_t i_gid;
dev_t i_rdev;
@@ -170,7 +180,7 @@ struct super_block {
struct block_device *s_bdev;
struct mtd_info *s_mtd;
- struct list_head s_instances;
+ struct hlist_node s_instances;
int s_frozen;
wait_queue_head_t s_wait_unfrozen;
@@ -200,6 +210,8 @@ struct super_block {
* generic_show_options()
*/
char *s_options;
+
+ /* Number of inodes with nlink == 0 but still referenced */
};
struct file_system_type {
@@ -210,7 +222,7 @@ struct file_system_type {
void (*kill_sb) (struct super_block *);
struct module *owner;
struct file_system_type * next;
- struct list_head fs_supers;
+ struct hlist_head fs_supers;
};
struct file {