Lines Matching +full:- +full:- +full:disable +full:- +full:linux +full:- +full:aio

1 /* SPDX-License-Identifier: GPL-2.0+ */
5 * Copyright (C) 2006-2008 Nokia Corporation
7 * (C) Copyright 2008-2009
19 #include <linux/statfs.h>
20 #include <linux/fs.h>
21 #include <linux/err.h>
22 #include <linux/sched.h>
23 #include <linux/slab.h>
24 #include <linux/vmalloc.h>
25 #include <linux/spinlock.h>
26 #include <linux/mutex.h>
27 #include <linux/rwsem.h>
28 #include <linux/mtd/ubi.h>
29 #include <linux/pagemap.h>
30 #include <linux/backing-dev.h>
31 #include <linux/security.h>
32 #include "ubifs-media.h"
35 #include <asm-generic/atomic-long.h>
39 #include <linux/ctype.h>
40 #include <linux/time.h>
41 #include <linux/math64.h>
42 #include "ubifs-media.h"
59 * We "simulate" the Linux page struct much simpler here
69 /* linux/include/time.h */
87 /* linux/include/dcache.h */
90 * "quick string" -- eases parameter passing, but more importantly
106 /* include/linux/fs.h */
115 SB_FREEZE_COMPLETE = 4, /* ->freeze_fs finished successfully */
118 #define SB_FREEZE_LEVELS (SB_FREEZE_COMPLETE - 1)
159 * Keep mostly read-only and often accessed (especially for
228 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
346 * Filesystem subtype. If non-empty the filesystem type field
361 * Saved pool identifier for cleancache (-1 means none)
366 struct shrinker s_shrink; /* per-sb shrinker handle */
372 /* Being remounted read-only */
375 /* AIO completions deferred from interrupt context */
417 /* include/linux/mount.h */
456 * get_seconds() not really needed in the read-only implmentation
467 #define MAX_LFS_FILESIZE (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
473 * These are the fs-independent mount-flags: up to 32 flags are supported
475 #define MS_RDONLY 1 /* Mount read-only */
504 /* Inode flags - they have nothing to superblock flags now */
508 #define S_APPEND 4 /* Append-only file */
515 #define S_PRIVATE 512 /* Inode is fs-internal */
517 /* include/linux/stat.h */
531 /* include/linux/fs.h */
563 /* linux/include/dcache.h */
570 struct inode *d_inode; /* Where the name belongs to - NULL is
588 void *d_fsdata; /* fs-specific data */
600 spin_lock(&dentry->d_lock); in parent_ino()
601 res = dentry->d_parent->d_inode->i_ino; in parent_ino()
602 spin_unlock(&dentry->d_lock); in parent_ino()
625 (c)->vi.ubi_num, (c)->vi.vol_id, ##__VA_ARGS__)
631 (c)->vi.ubi_num, (c)->vi.vol_id, current->pid, \
636 (c)->vi.ubi_num, (c)->vi.vol_id, current->pid, \
641 (c)->vi.ubi_num, (c)->vi.vol_id, 0, \
646 (c)->vi.ubi_num, (c)->vi.vol_id, 0, \
652 * A variant of 'ubifs_err()' which takes the UBIFS file-sytem description
657 if (!(c)->probing) \
666 #define UBIFS_BLOCKS_PER_PAGE_SHIFT (PAGE_CACHE_SHIFT - UBIFS_BLOCK_SHIFT)
674 * least 2 LEBs: one for the index head and one for in-the-gaps method (which
684 * Currently we do not support inode number overlapping and re-using, so this
687 * 64-bit inode numbers, but this means more overhead.
701 /* Write-buffer synchronization timeout interval in seconds */
705 /* Maximum possible inode number (only 32-bit inodes are supported now) */
708 /* Number of non-data journal heads */
765 /* Maximum number of data nodes to bulk-read */
825 SCANNED_EMPTY_SPACE = -1,
826 SCANNED_A_NODE = -2,
827 SCANNED_A_CORRUPT_NODE = -3,
828 SCANNED_A_BAD_PAD_NODE = -4,
869 * struct ubifs_old_idx - index node obsoleted since last commit start.
870 * @rb: rb-tree node
889 * struct ubifs_scan_node - UBIFS scanned node information.
909 * struct ubifs_scan_leb - UBIFS scanned LEB information.
925 * struct ubifs_gced_idx_leb - garbage-collected indexing LEB.
930 * This data structure is used to temporary store garbage-collected indexing
931 * LEBs - they are not released immediately, but only after the next commit.
941 * struct ubifs_inode - UBIFS in-memory inode description.
945 * protected by @c->commit_sem;
950 * @dirty: non-zero if the inode is dirty
951 * @xattr: non-zero if this is an extended attribute inode
952 * @bulk_read: non-zero if bulk-read should be used
953 * @ui_mutex: serializes inode write-back with the rest of VFS operations,
954 * serializes "clean <-> dirty" state changes, serializes bulk-read,
972 * write-back must not write any of them before we have finished.
974 * The second reason is budgeting - UBIFS has to budget all operations. If an
978 * to have full control over inode "clean <-> dirty" transitions (and pages
980 * does not ask the file-system if it is allowed to do so (there is a notifier,
983 * "clean <-> dirty" transitions.
989 * The @ui_size is a "shadow" variable for @inode->i_size and UBIFS uses
990 * @ui_size instead of @inode->i_size. The reason for this is that UBIFS cannot
991 * make sure @inode->i_size is always changed under @ui_mutex, because it
1020 * struct ubifs_unclean_leb - records a LEB recovered under read-only mode.
1026 * cleaned but was not because UBIFS was mounted read-only. The information
1027 * is used to clean the LEB when remounting to read-write mode.
1039 * LPROPS_DIRTY: dirty > free, dirty >= @c->dead_wm, not index
1040 * LPROPS_DIRTY_IDX: dirty + free > @c->min_idx_node_sze and index
1041 * LPROPS_FREE: free > 0, dirty < @c->dead_wm, not empty, not index
1065 * struct ubifs_lprops - logical eraseblock properties.
1070 * @list: list of same-category lprops (for LPROPS_EMPTY and LPROPS_FREEABLE)
1071 * @hpos: heap position in heap of same-category lprops (other categories)
1085 * struct ubifs_lpt_lprops - LPT logical eraseblock properties.
1099 * struct ubifs_lp_stats - statistics of eraseblocks in the main area.
1138 * struct ubifs_cnode - LEB Properties Tree common node.
1156 * struct ubifs_pnode - LEB Properties Tree leaf node.
1176 * struct ubifs_nbranch - LEB Properties Tree internal node branch.
1194 * struct ubifs_nnode - LEB Properties Tree internal node.
1214 * struct ubifs_lpt_heap - heap of categorized lprops.
1248 * struct ubifs_wbuf - UBIFS write-buffer.
1249 * @c: UBIFS file-system description object
1250 * @buf: write-buffer (of min. flash I/O unit size)
1251 * @lnum: logical eraseblock number the write-buffer points to
1252 * @offs: write-buffer offset in this logical eraseblock
1253 * @avail: number of bytes available in the write-buffer
1254 * @used: number of used bytes in the write-buffer
1255 * @size: write-buffer size (in [@c->min_io_size, @c->max_write_size] range)
1258 * @sync_callback: write-buffer synchronization callback
1259 * @io_mutex: serializes write-buffer I/O
1262 * @softlimit: soft write-buffer timeout interval
1265 * @timer: write-buffer timer
1266 * @no_timer: non-zero if this write-buffer does not have a timer
1267 * @need_sync: non-zero if the timer expired and the wbuf needs sync'ing
1271 * The write-buffer synchronization callback is called when the write-buffer is
1273 * write-buffer padding and how much free space is left in the LEB.
1276 * spin-lock or mutex because they are written under both mutex and spin-lock.
1278 * spin-lock. Thus the data between @buf and @buf + @used can be read under
1303 * struct ubifs_bud - bud logical eraseblock.
1319 * struct ubifs_jhead - journal head.
1320 * @wbuf: head's write-buffer
1322 * @grouped: non-zero if UBIFS groups nodes when writing to this journal head
1324 * Note, the @buds list is protected by the @c->buds_lock.
1333 * struct ubifs_zbranch - key/coordinate/length branch stored in znodes.
1352 * struct ubifs_znode - in-memory representation of an indexing node.
1364 * @zbranch: array of znode branches (@c->fanout elements)
1366 * Note! The @lnum, @offs, and @len fields are not really needed - we have them
1385 * struct bu_info - bulk-read information.
1407 * struct ubifs_node_range - node length range description data structure.
1423 * struct ubifs_compressor - UBIFS compressor description structure.
1445 * struct ubifs_budget_req - budget requirements of an operation.
1447 * @fast: non-zero if the budgeting should try to acquire budget quickly and
1448 * should not try to call write-back
1449 * @recalculate: non-zero if @idx_growth, @data_growth, and @dd_growth fields
1450 * have to be re-calculated
1451 * @new_page: non-zero if the operation adds a new page
1452 * @dirtied_page: non-zero if the operation makes a page dirty
1453 * @new_dent: non-zero if the operation adds a new directory entry
1454 * @mod_dent: non-zero if the operation removes or modifies an existing
1456 * @new_ino: non-zero if the operation adds a new inode
1467 * re-calculating them when the budget is released. However, if @idx_growth is
1468 * %-1, it is calculated by the release function using other fields.
1471 * is 13 bits, and @dirtied_ino_d - 15, because up to 4 inodes may be made
1472 * dirty by the re-name operation.
1474 * Note, UBIFS aligns node lengths to 8-bytes boundary, so the requester has to
1491 /* Not bit-fields to check for overflows */
1507 * struct ubifs_orphan - stores the inode number of an orphan.
1508 * @rb: rb-tree node of rb-tree of orphans sorted by inode number
1531 * struct ubifs_mount_opts - UBIFS-specific mount options information.
1533 * @bulk_read: enable/disable bulk-reads (%0 default, %1 disable, %2 enable)
1534 * @chk_data_crc: enable/disable CRC data checking when reading data nodes
1535 * (%0 default, %1 disable, %2 enable)
1536 * @override_compr: override default compressor (%0 - do not override and use
1537 * superblock compressor, %1 - override and use compressor
1551 * struct ubifs_budg_info - UBIFS budgeting information.
1561 * @nospace: non-zero if the file-system does not have flash space (used as
1587 * struct ubifs_info - UBIFS file-system description data structure
1588 * (per-superblock).
1590 * @bdi: backing device info object to make VFS happy and disable read-ahead
1597 * @fmt_version: UBIFS on-flash format version
1612 * @buds_lock: protects the @buds tree, @bud_bytes, and per-journal head bud
1630 * @bulk_read: enable bulk-reads
1639 * @gap_lebs: array of LEBs used by the in-gaps commit method
1641 * @ileb_buf: buffer for commit in-the-gaps method
1645 * @ilebs: pre-allocated index LEBs
1646 * @ileb_cnt: number of pre-allocated index LEBs
1647 * @ileb_nxt: next pre-allocated index LEBs
1654 * @max_bu_buf_len: maximum bulk-read buffer length
1655 * @bu_mutex: protects the pre-allocated bulk-read buffer and @c->bu
1656 * @bu: pre-allocated bulk-read information
1692 * used to store indexing nodes (@leb_size - @max_idx_node_sz)
1695 * @old_leb_cnt: count of logical eraseblocks before re-size
1696 * @ro_media: the underlying UBI volume is read-only
1697 * @ro_mount: the file-system was mounted as read-only
1713 * @min_idx_node_sz: minimum indexing node aligned on 8-bytes boundary
1714 * @max_idx_node_sz: maximum indexing node aligned on 8-bytes boundary
1719 * data nodes of maximum size - used in free space reporting
1729 * @orph_tree: rb-tree of orphan inode numbers
1742 * @no_orphs: non-zero if there are no orphans
1747 * @need_wbuf_sync: if write-buffers have to be synchronized
1753 * @gc_seq: incremented for every non-index LEB garbage collected
1754 * @gced_lnum: last non-index LEB that was garbage collected
1757 * @umount_mutex: serializes shrinker and un-mount
1766 * @nnode_sz: size of on-flash nnode
1767 * @pnode_sz: size of on-flash pnode
1768 * @ltab_sz: size of on-flash LPT lprops table
1769 * @lsave_sz: size of on-flash LPT save table
1775 * @lp_mutex: protects lprops table and all the other lprops-related fields
1785 * @lpt_nod_buf: buffer for an on-flash nnode or pnode
1792 * @uncat_list: list of un-categorized LEBs
1794 * @freeable_list: list of freeable non-index LEBs (free + dirty == @leb_size)
1811 * @report_rp_size: size of the reserved pool reported to user-space
1816 * @need_recovery: %1 if the file-system needs recovery
1820 * @remounting_rw: %1 while re-mounting from R/O mode to R/W mode
1825 * @unclean_leb_list: LEBs to recover when re-mounting R/O mounted FS to R/W
1827 * @rcvrd_mst_node: recovered master node to write when re-mounting R/O mounted
1830 * @mount_opts: UBIFS-specific mount options
1832 * @dbg: debugging-related information
2047 /* The below fields are used only during mounting and re-mounting */