/system/extras/ext4_utils/ |
D | ext4_utils.c | 141 void read_sb(int fd, struct ext4_super_block *sb) in read_sb() argument 149 ret = read(fd, sb, sizeof(*sb)); in read_sb() 152 if (ret != sizeof(*sb)) in read_sb() 157 void write_sb(int fd, unsigned long long offset, struct ext4_super_block *sb) in write_sb() argument 165 ret = write(fd, sb, sizeof(*sb)); in write_sb() 168 if (ret != sizeof(*sb)) in write_sb() 187 write_sb(fd, 1024, aux_info.sb); in block_device_write_sb() 245 aux_info.sb = (struct ext4_super_block *)((char *)aux_info.sb_block + 1024); in ext4_create_fs_aux_info() 247 aux_info.sb = aux_info.sb_block; in ext4_create_fs_aux_info() 252 if (!aux_info.sb) in ext4_create_fs_aux_info() [all …]
|
D | ext4_sb.c | 21 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 …]
|
D | ext4.h | 362 #define test_opt(sb, opt) (EXT4_SB(sb)->s_mount_opt & EXT4_MOUNT_##opt) argument 453 #define EXT4_SB(sb) (sb) argument 471 #define EXT4_HAS_COMPAT_FEATURE(sb,mask) ((EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask… argument 472 #define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) ((EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le3… argument 473 #define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) ((EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(… argument 474 #define EXT4_SET_COMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) argument 475 #define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32… argument 476 #define EXT4_SET_INCOMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(m… argument 477 #define EXT4_CLEAR_COMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(ma… argument 478 #define EXT4_CLEAR_RO_COMPAT_FEATURE(sb,mask) EXT4_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_l… argument [all …]
|
D | ext4fixup.c | 120 struct ext4_super_block sb; in set_fs_fixup_state() local 150 read_sb(fd, &sb); in set_fs_fixup_state() 153 sb.s_desc_size |= 1; in set_fs_fixup_state() 156 sb.s_desc_size &= ~1; in set_fs_fixup_state() 160 write_sb(fd, 1024, &sb); in set_fs_fixup_state() 267 struct ext4_super_block sb; in update_superblocks_and_bg_desc() local 272 read_sb(fd, &sb); in update_superblocks_and_bg_desc() 276 total_new_inodes = num_block_groups * (new_inodes_per_group - sb.s_inodes_per_group); in update_superblocks_and_bg_desc() 285 … aux_info.bg_desc[i].bg_free_inodes_count += (new_inodes_per_group - sb.s_inodes_per_group); in update_superblocks_and_bg_desc() 291 if ((sb.s_inodes_count + total_new_inodes) != (new_inodes_per_group * num_block_groups)) { in update_superblocks_and_bg_desc() [all …]
|
D | ext4_utils.h | 101 struct ext4_super_block *sb; member 139 void read_sb(int fd, struct ext4_super_block *sb); 140 void write_sb(int fd, unsigned long long offset, struct ext4_super_block *sb); 148 void ext4_queue_sb(u64 start_block, struct ext4_super_block *sb); 153 void ext4_parse_sb_info(struct ext4_super_block *sb);
|
D | ext4_sb.h | 49 int ext4_parse_sb(struct ext4_super_block *sb, struct fs_info *info);
|
/system/core/libutils/ |
D | SharedBuffer.cpp | 35 SharedBuffer* sb = static_cast<SharedBuffer *>(malloc(sizeof(SharedBuffer) + size)); in alloc() local 36 if (sb) { in alloc() 40 sb->mRefs.store(1, std::memory_order_relaxed); in alloc() 41 sb->mSize = size; in alloc() 43 return sb; in alloc() 57 SharedBuffer* sb = alloc(mSize); in edit() local 58 if (sb) { in edit() 59 memcpy(sb->data(), data(), size()); in edit() 62 return sb; in edit() 81 SharedBuffer* sb = alloc(newSize); in editResize() local [all …]
|
D | VectorImpl.cpp | 90 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/ |
D | squashfs_utils.c | 43 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/ |
D | recovery_test.cpp | 80 bool getSuperBlock(const int blk_fd, struct ext4_super_block* sb) { in getSuperBlock() argument 86 if (read(blk_fd, sb, sizeof(*sb)) != sizeof(*sb)) { in getSuperBlock() 91 if (sb->s_magic != 0xEF53) { in getSuperBlock() 101 struct ext4_super_block sb; in setSbErrorBit() local 102 if (!getSuperBlock(blk_fd, &sb)) { in setSbErrorBit() 107 if (sb.s_state & 0x2) { in setSbErrorBit() 113 sb.s_state |= 0x2; in setSbErrorBit() 121 if (write(blk_fd, &sb, sizeof(sb)) != sizeof(sb)) { in setSbErrorBit() 131 struct ext4_super_block sb; in corruptGdtFreeBlock() local 132 if (!getSuperBlock(blk_fd, &sb)) { in corruptGdtFreeBlock() [all …]
|
/system/extras/f2fs_utils/ |
D | f2fs_sparseblock.c | 33 static void dbg_print_raw_sb_info(struct f2fs_super_block *sb) in dbg_print_raw_sb_info() argument 40 D_DISP_u32(sb, magic); in dbg_print_raw_sb_info() 41 D_DISP_u32(sb, major_ver); in dbg_print_raw_sb_info() 42 D_DISP_u32(sb, minor_ver); in dbg_print_raw_sb_info() 43 D_DISP_u32(sb, log_sectorsize); in dbg_print_raw_sb_info() 44 D_DISP_u32(sb, log_sectors_per_block); in dbg_print_raw_sb_info() 46 D_DISP_u32(sb, log_blocksize); in dbg_print_raw_sb_info() 47 D_DISP_u32(sb, log_blocks_per_seg); in dbg_print_raw_sb_info() 48 D_DISP_u32(sb, segs_per_sec); in dbg_print_raw_sb_info() 49 D_DISP_u32(sb, secs_per_zone); in dbg_print_raw_sb_info() [all …]
|
/system/bt/embdrv/sbc/decoder/srce/ |
D | bitalloc.c | 138 OI_UINT sb; in computeBitneed() local 145 for (sb = 0; sb < nrof_subbands; sb++) { in computeBitneed() 146 OI_INT bits = scale_factor[sb]; in computeBitneed() 150 if ((bitneeds[sb] = bits) > 1) { in computeBitneed() 162 for (sb = 0; sb < nrof_subbands; sb++) { in computeBitneed() 163 OI_INT bits = scale_factor[sb]; in computeBitneed() 169 bits -= offset[sb]; in computeBitneed() 175 if ((bitneeds[sb] = bits) > 1) { in computeBitneed() 349 OI_UINT sb; in oneChannelBitAllocation() local 366 sb = 0; in oneChannelBitAllocation() [all …]
|
D | readsamplesjoint.inc | 71 OI_UINT sb; 75 sb = NROF_SUBBANDS; 85 } while (--sb); 89 sb = NROF_SUBBANDS; 109 } while (--sb);
|
/system/core/libcutils/ |
D | fs.c | 43 struct stat sb; in fs_prepare_path_impl() local 45 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) { in fs_prepare_path_impl() 55 int type_ok = prepare_as_dir ? S_ISDIR(sb.st_mode) : S_ISREG(sb.st_mode); in fs_prepare_path_impl() 61 int owner_match = ((sb.st_uid == uid) && (sb.st_gid == gid)); in fs_prepare_path_impl() 62 int mode_match = ((sb.st_mode & ALL_PERMS) == mode); in fs_prepare_path_impl() 70 path, uid, gid, sb.st_uid, sb.st_gid); in fs_prepare_path_impl() 74 path, mode, (sb.st_mode & ALL_PERMS)); in fs_prepare_path_impl() 192 struct stat sb; in fs_mkdirs() local 219 if (fstatat(fd, segment, &sb, AT_SYMLINK_NOFOLLOW) != 0) { in fs_mkdirs() 237 if (S_ISLNK(sb.st_mode)) { in fs_mkdirs() [all …]
|
/system/sepolicy/tools/sepolicy-analyze/ |
D | utils.c | 28 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/ |
D | dumpcache.c | 74 static int store_num_cached(const char* fpath, const struct stat *sb) { in store_num_cached() argument 83 void* mapped_addr = mmap(NULL, sb->st_size, PROT_NONE, MAP_SHARED, fd, 0); in store_num_cached() 87 size_t num_file_pages = (sb->st_size + g_page_size - 1) / g_page_size; in store_num_cached() 89 int ret = mincore(mapped_addr, sb->st_size, mincore_data); in store_num_cached() 96 struct file_info *info = get_file_info(fpath, sb->st_size); in store_num_cached() 100 munmap(mapped_addr, sb->st_size); in store_num_cached() 107 static int scan_entry(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) { in scan_entry() argument 109 store_num_cached(fpath, sb); in scan_entry()
|
/system/vold/ |
D | VolumeManager.cpp | 98 static int writeSuperBlock(const char* name, struct asec_superblock *sb, unsigned int numImgSectors… in writeSuperBlock() argument 111 if (write(sbfd, sb, sizeof(struct asec_superblock)) != sizeof(struct asec_superblock)) { in writeSuperBlock() 517 struct stat sb; in remountUid() local 541 if (fstat(pidFd, &sb) != 0) { in remountUid() 545 if (sb.st_uid != uid) { in remountUid() 766 struct asec_superblock sb; in createAsec() local 767 memset(&sb, 0, sizeof(sb)); in createAsec() 780 sb.c_opts |= ASEC_SB_C_OPTS_EXT4; in createAsec() 788 sb.magic = ASEC_SB_MAGIC; in createAsec() 789 sb.ver = ASEC_SB_VER; in createAsec() [all …]
|
D | Utils.cpp | 433 struct statvfs sb; in GetFreeBytes() local 434 if (statvfs(path.c_str(), &sb) == 0) { in GetFreeBytes() 435 return (uint64_t)sb.f_bfree * sb.f_bsize; in GetFreeBytes() 634 struct stat sb; in GetDevice() local 635 if (stat(path.c_str(), &sb)) { in GetDevice() 639 return sb.st_dev; in GetDevice()
|
D | Loop.h | 30 … static int lookupInfo(const char *loopDevice, struct asec_superblock *sb, unsigned long *nr_sec);
|
/system/core/adb/ |
D | adb_utils.cpp | 74 struct stat sb; in directory_exists() local 75 return lstat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode); in directory_exists() 165 struct stat sb; in mkdirs() local 166 if (stat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode)) { in mkdirs()
|
/system/core/base/ |
D | file_test.cpp | 57 struct stat sb; in TEST() local 58 ASSERT_EQ(0, stat(tf.path, &sb)); in TEST() 59 ASSERT_EQ(0660U, static_cast<unsigned int>(sb.st_mode & ~S_IFMT)); in TEST() 60 ASSERT_EQ(getuid(), sb.st_uid); in TEST() 61 ASSERT_EQ(getgid(), sb.st_gid); in TEST()
|
/system/core/init/ |
D | property_service.cpp | 427 struct stat sb; in load_persistent_properties() local 428 if (fstat(fd, &sb) == -1) { in load_persistent_properties() 436 if (((sb.st_mode & (S_IRWXG | S_IRWXO)) != 0) || (sb.st_uid != 0) || (sb.st_gid != 0) || in load_persistent_properties() 437 (sb.st_nlink != 1)) { in load_persistent_properties() 439 entry->d_name, (unsigned int)sb.st_uid, (unsigned int)sb.st_gid, in load_persistent_properties() 440 (unsigned int)sb.st_nlink, sb.st_mode); in load_persistent_properties()
|
/system/sepolicy/tools/ |
D | sepolicy-check.c | 190 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/toolbox/ |
D | newfs_msdos.c | 250 struct stat sb; in newfs_msdos_main() local 383 if (fstat(fd, &sb)) in newfs_msdos_main() 386 if (!S_ISREG(sb.st_mode)) in newfs_msdos_main() 389 if (!S_ISCHR(sb.st_mode)) in newfs_msdos_main() 393 check_mounted(fname, sb.st_mode); in newfs_msdos_main() 503 if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) in newfs_msdos_main() 505 if (!S_ISREG(sb.st_mode) || sb.st_size % bpb.bps || in newfs_msdos_main() 506 sb.st_size < bpb.bps || sb.st_size > bpb.bps * MAXU16) in newfs_msdos_main() 508 bss = sb.st_size / bpb.bps; in newfs_msdos_main()
|
/system/extras/libfec/ |
D | fec_open.cpp | 261 ext4_super_block sb; in get_ext4_size() local 263 if (fec_pread(f, &sb, sizeof(sb), 1024) != sizeof(sb)) { in get_ext4_size() 271 if (ext4_parse_sb(&sb, &info) != 0) { in get_ext4_size()
|