* JFFS2 -- Journalling Flash File System, Version 2.
*
* Copyright © 2001-2007 Red Hat, Inc.
* Copyright © 2004-2010 David Woodhouse <dwmw2@infradead.org>
*
* Created by David Woodhouse <dwmw2@infradead.org>
*
* For licensing information, see the file 'LICENCE' in this directory.
*
*/
#ifndef _JFFS2_FS_SB
#define _JFFS2_FS_SB
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/completion.h>
#include <linux/mutex.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/rwsem.h>
#define JFFS2_SB_FLAG_RO 1
#define JFFS2_SB_FLAG_SCANNING 2
#define JFFS2_SB_FLAG_BUILDING 4
struct jffs2_inodirty;
struct jffs2_mount_opts {
bool override_compr;
unsigned int compr;
* space which may only be used by root cannot be used by the other
* users. This is implemented simply by means of not allowing the
* latter users to write to the file system if the amount if the
* available space is less then 'rp_size'. */
bool set_rp_size;
unsigned int rp_size;
};
jffs2_sb_info structs are named `c' in the source code.
Nee jffs_control
*/
struct jffs2_sb_info {
struct mtd_info *mtd;
uint32_t highest_ino;
uint32_t check_ino;
unsigned int flags;
struct task_struct *gc_task;
struct completion gc_thread_start;
struct completion gc_thread_exit;
struct mutex alloc_sem;
fields, and also to protect against
out-of-order writing of nodes. And GC. */
uint32_t cleanmarker_size;
(i.e. zero for OOB CLEANMARKER */
uint32_t flash_size;
uint32_t used_size;
uint32_t dirty_size;
uint32_t wasted_size;
uint32_t free_size;
uint32_t erasing_size;
uint32_t bad_size;
uint32_t sector_size;
uint32_t unchecked_size;
uint32_t nr_free_blocks;
uint32_t nr_erasing_blocks;
uint8_t resv_blocks_write;
uint8_t resv_blocks_deletion;
uint8_t resv_blocks_gctrigger;
uint8_t resv_blocks_gcbad;
uint8_t resv_blocks_gcmerge;
uint8_t vdirty_blocks_gctrigger;
uint32_t nospc_dirty_size;
uint32_t nr_blocks;
struct jffs2_eraseblock *blocks;
* from the offset (blocks[ofs / sector_size]) */
struct jffs2_eraseblock *nextblock;
struct jffs2_eraseblock *gcblock;
struct list_head clean_list;
struct list_head very_dirty_list;
struct list_head dirty_list;
struct list_head erasable_list;
struct list_head erasable_pending_wbuf_list;
struct list_head erasing_list;
struct list_head erase_checking_list;
struct list_head erase_pending_list;
struct list_head erase_complete_list;
struct list_head free_list;
struct list_head bad_list;
struct list_head bad_used_list;
spinlock_t erase_completion_lock;
against erase completion handler */
wait_queue_head_t erase_wait;
wait_queue_head_t inocache_wq;
int inocache_hashsize;
struct jffs2_inode_cache **inocache_list;
spinlock_t inocache_lock;
drop the erase_completion_lock while it's holding a pointer
to an obsoleted node. I don't like this. Alternatives welcomed. */
struct mutex erase_free_sem;
uint32_t wbuf_pagesize;
#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
unsigned char *wbuf_verify;
#endif
#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
unsigned char *wbuf;
uint32_t wbuf_ofs;
uint32_t wbuf_len;
struct jffs2_inodirty *wbuf_inodes;
struct rw_semaphore wbuf_sem;
struct delayed_work wbuf_dwork;
unsigned char *oobbuf;
int oobavail;
#endif
struct jffs2_summary *summary;
struct jffs2_mount_opts mount_opts;
#ifdef CONFIG_JFFS2_FS_XATTR
#define XATTRINDEX_HASHSIZE (57)
uint32_t highest_xid;
uint32_t highest_xseqno;
struct list_head xattrindex[XATTRINDEX_HASHSIZE];
struct list_head xattr_unchecked;
struct list_head xattr_dead_list;
struct jffs2_xattr_ref *xref_dead_list;
struct jffs2_xattr_ref *xref_temp;
struct rw_semaphore xattr_sem;
uint32_t xdatum_mem_usage;
uint32_t xdatum_mem_threshold;
#endif
void *os_priv;
};
#endif