Lines Matching refs:ubifs_info
645 struct ubifs_info;
648 typedef int (*ubifs_lpt_scan_callback)(struct ubifs_info *c,
684 struct ubifs_info *c;
692 int (*sync_callback)(struct ubifs_info *c, int lnum, int free, int pad);
1255 struct ubifs_info { struct
1512 static inline int ubifs_authenticated(const struct ubifs_info *c) in ubifs_authenticated() argument
1517 struct shash_desc *__ubifs_hash_get_desc(const struct ubifs_info *c);
1518 static inline struct shash_desc *ubifs_hash_get_desc(const struct ubifs_info *c) in ubifs_hash_get_desc()
1523 static inline int ubifs_shash_init(const struct ubifs_info *c, in ubifs_shash_init()
1532 static inline int ubifs_shash_update(const struct ubifs_info *c, in ubifs_shash_update()
1547 static inline int ubifs_shash_final(const struct ubifs_info *c, in ubifs_shash_final()
1553 int __ubifs_node_calc_hash(const struct ubifs_info *c, const void *buf,
1555 static inline int ubifs_node_calc_hash(const struct ubifs_info *c, in ubifs_node_calc_hash()
1564 int ubifs_prepare_auth_node(struct ubifs_info *c, void *node,
1576 static inline int ubifs_check_hash(const struct ubifs_info *c, in ubifs_check_hash()
1591 static inline int ubifs_check_hmac(const struct ubifs_info *c, in ubifs_check_hmac()
1597 void ubifs_bad_hash(const struct ubifs_info *c, const void *node,
1600 int __ubifs_node_check_hash(const struct ubifs_info *c, const void *buf,
1602 static inline int ubifs_node_check_hash(const struct ubifs_info *c, in ubifs_node_check_hash()
1611 int ubifs_init_authentication(struct ubifs_info *c);
1612 void __ubifs_exit_authentication(struct ubifs_info *c);
1613 static inline void ubifs_exit_authentication(struct ubifs_info *c) in ubifs_exit_authentication()
1627 static inline u8 *ubifs_branch_hash(struct ubifs_info *c, in ubifs_branch_hash()
1641 static inline void ubifs_copy_hash(const struct ubifs_info *c, const u8 *from, in ubifs_copy_hash()
1648 int __ubifs_node_insert_hmac(const struct ubifs_info *c, void *buf,
1650 static inline int ubifs_node_insert_hmac(const struct ubifs_info *c, void *buf, in ubifs_node_insert_hmac()
1659 int __ubifs_node_verify_hmac(const struct ubifs_info *c, const void *buf,
1661 static inline int ubifs_node_verify_hmac(const struct ubifs_info *c, in ubifs_node_verify_hmac()
1678 static inline int ubifs_auth_node_sz(const struct ubifs_info *c) in ubifs_auth_node_sz()
1685 int ubifs_sb_verify_signature(struct ubifs_info *c,
1687 bool ubifs_hmac_zero(struct ubifs_info *c, const u8 *hmac);
1689 int ubifs_hmac_wkm(struct ubifs_info *c, u8 *hmac);
1691 int __ubifs_shash_copy_state(const struct ubifs_info *c, struct shash_desc *src,
1693 static inline int ubifs_shash_copy_state(const struct ubifs_info *c, in ubifs_shash_copy_state()
1704 void ubifs_ro_mode(struct ubifs_info *c, int err);
1705 int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs,
1707 int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs,
1709 int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len);
1710 int ubifs_leb_unmap(struct ubifs_info *c, int lnum);
1711 int ubifs_leb_map(struct ubifs_info *c, int lnum);
1712 int ubifs_is_mapped(const struct ubifs_info *c, int lnum);
1715 int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf);
1716 int ubifs_read_node(const struct ubifs_info *c, void *buf, int type, int len,
1720 int ubifs_write_node(struct ubifs_info *c, void *node, int len, int lnum,
1722 int ubifs_write_node_hmac(struct ubifs_info *c, void *buf, int len, int lnum,
1724 int ubifs_check_node(const struct ubifs_info *c, const void *buf, int len,
1726 void ubifs_init_node(struct ubifs_info *c, void *buf, int len, int pad);
1727 void ubifs_crc_node(struct ubifs_info *c, void *buf, int len);
1728 void ubifs_prepare_node(struct ubifs_info *c, void *buf, int len, int pad);
1729 int ubifs_prepare_node_hmac(struct ubifs_info *c, void *node, int len,
1731 void ubifs_prep_grp_node(struct ubifs_info *c, void *node, int len, int last);
1732 int ubifs_io_init(struct ubifs_info *c);
1733 void ubifs_pad(const struct ubifs_info *c, void *buf, int pad);
1735 int ubifs_bg_wbufs_sync(struct ubifs_info *c);
1737 int ubifs_sync_wbufs_by_inode(struct ubifs_info *c, struct inode *inode);
1740 struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
1743 int ubifs_scan_a_node(const struct ubifs_info *c, void *buf, int len, int lnum,
1745 struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum,
1747 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
1749 int ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
1751 void ubifs_scanned_corruption(const struct ubifs_info *c, int lnum, int offs,
1755 void ubifs_add_bud(struct ubifs_info *c, struct ubifs_bud *bud);
1756 void ubifs_create_buds_lists(struct ubifs_info *c);
1757 int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs);
1758 struct ubifs_bud *ubifs_search_bud(struct ubifs_info *c, int lnum);
1759 struct ubifs_wbuf *ubifs_get_wbuf(struct ubifs_info *c, int lnum);
1760 int ubifs_log_start_commit(struct ubifs_info *c, int *ltail_lnum);
1761 int ubifs_log_end_commit(struct ubifs_info *c, int new_ltail_lnum);
1762 int ubifs_log_post_commit(struct ubifs_info *c, int old_ltail_lnum);
1763 int ubifs_consolidate_log(struct ubifs_info *c);
1766 int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
1769 int ubifs_jnl_write_data(struct ubifs_info *c, const struct inode *inode,
1771 int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode);
1772 int ubifs_jnl_delete_inode(struct ubifs_info *c, const struct inode *inode);
1773 int ubifs_jnl_xrename(struct ubifs_info *c, const struct inode *fst_dir,
1779 int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
1786 int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,
1788 int ubifs_jnl_delete_xattr(struct ubifs_info *c, const struct inode *host,
1790 int ubifs_jnl_change_xattr(struct ubifs_info *c, const struct inode *inode1,
1794 int ubifs_budget_space(struct ubifs_info *c, struct ubifs_budget_req *req);
1795 void ubifs_release_budget(struct ubifs_info *c, struct ubifs_budget_req *req);
1796 void ubifs_release_dirty_inode_budget(struct ubifs_info *c,
1798 int ubifs_budget_inode_op(struct ubifs_info *c, struct inode *inode,
1800 void ubifs_release_ino_dirty(struct ubifs_info *c, struct inode *inode,
1802 void ubifs_cancel_ino_op(struct ubifs_info *c, struct inode *inode,
1804 long long ubifs_get_free_space(struct ubifs_info *c);
1805 long long ubifs_get_free_space_nolock(struct ubifs_info *c);
1806 int ubifs_calc_min_idx_lebs(struct ubifs_info *c);
1807 void ubifs_convert_page_budget(struct ubifs_info *c);
1808 long long ubifs_reported_space(const struct ubifs_info *c, long long free);
1809 long long ubifs_calc_available(const struct ubifs_info *c, int min_idx_lebs);
1812 int ubifs_find_free_space(struct ubifs_info *c, int min_space, int *offs,
1814 int ubifs_find_free_leb_for_idx(struct ubifs_info *c);
1815 int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp,
1817 int ubifs_find_dirty_idx_leb(struct ubifs_info *c);
1818 int ubifs_save_dirty_idx_lnums(struct ubifs_info *c);
1821 int ubifs_lookup_level0(struct ubifs_info *c, const union ubifs_key *key,
1823 int ubifs_tnc_lookup_nm(struct ubifs_info *c, const union ubifs_key *key,
1825 int ubifs_tnc_lookup_dh(struct ubifs_info *c, const union ubifs_key *key,
1827 int ubifs_tnc_locate(struct ubifs_info *c, const union ubifs_key *key,
1829 int ubifs_tnc_add(struct ubifs_info *c, const union ubifs_key *key, int lnum,
1831 int ubifs_tnc_replace(struct ubifs_info *c, const union ubifs_key *key,
1833 int ubifs_tnc_add_nm(struct ubifs_info *c, const union ubifs_key *key,
1836 int ubifs_tnc_remove(struct ubifs_info *c, const union ubifs_key *key);
1837 int ubifs_tnc_remove_nm(struct ubifs_info *c, const union ubifs_key *key,
1839 int ubifs_tnc_remove_dh(struct ubifs_info *c, const union ubifs_key *key,
1841 int ubifs_tnc_remove_range(struct ubifs_info *c, union ubifs_key *from_key,
1843 int ubifs_tnc_remove_ino(struct ubifs_info *c, ino_t inum);
1844 struct ubifs_dent_node *ubifs_tnc_next_ent(struct ubifs_info *c,
1847 void ubifs_tnc_close(struct ubifs_info *c);
1848 int ubifs_tnc_has_node(struct ubifs_info *c, union ubifs_key *key, int level,
1850 int ubifs_dirty_idx_node(struct ubifs_info *c, union ubifs_key *key, int level,
1853 void destroy_old_idx(struct ubifs_info *c);
1854 int is_idx_node_in_tnc(struct ubifs_info *c, union ubifs_key *key, int level,
1856 int insert_old_idx_znode(struct ubifs_info *c, struct ubifs_znode *znode);
1857 int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu);
1858 int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu);
1861 struct ubifs_znode *ubifs_tnc_levelorder_next(const struct ubifs_info *c,
1864 int ubifs_search_zbranch(const struct ubifs_info *c,
1868 struct ubifs_znode *ubifs_tnc_postorder_next(const struct ubifs_info *c,
1870 long ubifs_destroy_tnc_subtree(const struct ubifs_info *c,
1872 struct ubifs_znode *ubifs_load_znode(struct ubifs_info *c,
1875 int ubifs_tnc_read_node(struct ubifs_info *c, struct ubifs_zbranch *zbr,
1879 int ubifs_tnc_start_commit(struct ubifs_info *c, struct ubifs_zbranch *zroot);
1880 int ubifs_tnc_end_commit(struct ubifs_info *c);
1890 void ubifs_commit_required(struct ubifs_info *c);
1891 void ubifs_request_bg_commit(struct ubifs_info *c);
1892 int ubifs_run_commit(struct ubifs_info *c);
1893 void ubifs_recovery_commit(struct ubifs_info *c);
1894 int ubifs_gc_should_commit(struct ubifs_info *c);
1895 void ubifs_wait_for_commit(struct ubifs_info *c);
1898 int ubifs_compare_master_node(struct ubifs_info *c, void *m1, void *m2);
1899 int ubifs_read_master(struct ubifs_info *c);
1900 int ubifs_write_master(struct ubifs_info *c);
1903 int ubifs_read_superblock(struct ubifs_info *c);
1904 int ubifs_write_sb_node(struct ubifs_info *c, struct ubifs_sb_node *sup);
1905 int ubifs_fixup_free_space(struct ubifs_info *c);
1906 int ubifs_enable_encryption(struct ubifs_info *c);
1909 int ubifs_validate_entry(struct ubifs_info *c,
1911 int ubifs_replay_journal(struct ubifs_info *c);
1914 int ubifs_garbage_collect(struct ubifs_info *c, int anyway);
1915 int ubifs_gc_start_commit(struct ubifs_info *c);
1916 int ubifs_gc_end_commit(struct ubifs_info *c);
1917 void ubifs_destroy_idx_gc(struct ubifs_info *c);
1918 int ubifs_get_idx_gc_leb(struct ubifs_info *c);
1919 int ubifs_garbage_collect_leb(struct ubifs_info *c, struct ubifs_lprops *lp);
1922 int ubifs_add_orphan(struct ubifs_info *c, ino_t inum);
1923 void ubifs_delete_orphan(struct ubifs_info *c, ino_t inum);
1924 int ubifs_orphan_start_commit(struct ubifs_info *c);
1925 int ubifs_orphan_end_commit(struct ubifs_info *c);
1926 int ubifs_mount_orphans(struct ubifs_info *c, int unclean, int read_only);
1927 int ubifs_clear_orphans(struct ubifs_info *c);
1930 int ubifs_calc_lpt_geom(struct ubifs_info *c);
1931 int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first,
1933 int ubifs_lpt_init(struct ubifs_info *c, int rd, int wr);
1934 struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c, int lnum);
1935 struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum);
1936 int ubifs_lpt_scan_nolock(struct ubifs_info *c, int start_lnum, int end_lnum,
1940 void ubifs_pack_lsave(struct ubifs_info *c, void *buf, int *lsave);
1941 void ubifs_pack_ltab(struct ubifs_info *c, void *buf,
1943 void ubifs_pack_pnode(struct ubifs_info *c, void *buf,
1945 void ubifs_pack_nnode(struct ubifs_info *c, void *buf,
1947 struct ubifs_pnode *ubifs_get_pnode(struct ubifs_info *c,
1949 struct ubifs_nnode *ubifs_get_nnode(struct ubifs_info *c,
1951 struct ubifs_pnode *ubifs_pnode_lookup(struct ubifs_info *c, int i);
1952 int ubifs_read_nnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip);
1953 void ubifs_add_lpt_dirt(struct ubifs_info *c, int lnum, int dirty);
1954 void ubifs_add_nnode_dirt(struct ubifs_info *c, struct ubifs_nnode *nnode);
1955 uint32_t ubifs_unpack_bits(const struct ubifs_info *c, uint8_t **addr, int *pos, int nrbits);
1956 struct ubifs_nnode *ubifs_first_nnode(struct ubifs_info *c, int *hght);
1958 int ubifs_unpack_nnode(const struct ubifs_info *c, void *buf,
1960 int ubifs_lpt_calc_hash(struct ubifs_info *c, u8 *hash);
1963 int ubifs_lpt_start_commit(struct ubifs_info *c);
1964 int ubifs_lpt_end_commit(struct ubifs_info *c);
1965 int ubifs_lpt_post_commit(struct ubifs_info *c);
1966 void ubifs_lpt_free(struct ubifs_info *c, int wr_only);
1969 const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c,
1973 void ubifs_get_lp_stats(struct ubifs_info *c, struct ubifs_lp_stats *lst);
1974 void ubifs_add_to_cat(struct ubifs_info *c, struct ubifs_lprops *lprops,
1976 void ubifs_replace_cat(struct ubifs_info *c, struct ubifs_lprops *old_lprops,
1978 void ubifs_ensure_cat(struct ubifs_info *c, struct ubifs_lprops *lprops);
1979 int ubifs_categorize_lprops(const struct ubifs_info *c,
1981 int ubifs_change_one_lp(struct ubifs_info *c, int lnum, int free, int dirty,
1983 int ubifs_update_one_lp(struct ubifs_info *c, int lnum, int free, int dirty,
1985 int ubifs_read_one_lp(struct ubifs_info *c, int lnum, struct ubifs_lprops *lp);
1986 const struct ubifs_lprops *ubifs_fast_find_free(struct ubifs_info *c);
1987 const struct ubifs_lprops *ubifs_fast_find_empty(struct ubifs_info *c);
1988 const struct ubifs_lprops *ubifs_fast_find_freeable(struct ubifs_info *c);
1989 const struct ubifs_lprops *ubifs_fast_find_frdi_idx(struct ubifs_info *c);
1990 int ubifs_calc_dark(const struct ubifs_info *c, int spc);
1998 struct inode *ubifs_new_inode(struct ubifs_info *c, struct inode *dir,
2013 void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum);
2016 static inline void ubifs_evict_xattr_inode(struct ubifs_info *c, in ubifs_evict_xattr_inode()
2040 int ubifs_recover_master_node(struct ubifs_info *c);
2041 int ubifs_write_rcvrd_mst_node(struct ubifs_info *c);
2042 struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
2044 struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum,
2046 int ubifs_recover_inl_heads(struct ubifs_info *c, void *sbuf);
2047 int ubifs_clean_lebs(struct ubifs_info *c, void *sbuf);
2048 int ubifs_rcvry_gc_commit(struct ubifs_info *c);
2049 int ubifs_recover_size_accum(struct ubifs_info *c, union ubifs_key *key,
2051 int ubifs_recover_size(struct ubifs_info *c, bool in_place);
2052 void ubifs_destroy_size_tree(struct ubifs_info *c);
2064 void ubifs_compress(const struct ubifs_info *c, const void *in_buf, int in_len,
2066 int ubifs_decompress(const struct ubifs_info *c, const void *buf, int len,
2079 struct ubifs_info *c = inode->i_sb->s_fs_info; in ubifs_encrypt()
2087 struct ubifs_info *c = inode->i_sb->s_fs_info; in ubifs_decrypt()
2103 void ubifs_msg(const struct ubifs_info *c, const char *fmt, ...);
2105 void ubifs_err(const struct ubifs_info *c, const char *fmt, ...);
2107 void ubifs_warn(const struct ubifs_info *c, const char *fmt, ...);