Home
last modified time | relevance | path

Searched refs:sb (Results 1 – 25 of 50) sorted by relevance

12

/system/extras/ext4_utils/
Dext4_utils.c143 void read_sb(int fd, struct ext4_super_block *sb) in read_sb() argument
151 ret = read(fd, sb, sizeof(*sb)); in read_sb()
154 if (ret != sizeof(*sb)) in read_sb()
159 void write_sb(int fd, unsigned long long offset, struct ext4_super_block *sb) in write_sb() argument
167 ret = write(fd, sb, sizeof(*sb)); in write_sb()
170 if (ret != sizeof(*sb)) in write_sb()
189 write_sb(fd, 1024, aux_info.sb); in block_device_write_sb()
250 aux_info.sb = (struct ext4_super_block *)((char *)aux_info.sb_block + 1024); in ext4_create_fs_aux_info()
252 aux_info.sb = aux_info.sb_block; in ext4_create_fs_aux_info()
257 if (!aux_info.sb) in ext4_create_fs_aux_info()
[all …]
Dext4_sb.c21 int ext4_parse_sb(struct ext4_super_block *sb, struct fs_info *info) in ext4_parse_sb() argument
25 if (sb->s_magic != EXT4_SUPER_MAGIC) in ext4_parse_sb()
28 info->block_size = 1024 << sb->s_log_block_size; in ext4_parse_sb()
29 info->blocks_per_group = sb->s_blocks_per_group; in ext4_parse_sb()
30 info->inodes_per_group = sb->s_inodes_per_group; in ext4_parse_sb()
31 info->inode_size = sb->s_inode_size; in ext4_parse_sb()
32 info->inodes = sb->s_inodes_count; in ext4_parse_sb()
33 info->feat_ro_compat = sb->s_feature_ro_compat; in ext4_parse_sb()
34 info->feat_compat = sb->s_feature_compat; in ext4_parse_sb()
35 info->feat_incompat = sb->s_feature_incompat; in ext4_parse_sb()
[all …]
Dext4fixup.c125 struct ext4_super_block sb; in set_fs_fixup_state() local
155 read_sb(fd, &sb); in set_fs_fixup_state()
158 sb.s_desc_size |= 1; in set_fs_fixup_state()
161 sb.s_desc_size &= ~1; in set_fs_fixup_state()
165 write_sb(fd, 1024, &sb); in set_fs_fixup_state()
272 struct ext4_super_block sb; in update_superblocks_and_bg_desc() local
277 read_sb(fd, &sb); in update_superblocks_and_bg_desc()
281 total_new_inodes = num_block_groups * (new_inodes_per_group - sb.s_inodes_per_group); in update_superblocks_and_bg_desc()
290 … aux_info.bg_desc[i].bg_free_inodes_count += (new_inodes_per_group - sb.s_inodes_per_group); in update_superblocks_and_bg_desc()
296 if ((sb.s_inodes_count + total_new_inodes) != (new_inodes_per_group * num_block_groups)) { in update_superblocks_and_bg_desc()
[all …]
/system/core/libutils/
DSharedBuffer.cpp37 SharedBuffer* sb = static_cast<SharedBuffer *>(malloc(sizeof(SharedBuffer) + size)); in alloc() local
38 if (sb) { in alloc()
42 sb->mRefs.store(1, std::memory_order_relaxed); in alloc()
43 sb->mSize = size; in alloc()
45 return sb; in alloc()
59 SharedBuffer* sb = alloc(mSize); in edit() local
60 if (sb) { in edit()
61 memcpy(sb->data(), data(), size()); in edit()
64 return sb; in edit()
83 SharedBuffer* sb = alloc(newSize); in editResize() local
[all …]
DVectorImpl.cpp90 const SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage); in editArrayImpl() local
91 SharedBuffer* editable = sb->attemptEdit(); in editArrayImpl()
95 editable = SharedBuffer::alloc(sb->size()); in editArrayImpl()
346 SharedBuffer* sb = SharedBuffer::alloc(new_allocation_size); in setCapacity() local
347 if (sb) { in setCapacity()
348 void* array = sb->data(); in setCapacity()
371 const SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage); in release_storage() local
372 if (sb->release(SharedBuffer::eKeepStorage) == 1) { in release_storage()
374 SharedBuffer::dealloc(sb); in release_storage()
417 SharedBuffer* sb = cur_sb->editResize(new_alloc_size); in _grow() local
[all …]
/system/extras/squashfs_utils/
Dsquashfs_utils.c43 const struct squashfs_super_block *sb = in squashfs_parse_sb_buffer() local
46 if (sb->s_magic != SQUASHFS_MAGIC) { in squashfs_parse_sb_buffer()
50 info->block_size = sb->block_size; in squashfs_parse_sb_buffer()
51 info->inodes = sb->inodes; in squashfs_parse_sb_buffer()
52 info->bytes_used = sb->bytes_used; in squashfs_parse_sb_buffer()
55 sb->bytes_used + (4096 - (sb->bytes_used & (4096 - 1))); in squashfs_parse_sb_buffer()
63 struct squashfs_super_block sb; in squashfs_parse_sb() local
72 if (TEMP_FAILURE_RETRY(read(data_device, &sb, sizeof(sb))) in squashfs_parse_sb()
73 != sizeof(sb)) { in squashfs_parse_sb()
79 if (squashfs_parse_sb_buffer(&sb, info) == -1) { in squashfs_parse_sb()
/system/extras/tests/fstest/
Drecovery_test.cpp79 bool getSuperBlock(const int blk_fd, struct ext4_super_block* sb) { in getSuperBlock() argument
85 if (read(blk_fd, sb, sizeof(*sb)) != sizeof(*sb)) { in getSuperBlock()
90 if (sb->s_magic != 0xEF53) { in getSuperBlock()
100 struct ext4_super_block sb; in setSbErrorBit() local
101 if (!getSuperBlock(blk_fd, &sb)) { in setSbErrorBit()
106 if (sb.s_state & 0x2) { in setSbErrorBit()
112 sb.s_state |= 0x2; in setSbErrorBit()
120 if (write(blk_fd, &sb, sizeof(sb)) != sizeof(sb)) { in setSbErrorBit()
130 struct ext4_super_block sb; in corruptGdtFreeBlock() local
131 if (!getSuperBlock(blk_fd, &sb)) { in corruptGdtFreeBlock()
[all …]
/system/extras/f2fs_utils/
Df2fs_sparseblock.c35 static void dbg_print_raw_sb_info(struct f2fs_super_block *sb) in dbg_print_raw_sb_info() argument
42 D_DISP_u32(sb, magic); in dbg_print_raw_sb_info()
43 D_DISP_u32(sb, major_ver); in dbg_print_raw_sb_info()
44 D_DISP_u32(sb, minor_ver); in dbg_print_raw_sb_info()
45 D_DISP_u32(sb, log_sectorsize); in dbg_print_raw_sb_info()
46 D_DISP_u32(sb, log_sectors_per_block); in dbg_print_raw_sb_info()
48 D_DISP_u32(sb, log_blocksize); in dbg_print_raw_sb_info()
49 D_DISP_u32(sb, log_blocks_per_seg); in dbg_print_raw_sb_info()
50 D_DISP_u32(sb, segs_per_sec); in dbg_print_raw_sb_info()
51 D_DISP_u32(sb, secs_per_zone); in dbg_print_raw_sb_info()
[all …]
/system/bt/embdrv/sbc/decoder/srce/
Dbitalloc.c135 OI_UINT sb; in computeBitneed() local
142 for (sb = 0; sb < nrof_subbands; sb++) { in computeBitneed()
143 OI_INT bits = scale_factor[sb]; in computeBitneed()
147 bitneeds[sb] = bits; in computeBitneed()
148 if (bitneeds[sb] > 1) { in computeBitneed()
160 for (sb = 0; sb < nrof_subbands; sb++) { in computeBitneed()
161 OI_INT bits = scale_factor[sb]; in computeBitneed()
167 bits -= offset[sb]; in computeBitneed()
173 bitneeds[sb] = bits; in computeBitneed()
174 if (bitneeds[sb] > 1) { in computeBitneed()
[all …]
Dreadsamplesjoint.inc72 OI_UINT sb;
76 sb = NROF_SUBBANDS;
86 } while (--sb);
90 sb = NROF_SUBBANDS;
110 } while (--sb);
/system/core/libcutils/
Dfs.c44 struct stat sb; in fs_prepare_path_impl() local
46 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) { in fs_prepare_path_impl()
56 int type_ok = prepare_as_dir ? S_ISDIR(sb.st_mode) : S_ISREG(sb.st_mode); in fs_prepare_path_impl()
62 int owner_match = ((sb.st_uid == uid) && (sb.st_gid == gid)); in fs_prepare_path_impl()
63 int mode_match = ((sb.st_mode & ALL_PERMS) == mode); in fs_prepare_path_impl()
71 path, uid, gid, sb.st_uid, sb.st_gid); in fs_prepare_path_impl()
75 path, mode, (sb.st_mode & ALL_PERMS)); in fs_prepare_path_impl()
193 struct stat sb; in fs_mkdirs() local
220 if (fstatat(fd, segment, &sb, AT_SYMLINK_NOFOLLOW) != 0) { in fs_mkdirs()
238 if (S_ISLNK(sb.st_mode)) { in fs_mkdirs()
[all …]
/system/sepolicy/tools/sepolicy-analyze/
Dutils.c28 struct stat sb; in load_policy() local
37 if (fstat(fd, &sb) < 0) { in load_policy()
42 map = mmap(NULL, sb.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); in load_policy()
52 pf->len = sb.st_size; in load_policy()
56 munmap(map, sb.st_size); in load_policy()
63 munmap(map, sb.st_size); in load_policy()
/system/extras/pagecache/
Ddumpcache.c75 static int store_num_cached(const char* fpath, const struct stat *sb) { in store_num_cached() argument
84 void* mapped_addr = mmap(NULL, sb->st_size, PROT_NONE, MAP_SHARED, fd, 0); in store_num_cached()
88 size_t num_file_pages = (sb->st_size + g_page_size - 1) / g_page_size; in store_num_cached()
90 ret = mincore(mapped_addr, sb->st_size, mincore_data); in store_num_cached()
98 struct file_info *info = get_file_info(fpath, sb->st_size); in store_num_cached()
103 munmap(mapped_addr, sb->st_size); in store_num_cached()
110 static int scan_entry(const char *fpath, const struct stat *sb, int typeflag, in scan_entry() argument
113 store_num_cached(fpath, sb); in scan_entry()
/system/extras/ext4_utils/include/ext4_utils/
Dext4.h363 #define test_opt(sb, opt) (EXT4_SB(sb)->s_mount_opt & EXT4_MOUNT_##opt) argument
454 #define EXT4_SB(sb) (sb) argument
472 #define EXT4_HAS_COMPAT_FEATURE(sb,mask) ((EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask… argument
473 #define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) ((EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le3… argument
474 #define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) ((EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(… argument
475 #define EXT4_SET_COMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) argument
476 #define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32… argument
477 #define EXT4_SET_INCOMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(m… argument
478 #define EXT4_CLEAR_COMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(ma… argument
479 #define EXT4_CLEAR_RO_COMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_l… argument
[all …]
Dext4_utils.h103 struct ext4_super_block *sb; member
141 void read_sb(int fd, struct ext4_super_block *sb);
142 void write_sb(int fd, unsigned long long offset, struct ext4_super_block *sb);
150 void ext4_queue_sb(u64 start_block, struct ext4_super_block *sb);
155 void ext4_parse_sb_info(struct ext4_super_block *sb);
/system/core/fs_mgr/
Dfs_mgr.cpp254 static bool read_ext4_superblock(const char* blk_device, struct ext4_super_block* sb, int* fs_stat)… in read_ext4_superblock() argument
262 if (pread(fd, sb, sizeof(*sb), 1024) != sizeof(*sb)) { in read_ext4_superblock()
267 if (sb->s_magic != EXT4_SUPER_MAGIC) { in read_ext4_superblock()
268 LINFO << "Invalid ext4 magic:0x" << std::hex << sb->s_magic << " " in read_ext4_superblock()
275 LINFO << "superblock s_max_mnt_count:" << sb->s_max_mnt_count << "," << blk_device; in read_ext4_superblock()
276 if (sb->s_max_mnt_count == 0xffff) { // -1 (int16) in ext2, but uint16 in ext4 in read_ext4_superblock()
298 const struct ext4_super_block* sb, int* fs_stat) { in tune_quota() argument
299 bool has_quota = (sb->s_feature_ro_compat & cpu_to_le32(EXT4_FEATURE_RO_COMPAT_QUOTA)) != 0; in tune_quota()
334 const struct ext4_super_block* sb, int* fs_stat) { in tune_reserved_size() argument
341 const uint64_t max_reserved_blocks = ext4_blocks_count(sb) * 0.02; in tune_reserved_size()
[all …]
/system/vold/
DVolumeManager.cpp107 static int writeSuperBlock(const char* name, struct asec_superblock *sb, unsigned int numImgSectors… in writeSuperBlock() argument
120 if (write(sbfd, sb, sizeof(struct asec_superblock)) != sizeof(struct asec_superblock)) { in writeSuperBlock()
582 struct stat sb; in remountUid() local
606 if (fstat(pidFd, &sb) != 0) { in remountUid()
610 if (sb.st_uid != uid) { in remountUid()
847 struct asec_superblock sb; in createAsec() local
848 memset(&sb, 0, sizeof(sb)); in createAsec()
861 sb.c_opts |= ASEC_SB_C_OPTS_EXT4; in createAsec()
869 sb.magic = ASEC_SB_MAGIC; in createAsec()
870 sb.ver = ASEC_SB_VER; in createAsec()
[all …]
DUtils.cpp457 struct statvfs sb; in GetFreeBytes() local
458 if (statvfs(path.c_str(), &sb) == 0) { in GetFreeBytes()
459 return (uint64_t) sb.f_bavail * sb.f_frsize; in GetFreeBytes()
637 struct stat sb; in BuildDataUserCePath() local
638 if (lstat(legacy.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) { in BuildDataUserCePath()
653 struct stat sb; in GetDevice() local
654 if (stat(path.c_str(), &sb)) { in GetDevice()
658 return sb.st_dev; in GetDevice()
/system/core/adb/
Dadb_utils.cpp77 struct stat sb; in directory_exists() local
78 return stat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode); in directory_exists()
122 struct stat sb; in mkdirs() local
123 if (stat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode)) { in mkdirs()
/system/sepolicy/tools/
Dsepolicy-check.c190 struct stat sb; in load_policy() local
199 if (fstat(fd, &sb) < 0) { in load_policy()
204 map = mmap(NULL, sb.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); in load_policy()
214 pf->len = sb.st_size; in load_policy()
218 munmap(map, sb.st_size); in load_policy()
225 munmap(map, sb.st_size); in load_policy()
/system/core/init/
Dfirmware_handler.cpp88 struct stat sb; in ProcessFirmwareEvent() local
89 if (fw_fd != -1 && fstat(fw_fd, &sb) != -1) { in ProcessFirmwareEvent()
90 LoadFirmware(uevent, root, fw_fd, sb.st_size, loading_fd, data_fd); in ProcessFirmwareEvent()
Dproperty_service.cpp627 struct stat sb; in load_persistent_properties() local
628 if (fstat(fd, &sb) == -1) { in load_persistent_properties()
636 …if (((sb.st_mode & (S_IRWXG | S_IRWXO)) != 0) || sb.st_uid != 0 || sb.st_gid != 0 || sb.st_nlink !… in load_persistent_properties()
638 << " (uid=" << sb.st_uid << " gid=" << sb.st_gid in load_persistent_properties()
639 << " nlink=" << sb.st_nlink << " mode=" << std::oct << sb.st_mode << ")"; in load_persistent_properties()
/system/core/libziparchive/
Dunzip.cpp63 struct stat sb; in MakeDirectoryHierarchy() local
64 if (stat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode)) return true; in MakeDirectoryHierarchy()
176 struct stat sb; in ExtractOne() local
177 if (stat(name.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode)) return; in ExtractOne()
/system/chre/build/sys_support/qcom/
Duimage.lcs.toolv8061 *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
145 *(.sbss.1 .sbss.1.* .gnu.linkonce.sb.1.*)
148 *(.sbss.2 .sbss.2.* .gnu.linkonce.sb.2.*)
151 *(.sbss.4 .sbss.4.* .gnu.linkonce.sb.4.*)
155 *(.sbss.8 .sbss.8.* .gnu.linkonce.sb.8.*)
166 *(.sbss.hot .sbss.hot.* .gnu.linkonce.sb.hot.*)
167 *(.sbss .sbss.* .gnu.linkonce.sb.*)
/system/sepolicy/tests/
Dsepol_wrap.cpp141 struct stat sb; in load_policy() local
142 if (fstat(fileno(fp), &sb)) { in load_policy()
149 auto unmap = [=](void *ptr) { munmap(ptr, sb.st_size); }; in load_policy()
151 mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fileno(fp), 0), unmap); in load_policy()
163 pf.len = sb.st_size; in load_policy()

12