Lines Matching +full:fsync +full:- +full:active +full:- +full:low
1 /* SPDX-License-Identifier: GPL-2.0 */
26 /* bitmasks for i_flags field in reiserfs-specific part of inode */
30 * an object have. If this is set, that format is 3.6 otherwise - 3.5
77 /* per-transaction list of inodes which have preallocated blocks */
87 * we use these for fsync or O_SYNC to decide which transaction
114 #define sb_block_count(sbp) (le32_to_cpu((sbp)->s_v1.s_block_count))
115 #define set_sb_block_count(sbp,v) ((sbp)->s_v1.s_block_count = cpu_to_le32(v))
116 #define sb_free_blocks(sbp) (le32_to_cpu((sbp)->s_v1.s_free_blocks))
117 #define set_sb_free_blocks(sbp,v) ((sbp)->s_v1.s_free_blocks = cpu_to_le32(v))
118 #define sb_root_block(sbp) (le32_to_cpu((sbp)->s_v1.s_root_block))
119 #define set_sb_root_block(sbp,v) ((sbp)->s_v1.s_root_block = cpu_to_le32(v))
122 (le32_to_cpu((sbp)->s_v1.s_journal.jp_journal_1st_block))
124 ((sbp)->s_v1.s_journal.jp_journal_1st_block = cpu_to_le32(v))
126 (le32_to_cpu((sbp)->s_v1.s_journal.jp_journal_dev))
128 ((sbp)->s_v1.s_journal.jp_journal_dev = cpu_to_le32(v))
130 (le32_to_cpu((sbp)->s_v1.s_journal.jp_journal_size))
132 ((sbp)->s_v1.s_journal.jp_journal_size = cpu_to_le32(v))
134 (le32_to_cpu((sbp)->s_v1.s_journal.jp_journal_trans_max))
136 ((sbp)->s_v1.s_journal.jp_journal_trans_max = cpu_to_le32(v))
138 (le32_to_cpu((sbp)->s_v1.s_journal.jp_journal_magic))
140 ((sbp)->s_v1.s_journal.jp_journal_magic = cpu_to_le32(v))
142 (le32_to_cpu((sbp)->s_v1.s_journal.jp_journal_max_batch))
144 ((sbp)->s_v1.s_journal.jp_journal_max_batch = cpu_to_le32(v))
146 (le32_to_cpu((sbp)->s_v1.s_journal.jp_journal_max_commit_age))
148 ((sbp)->s_v1.s_journal.jp_journal_max_commit_age = cpu_to_le32(v))
150 #define sb_blocksize(sbp) (le16_to_cpu((sbp)->s_v1.s_blocksize))
151 #define set_sb_blocksize(sbp,v) ((sbp)->s_v1.s_blocksize = cpu_to_le16(v))
152 #define sb_oid_maxsize(sbp) (le16_to_cpu((sbp)->s_v1.s_oid_maxsize))
153 #define set_sb_oid_maxsize(sbp,v) ((sbp)->s_v1.s_oid_maxsize = cpu_to_le16(v))
154 #define sb_oid_cursize(sbp) (le16_to_cpu((sbp)->s_v1.s_oid_cursize))
155 #define set_sb_oid_cursize(sbp,v) ((sbp)->s_v1.s_oid_cursize = cpu_to_le16(v))
156 #define sb_umount_state(sbp) (le16_to_cpu((sbp)->s_v1.s_umount_state))
157 #define set_sb_umount_state(sbp,v) ((sbp)->s_v1.s_umount_state = cpu_to_le16(v))
158 #define sb_fs_state(sbp) (le16_to_cpu((sbp)->s_v1.s_fs_state))
159 #define set_sb_fs_state(sbp,v) ((sbp)->s_v1.s_fs_state = cpu_to_le16(v))
161 (le32_to_cpu((sbp)->s_v1.s_hash_function_code))
163 ((sbp)->s_v1.s_hash_function_code = cpu_to_le32(v))
164 #define sb_tree_height(sbp) (le16_to_cpu((sbp)->s_v1.s_tree_height))
165 #define set_sb_tree_height(sbp,v) ((sbp)->s_v1.s_tree_height = cpu_to_le16(v))
166 #define sb_bmap_nr(sbp) (le16_to_cpu((sbp)->s_v1.s_bmap_nr))
167 #define set_sb_bmap_nr(sbp,v) ((sbp)->s_v1.s_bmap_nr = cpu_to_le16(v))
168 #define sb_version(sbp) (le16_to_cpu((sbp)->s_v1.s_version))
169 #define set_sb_version(sbp,v) ((sbp)->s_v1.s_version = cpu_to_le16(v))
171 #define sb_mnt_count(sbp) (le16_to_cpu((sbp)->s_mnt_count))
172 #define set_sb_mnt_count(sbp, v) ((sbp)->s_mnt_count = cpu_to_le16(v))
175 (le16_to_cpu((sbp)->s_v1.s_reserved_for_journal))
177 ((sbp)->s_v1.s_reserved_for_journal = cpu_to_le16(v))
179 /* LOGGING -- */
185 * I don't know what n is yet, I'm guessing 8-16.
187 * typical transaction size depends on the application, how often fsync is
206 /* we have a node size define somewhere in reiserfs_fs.h. -Hans */
272 time64_t j_timestamp; /* write-only but useful for crash dump analysis */
277 /* time ordered list of all active transactions */
377 int j_num_lists; /* total number of active transactions */
390 /* list of all active transactions */
514 /* reiserfs union of in-core super block data */
519 /* Pointer to the on-disk super block in the buffer */
534 /* Depth of the lock, start from -1 like the bkl */
539 /* Comment? -Hans */
578 /* Comment? -Hans */
580 /* increased by one every time the tree gets re-balanced */
583 /* File system properties. Currently holds on-disk FS format */
618 int work_queued; /* non-zero delayed work is queued */
639 /* Definitions of reiserfs on-disk properties: */
658 * -o conv: causes conversion of old format super block to the
659 * new format. If not specified - old partition will be dealt
665 * -o hash={tea, rupasov, r5, detect} is meant for properly mounting
671 * if you have a tea hash disk, and mount with -o hash=rupasov,
714 #define reiserfs_r5_hash(s) (REISERFS_SB(s)->s_mount_opt & (1 << FORCE_R5_HASH))
715 #define reiserfs_rupasov_hash(s) (REISERFS_SB(s)->s_mount_opt & (1 << FORCE_RUPASOV_HASH))
716 #define reiserfs_tea_hash(s) (REISERFS_SB(s)->s_mount_opt & (1 << FORCE_TEA_HASH))
717 #define reiserfs_hash_detect(s) (REISERFS_SB(s)->s_mount_opt & (1 << FORCE_HASH_DETECT))
718 #define reiserfs_no_border(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_NO_BORDER))
719 #define reiserfs_no_unhashed_relocation(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_NO_UNHASHE…
720 #define reiserfs_hashed_relocation(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_HASHED_RELOCATI…
721 #define reiserfs_test4(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_TEST4))
723 #define have_large_tails(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_LARGETAIL))
724 #define have_small_tails(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_SMALLTAIL))
725 #define replay_only(s) (REISERFS_SB(s)->s_mount_opt & (1 << REPLAYONLY))
726 #define reiserfs_attrs(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ATTRS))
727 #define old_format_only(s) (REISERFS_SB(s)->s_properties & (1 << REISERFS_3_5))
728 #define convert_reiserfs(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_CONVERT))
729 #define reiserfs_data_log(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_LOG))
730 #define reiserfs_data_ordered(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_ORDERED))
731 #define reiserfs_data_writeback(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_WRITEBACK))
732 #define reiserfs_xattrs_user(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS_USER))
733 #define reiserfs_posixacl(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_POSIXACL))
734 #define reiserfs_expose_privroot(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_EXPOSE_PRIVROOT))
736 #define reiserfs_barrier_none(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_BARRIER_NONE))
737 #define reiserfs_barrier_flush(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_BARRIER_FLUSH))
739 #define reiserfs_error_panic(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_PANIC))
740 #define reiserfs_error_ro(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_RO))
749 #define SB_BUFFER_WITH_SB(s) (REISERFS_SB(s)->s_sbh)
750 #define SB_JOURNAL(s) (REISERFS_SB(s)->s_journal)
751 #define SB_JOURNAL_1st_RESERVED_BLOCK(s) (SB_JOURNAL(s)->j_1st_reserved_block)
752 #define SB_JOURNAL_LEN_FREE(s) (SB_JOURNAL(s)->j_journal_len_free)
753 #define SB_AP_BITMAP(s) (REISERFS_SB(s)->s_ap_bitmap)
755 #define SB_DISK_JOURNAL_HEAD(s) (SB_JOURNAL(s)->j_header_bh->)
761 return test_bit(J_ABORTED, &journal->j_state); in __reiserfs_is_journal_aborted()
802 * - The commit mutex of a journal list
803 * - The flush mutex
804 * - The journal lock
805 * - The inode mutex
884 #define _ROUND_UP(x,n) (((x)+(n)-1u) & ~((n)-1u))
933 * accessed as REISERFS_SB(s)->s_rs. The version in RAM is part of a larger
983 /* this is set to 1 when filesystem was umounted, to 2 - when not */
1011 * this field is only reliable on filesystem with non-standard journal
1017 * keep after making fs with non-standard journal
1029 /* Right now used only by inode-attributes, if enabled */
1050 /* on-disk super block fields converted to cpu form */
1051 #define SB_DISK_SUPER_BLOCK(s) (REISERFS_SB(s)->s_rs)
1052 #define SB_V1_DISK_SUPER_BLOCK(s) (&(SB_DISK_SUPER_BLOCK(s)->s_v1))
1054 le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_blocksize))
1056 le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_block_count))
1058 le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_free_blocks))
1060 (SB_V1_DISK_SUPER_BLOCK(s)->s_magic)
1062 le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_root_block))
1064 le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_tree_height))
1066 le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_umount_state))
1067 #define SB_VERSION(s) le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_version))
1068 #define SB_BMAP_NR(s) le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_bmap_nr))
1071 do { SB_V1_DISK_SUPER_BLOCK(s)->s_block_count = cpu_to_le32(val); } while (0)
1073 do { SB_V1_DISK_SUPER_BLOCK(s)->s_free_blocks = cpu_to_le32(val); } while (0)
1075 do { SB_V1_DISK_SUPER_BLOCK(s)->s_root_block = cpu_to_le32(val); } while (0)
1077 do { SB_V1_DISK_SUPER_BLOCK(s)->s_tree_height = cpu_to_le16(val); } while (0)
1079 do { SB_V1_DISK_SUPER_BLOCK(s)->s_umount_state = cpu_to_le16(val); } while (0)
1081 do { SB_V1_DISK_SUPER_BLOCK(s)->s_version = cpu_to_le16(val); } while (0)
1083 do { SB_V1_DISK_SUPER_BLOCK(s)->s_bmap_nr = cpu_to_le16 (val); } while (0)
1085 #define SB_ONDISK_JP(s) (&SB_V1_DISK_SUPER_BLOCK(s)->s_journal)
1087 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_size))
1089 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_1st_block))
1091 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_dev))
1093 le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_reserved_for_journal))
1110 * platform, or code will break. -Hans
1116 /* the spot for the super in versions 3.5 - 3.5.10 (inclusive) */
1121 #define REPEAT_SEARCH -1
1122 #define IO_ERROR -2
1123 #define NO_DISK_SPACE -3
1124 #define NO_BALANCING_NEEDED (-4)
1125 #define NO_MORE_UNUSED_CONTIGUOUS_BLOCKS (-5)
1126 #define QUOTA_EXCEEDED -6
1151 return sb->s_fs_info; in REISERFS_SB()
1155 * Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16
1160 return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1; in reiserfs_bmap_count()
1165 return bmap_nr > ((1LL << 16) - 1); in bmap_would_wrap()
1175 ((REISERFS_I(inode)->i_flags & i_item_key_version_mask) ? KEY_FORMAT_3_6 : KEY_FORMAT_3_5)
1179 REISERFS_I(inode)->i_flags |= i_item_key_version_mask; \
1181 REISERFS_I(inode)->i_flags &= ~i_item_key_version_mask; })
1184 ((REISERFS_I(inode)->i_flags & i_stat_data_version_mask) ? STAT_DATA_V2 : STAT_DATA_V1)
1188 REISERFS_I(inode)->i_flags |= i_stat_data_version_mask; \
1190 REISERFS_I(inode)->i_flags &= ~i_stat_data_version_mask; })
1196 * non-intuitive, but it helps to understand it if you consider that the
1199 * non-linear disk access that is significant as a percentage of total
1202 * -Hans
1261 __u8 type = le64_to_cpu(v2->v) >> 60; in offset_v2_k_type()
1267 v2->v = in set_offset_v2_k_type()
1268 (v2->v & cpu_to_le64(~0ULL >> 4)) | cpu_to_le64((__u64) type << 60); in set_offset_v2_k_type()
1273 return le64_to_cpu(v2->v) & (~0ULL >> 4); in offset_v2_k_offset()
1279 v2->v = (v2->v & cpu_to_le64(15ULL << 60)) | cpu_to_le64(offset); in set_offset_v2_k_offset()
1323 #define SECOND_GREATER -1
1335 #define DIRECTORY_NOT_FOUND -1
1336 #define REGULAR_FILE_FOUND -2
1337 #define DIRECTORY_FOUND -3
1340 #define FILE_NOT_FOUND -1
1395 #define ih_free_space(ih) le16_to_cpu((ih)->u.ih_free_space_reserved)
1396 #define ih_version(ih) le16_to_cpu((ih)->ih_version)
1397 #define ih_entry_count(ih) le16_to_cpu((ih)->u.ih_entry_count)
1398 #define ih_location(ih) le16_to_cpu((ih)->ih_item_location)
1399 #define ih_item_len(ih) le16_to_cpu((ih)->ih_item_len)
1401 #define put_ih_free_space(ih, val) do { (ih)->u.ih_free_space_reserved = cpu_to_le16(val); } whil…
1402 #define put_ih_version(ih, val) do { (ih)->ih_version = cpu_to_le16(val); } while (0)
1403 #define put_ih_entry_count(ih, val) do { (ih)->u.ih_entry_count = cpu_to_le16(val); } while (0)
1404 #define put_ih_location(ih, val) do { (ih)->ih_item_location = cpu_to_le16(val); } while (0)
1405 #define put_ih_item_len(ih, val) do { (ih)->ih_item_len = cpu_to_le16(val); } while (0)
1475 le32_to_cpu(key->u.k_offset_v1.k_offset) : in le_key_k_offset()
1476 offset_v2_k_offset(&(key->u.k_offset_v2)); in le_key_k_offset()
1481 return le_key_k_offset(ih_version(ih), &(ih->ih_key)); in le_ih_k_offset()
1487 loff_t val = le32_to_cpu(key->u.k_offset_v1.k_uniqueness); in le_key_k_type()
1490 return offset_v2_k_type(&(key->u.k_offset_v2)); in le_key_k_type()
1495 return le_key_k_type(ih_version(ih), &(ih->ih_key)); in le_ih_k_type()
1502 key->u.k_offset_v1.k_offset = cpu_to_le32(offset); in set_le_key_k_offset()
1504 set_offset_v2_k_offset(&key->u.k_offset_v2, offset); in set_le_key_k_offset()
1516 add_le_key_k_offset(ih_version(ih), &(ih->ih_key), offset); in add_le_ih_k_offset()
1521 set_le_key_k_offset(ih_version(ih), &(ih->ih_key), offset); in set_le_ih_k_offset()
1529 key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type); in set_le_key_k_type()
1531 set_offset_v2_k_type(&key->u.k_offset_v2, type); in set_le_key_k_type()
1536 set_le_key_k_type(ih_version(ih), &(ih->ih_key), type); in set_le_ih_k_type()
1562 return is_direntry_le_key(ih_version(ih), &ih->ih_key); in is_direntry_le_ih()
1567 return is_direct_le_key(ih_version(ih), &ih->ih_key); in is_direct_le_ih()
1572 return is_indirect_le_key(ih_version(ih), &ih->ih_key); in is_indirect_le_ih()
1577 return is_statdata_le_key(ih_version(ih), &ih->ih_key); in is_statdata_le_ih()
1583 return key->on_disk_key.k_offset; in cpu_key_k_offset()
1588 return key->on_disk_key.k_type; in cpu_key_k_type()
1593 key->on_disk_key.k_offset = offset; in set_cpu_key_k_offset()
1598 key->on_disk_key.k_type = type; in set_cpu_key_k_type()
1603 key->on_disk_key.k_offset--; in cpu_key_k_offset_dec()
1612 #define is_direntry_cpu_ih(ih) (is_direntry_cpu_key (&((ih)->ih_key)))
1613 #define is_direct_cpu_ih(ih) (is_direct_cpu_key (&((ih)->ih_key)))
1614 #define is_indirect_cpu_ih(ih) (is_indirect_cpu_key (&((ih)->ih_key)))
1615 #define is_statdata_cpu_ih(ih) (is_statdata_cpu_key (&((ih)->ih_key)))
1622 #define MAX_ITEM_LEN(block_size) (block_size - BLKH_SIZE - IH_SIZE)
1635 * |Block | Object-Item | F r e e | Objects- |
1656 #define blkh_level(p_blkh) (le16_to_cpu((p_blkh)->blk_level))
1657 #define blkh_nr_item(p_blkh) (le16_to_cpu((p_blkh)->blk_nr_item))
1658 #define blkh_free_space(p_blkh) (le16_to_cpu((p_blkh)->blk_free_space))
1659 #define blkh_reserved(p_blkh) (le16_to_cpu((p_blkh)->blk_reserved))
1660 #define set_blkh_level(p_blkh,val) ((p_blkh)->blk_level = cpu_to_le16(val))
1661 #define set_blkh_nr_item(p_blkh,val) ((p_blkh)->blk_nr_item = cpu_to_le16(val))
1662 #define set_blkh_free_space(p_blkh,val) ((p_blkh)->blk_free_space = cpu_to_le16(val))
1663 #define set_blkh_reserved(p_blkh,val) ((p_blkh)->blk_reserved = cpu_to_le16(val))
1664 #define blkh_right_delim_key(p_blkh) ((p_blkh)->blk_right_delim_key)
1665 #define set_blkh_right_delim_key(p_blkh,val) ((p_blkh)->blk_right_delim_key = val)
1681 #define B_BLK_HEAD(bh) ((struct block_head *)((bh)->b_data))
1691 /* Get right delimiting key. -- little endian */
1733 * suppression policy. Someday. -Hans
1740 #define sd_v1_mode(sdp) (le16_to_cpu((sdp)->sd_mode))
1741 #define set_sd_v1_mode(sdp,v) ((sdp)->sd_mode = cpu_to_le16(v))
1742 #define sd_v1_nlink(sdp) (le16_to_cpu((sdp)->sd_nlink))
1743 #define set_sd_v1_nlink(sdp,v) ((sdp)->sd_nlink = cpu_to_le16(v))
1744 #define sd_v1_uid(sdp) (le16_to_cpu((sdp)->sd_uid))
1745 #define set_sd_v1_uid(sdp,v) ((sdp)->sd_uid = cpu_to_le16(v))
1746 #define sd_v1_gid(sdp) (le16_to_cpu((sdp)->sd_gid))
1747 #define set_sd_v1_gid(sdp,v) ((sdp)->sd_gid = cpu_to_le16(v))
1748 #define sd_v1_size(sdp) (le32_to_cpu((sdp)->sd_size))
1749 #define set_sd_v1_size(sdp,v) ((sdp)->sd_size = cpu_to_le32(v))
1750 #define sd_v1_atime(sdp) (le32_to_cpu((sdp)->sd_atime))
1751 #define set_sd_v1_atime(sdp,v) ((sdp)->sd_atime = cpu_to_le32(v))
1752 #define sd_v1_mtime(sdp) (le32_to_cpu((sdp)->sd_mtime))
1753 #define set_sd_v1_mtime(sdp,v) ((sdp)->sd_mtime = cpu_to_le32(v))
1754 #define sd_v1_ctime(sdp) (le32_to_cpu((sdp)->sd_ctime))
1755 #define set_sd_v1_ctime(sdp,v) ((sdp)->sd_ctime = cpu_to_le32(v))
1756 #define sd_v1_rdev(sdp) (le32_to_cpu((sdp)->u.sd_rdev))
1757 #define set_sd_v1_rdev(sdp,v) ((sdp)->u.sd_rdev = cpu_to_le32(v))
1758 #define sd_v1_blocks(sdp) (le32_to_cpu((sdp)->u.sd_blocks))
1759 #define set_sd_v1_blocks(sdp,v) ((sdp)->u.sd_blocks = cpu_to_le32(v))
1761 (le32_to_cpu((sdp)->sd_first_direct_byte))
1763 ((sdp)->sd_first_direct_byte = cpu_to_le32(v))
1820 #define sd_v2_mode(sdp) (le16_to_cpu((sdp)->sd_mode))
1821 #define set_sd_v2_mode(sdp,v) ((sdp)->sd_mode = cpu_to_le16(v))
1824 #define sd_v2_nlink(sdp) (le32_to_cpu((sdp)->sd_nlink))
1825 #define set_sd_v2_nlink(sdp,v) ((sdp)->sd_nlink = cpu_to_le32(v))
1826 #define sd_v2_size(sdp) (le64_to_cpu((sdp)->sd_size))
1827 #define set_sd_v2_size(sdp,v) ((sdp)->sd_size = cpu_to_le64(v))
1828 #define sd_v2_uid(sdp) (le32_to_cpu((sdp)->sd_uid))
1829 #define set_sd_v2_uid(sdp,v) ((sdp)->sd_uid = cpu_to_le32(v))
1830 #define sd_v2_gid(sdp) (le32_to_cpu((sdp)->sd_gid))
1831 #define set_sd_v2_gid(sdp,v) ((sdp)->sd_gid = cpu_to_le32(v))
1832 #define sd_v2_atime(sdp) (le32_to_cpu((sdp)->sd_atime))
1833 #define set_sd_v2_atime(sdp,v) ((sdp)->sd_atime = cpu_to_le32(v))
1834 #define sd_v2_mtime(sdp) (le32_to_cpu((sdp)->sd_mtime))
1835 #define set_sd_v2_mtime(sdp,v) ((sdp)->sd_mtime = cpu_to_le32(v))
1836 #define sd_v2_ctime(sdp) (le32_to_cpu((sdp)->sd_ctime))
1837 #define set_sd_v2_ctime(sdp,v) ((sdp)->sd_ctime = cpu_to_le32(v))
1838 #define sd_v2_blocks(sdp) (le32_to_cpu((sdp)->sd_blocks))
1839 #define set_sd_v2_blocks(sdp,v) ((sdp)->sd_blocks = cpu_to_le32(v))
1840 #define sd_v2_rdev(sdp) (le32_to_cpu((sdp)->u.sd_rdev))
1841 #define set_sd_v2_rdev(sdp,v) ((sdp)->u.sd_rdev = cpu_to_le32(v))
1842 #define sd_v2_generation(sdp) (le32_to_cpu((sdp)->u.sd_generation))
1843 #define set_sd_v2_generation(sdp,v) ((sdp)->u.sd_generation = cpu_to_le32(v))
1844 #define sd_v2_attrs(sdp) (le16_to_cpu((sdp)->sd_attrs))
1845 #define set_sd_v2_attrs(sdp,v) ((sdp)->sd_attrs = cpu_to_le16(v))
1854 * | directory |N-1| N-2 | .... | 1st |0th|
1857 * <---- directory entries ------>
1904 #define deh_offset(p_deh) (le32_to_cpu((p_deh)->deh_offset))
1905 #define deh_dir_id(p_deh) (le32_to_cpu((p_deh)->deh_dir_id))
1906 #define deh_objectid(p_deh) (le32_to_cpu((p_deh)->deh_objectid))
1907 #define deh_location(p_deh) (le16_to_cpu((p_deh)->deh_location))
1908 #define deh_state(p_deh) (le16_to_cpu((p_deh)->deh_state))
1910 #define put_deh_offset(p_deh,v) ((p_deh)->deh_offset = cpu_to_le32((v)))
1911 #define put_deh_dir_id(p_deh,v) ((p_deh)->deh_dir_id = cpu_to_le32((v)))
1912 #define put_deh_objectid(p_deh,v) ((p_deh)->deh_objectid = cpu_to_le32((v)))
1913 #define put_deh_location(p_deh,v) ((p_deh)->deh_location = cpu_to_le16((v)))
1914 #define put_deh_state(p_deh,v) ((p_deh)->deh_state = cpu_to_le16((v)))
1918 (DEH_SIZE * 2 + ROUND_UP (sizeof(".") - 1) + ROUND_UP (sizeof("..") - 1))
1926 /* 64 bit systems (and the S/390) need to be aligned explicitly -jdm */
1938 …fine aligned_address(addr) ((void *)((long)(addr) & ~((1UL << ADDR_UNALIGNED_BITS) - 1)))
1939 # define unaligned_offset(addr) (((int)((long)(addr) & ((1 << ADDR_UNALIGNED_BITS) - 1))…
1956 #define mark_de_with_sd(deh) set_bit_unaligned (DEH_Statdata, &((deh)->deh_state))
1957 #define mark_de_without_sd(deh) clear_bit_unaligned (DEH_Statdata, &((deh)->deh_state))
1958 #define mark_de_visible(deh) set_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1959 #define mark_de_hidden(deh) clear_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1961 #define de_with_sd(deh) test_bit_unaligned (DEH_Statdata, &((deh)->deh_state))
1962 #define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1963 #define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
2008 (I_DEH_N_ENTRY_LENGTH (ih, deh, entry_num) - (de_with_sd (deh) ? SD_SIZE : 0))
2041 #define dc_block_number(dc_p) (le32_to_cpu((dc_p)->dc_block_number))
2042 #define dc_size(dc_p) (le16_to_cpu((dc_p)->dc_size))
2043 #define put_dc_block_number(dc_p, val) do { (dc_p)->dc_block_number = cpu_to_le32(val); } while(0)
2044 #define put_dc_size(dc_p, val) do { (dc_p)->dc_size = cpu_to_le16(val); } while(0)
2048 ((bh)->b_data + BLKH_SIZE + B_NR_ITEMS(bh) * KEY_SIZE + DC_SIZE * (n_pos)))
2057 #define MAX_CHILD_SIZE(bh) ((int)( (bh)->b_size - BLKH_SIZE ))
2060 #define B_CHILD_SIZE(cur) (MAX_CHILD_SIZE(cur)-(B_FREE_SPACE(cur)))
2063 #define MAX_NR_KEY(bh) ( (MAX_CHILD_SIZE(bh)-DC_SIZE)/(KEY_SIZE+DC_SIZE) )
2102 /* Must be equal to FIRST_PATH_ELEMENT_OFFSET - 1 */
2122 * excessive effort to avoid disturbing the precious VFS code.:-( The
2138 #define pos_in_item(path) ((path)->pos_in_item)
2144 #define PATH_OFFSET_PELEMENT(path, n_offset) ((path)->path_elements + (n_offset))
2147 #define PATH_OFFSET_PBUFFER(path, n_offset) (PATH_OFFSET_PELEMENT(path, n_offset)->pe_buffer)
2150 #define PATH_OFFSET_POSITION(path, n_offset) (PATH_OFFSET_PELEMENT(path, n_offset)->pe_position)
2152 #define PATH_PLAST_BUFFER(path) (PATH_OFFSET_PBUFFER((path), (path)->path_length))
2157 * maybe we should just focus on dumping paths... -Hans
2159 #define PATH_LAST_POSITION(path) (PATH_OFFSET_POSITION((path), (path)->path_length))
2166 /* tb->S[h] */
2168 PATH_OFFSET_PBUFFER(path, path->path_length - (h))
2170 /* tb->F[h] or tb->S[0]->b_parent */
2174 PATH_OFFSET_POSITION(path, path->path_length - (h))
2176 /* tb->S[h]->b_item_order */
2179 #define PATH_H_PATH_OFFSET(path, n_h) ((path)->path_length - (n_h))
2183 return bh->b_data + sizeof(struct block_head); in reiserfs_node_data()
2208 return &item_head(bh, item_num)->ih_key; in leaf_key()
2214 return bh->b_data + ih_location(ih); in ih_item_body()
2244 * calculates length of i-th directory entry using directory entry
2245 * locations from dir entry head. When it calculates length of 0-th
2247 * location of the non-existent following entry in the calculation.
2257 return deh_location(deh - 1) - deh_location(deh); in entry_length()
2259 return ih_item_len(ih) - deh_location(deh); in entry_length()
2270 /* in in-core inode key is stored on le form */
2271 #define INODE_PKEY(inode) ((struct reiserfs_key *)(REISERFS_I(inode)->i_key))
2277 // reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset
2292 #define REISERFS_LINK_MAX (MAX_US_INT - 1000)
2301 #define fs_generation(s) (REISERFS_SB(s)->s_generation_counter)
2303 #define FILESYSTEM_CHANGED_TB(tb) (get_generation((tb)->tb_sb) != (tb)->fs_gen)
2482 * if -1 then nothing will be partially shifted
2489 * if -1 then nothing will be partially shifted
2544 * another low-level subsystem
2597 return tb ? tb->tb_sb : NULL; in sb_from_tb()
2602 return bi ? sb_from_tb(bi->tb) : NULL; in sb_from_bi()
2607 * +-------------------+------------+--------------+------------+
2609 * +-------------------+------------+--------------+------------+
2611 * +-------------------+------------+--------------+------------+
2615 * +-------------------+------------+--------------+------------+
2617 * +-------------------+------------+--------------+------------+
2619 * +-------------------+------------+--------------+------------+
2645 #define op_bytes_number(ih,bsize) item_ops[le_ih_k_type (ih)]->bytes_number (ih,…
2646 …(key,bsize) item_ops[le_key_k_type (le_key_version (key), key)]->is_left_mergeable (k…
2647 #define op_print_item(ih,item) item_ops[le_ih_k_type (ih)]->print_item (ih, i…
2648 #define op_check_item(ih,item) item_ops[le_ih_k_type (ih)]->check_item (ih, i…
2649 #define op_create_vi(vn,vi,is_affected,insert_size) item_ops[le_ih_k_type ((vi)->vi_ih)]->create_v…
2650 #define op_check_left(vi,free,start_skip,end_skip) item_ops[(vi)->vi_index]->check_left (vi, free, …
2651 #define op_check_right(vi,free) item_ops[(vi)->vi_index]->check_right (vi, fre…
2652 #define op_part_size(vi,from,to) item_ops[(vi)->vi_index]->part_size (vi, from,…
2653 #define op_unit_num(vi) item_ops[(vi)->vi_index]->unit_num (vi)
2654 #define op_print_vi(vi) item_ops[(vi)->vi_index]->print_vi (vi)
2665 #define I_POS_UNFM_SIZE(ih,pos,size) (((pos) == I_UNFM_NUM(ih) - 1 ) ? (size) - ih_free_space(ih) :…
2674 /* get stat-data */
2675 #define B_I_STAT_DATA(bh, ih) ( (struct stat_data * )((bh)->b_data + ih_location(ih)) )
2678 #define MAX_DIRECT_ITEM_LEN(size) ((size) - BLKH_SIZE - 2*IH_SIZE - SD_SIZE - UNFM_P_SIZE)
2699 #define get_journal_desc_magic(bh) (bh->b_data + bh->b_size - 12)
2702 ((blocksize - sizeof(struct reiserfs_journal_desc) - 12) / sizeof(__u32))
2717 #define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id)
2718 #define get_desc_trans_len(d) le32_to_cpu((d)->j_len)
2719 #define get_desc_mount_id(d) le32_to_cpu((d)->j_mount_id)
2721 #define set_desc_trans_id(d,val) do { (d)->j_trans_id = cpu_to_le32 (val); } while (0)
2722 #define set_desc_trans_len(d,val) do { (d)->j_len = cpu_to_le32 (val); } while (0)
2723 #define set_desc_mount_id(d,val) do { (d)->j_mount_id = cpu_to_le32 (val); } while (0)
2732 #define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id)
2733 #define get_commit_trans_len(c) le32_to_cpu((c)->j_len)
2734 #define get_commit_mount_id(c) le32_to_cpu((c)->j_mount_id)
2736 #define set_commit_trans_id(c,val) do { (c)->j_trans_id = cpu_to_le32 (val); } while (0)
2737 #define set_commit_trans_len(c,val) do { (c)->j_len = cpu_to_le32 (val); } while (0)
2771 #define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9)
2779 #define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? 2 : 0)
2781 #define REISERFS_QUOTA_INIT_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? \
2784 #define REISERFS_QUOTA_DEL_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? \
2793 * both of these can be as low as 1, or as high as you want. The min is the
2808 (((block)<<(JBH_HASH_SHIFT - 6)) ^ ((block) >> 13) ^ ((block) << (JBH_HASH_SHIFT - 12))))
2813 file_bdev(SB_JOURNAL(s)->j_bdev_file), block, s->s_blocksize)
2814 #define journal_getblk(s, block) __getblk(file_bdev(SB_JOURNAL(s)->j_bdev_file),\
2815 block, s->s_blocksize)
2816 #define journal_bread(s, block) __bread(file_bdev(SB_JOURNAL(s)->j_bdev_file),\
2817 block, s->s_blocksize)
2862 void *t_handle_save; /* save existing current->journal_info */
2891 if (reiserfs_data_log(inode->i_sb) || in reiserfs_file_data_log()
2892 (REISERFS_I(inode)->i_flags & i_data_log)) in reiserfs_file_data_log()
2899 struct reiserfs_transaction_handle *th = current->journal_info; in reiserfs_transaction_running()
2900 if (th && th->t_super == s) in reiserfs_transaction_running()
2902 if (th && th->t_super == NULL) in reiserfs_transaction_running()
2909 return th->t_blocks_allocated - th->t_blocks_logged; in reiserfs_transaction_free_space()
2970 /* first key is in cpu form, second - le */
2981 /* * get key version from on disk key - kludge */
2986 type = offset_v2_k_type(&(key->u.k_offset_v2)); in le_key_version()
3047 #define i_block_size(inode) ((inode)->i_sb->s_blocksize)
3048 #define file_size(inode) ((inode)->i_size)
3049 #define tail_size(inode) (file_size (inode) & (i_block_size (inode) - 1))
3051 #define tail_has_to_be_packed(inode) (have_large_tails ((inode)->i_sb)?\
3052 …inode), inode->i_sb->s_blocksize):have_small_tails ((inode)->i_sb)?!STORE_TAIL_IN_UNFM_S2(file_siz…
3060 #define GET_BLOCK_NO_HOLE 2 /* return -ENOENT for file holes */
3101 reiserfs_update_sd_size(th, inode, inode->i_size); in reiserfs_update_sd()
3125 #define __PINFO( sb ) REISERFS_SB(sb) -> s_proc_info_data
3128 max( REISERFS_SB( sb ) -> s_proc_info_data.field, value )
3338 .th = tb->transaction_handle, in reiserfs_new_form_blocknrs()
3339 .path = tb->tb_path, in reiserfs_new_form_blocknrs()
3341 .key = tb->key, in reiserfs_new_form_blocknrs()