/system/extras/ext4_utils/ |
D | ext4_sb.cpp | 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_utils.cpp | 94 void read_sb(int fd, struct ext4_super_block *sb) in read_sb() argument 102 ret = read(fd, sb, sizeof(*sb)); in read_sb() 105 if (ret != sizeof(*sb)) in read_sb() 159 aux_info.sb = (struct ext4_super_block *)((char *)aux_info.sb_block + 1024); in ext4_create_fs_aux_info() 161 aux_info.sb = aux_info.sb_block; in ext4_create_fs_aux_info() 166 if (!aux_info.sb) in ext4_create_fs_aux_info() 188 void ext4_parse_sb_info(struct ext4_super_block *sb) in ext4_parse_sb_info() argument 190 if (sb->s_magic != EXT4_SUPER_MAGIC) in ext4_parse_sb_info() 193 if ((sb->s_state & EXT4_VALID_FS) != EXT4_VALID_FS) in ext4_parse_sb_info() 196 ext4_parse_sb(sb, &info); in ext4_parse_sb_info() [all …]
|
/system/core/libutils/ |
D | SharedBuffer.cpp | 37 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() 44 sb->mClientMetadata = 0; in alloc() 46 return sb; in alloc() 60 SharedBuffer* sb = alloc(mSize); in edit() local 61 if (sb) { in edit() 62 memcpy(sb->data(), data(), size()); in edit() 65 return sb; in edit() [all …]
|
D | VectorImpl.cpp | 88 const SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage); in editArrayImpl() local 89 SharedBuffer* editable = sb->attemptEdit(); in editArrayImpl() 93 editable = SharedBuffer::alloc(sb->size()); in editArrayImpl() 344 SharedBuffer* sb = SharedBuffer::alloc(new_allocation_size); in setCapacity() local 345 if (sb) { in setCapacity() 346 void* array = sb->data(); in setCapacity() 369 const SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage); in release_storage() local 370 if (sb->release(SharedBuffer::eKeepStorage) == 1) { in release_storage() 372 SharedBuffer::dealloc(sb); in release_storage() 416 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 | 81 bool getSuperBlock(const int blk_fd, struct ext4_super_block* sb) { in getSuperBlock() argument 87 if (read(blk_fd, sb, sizeof(*sb)) != sizeof(*sb)) { in getSuperBlock() 92 if (sb->s_magic != 0xEF53) { in getSuperBlock() 102 struct ext4_super_block sb; in setSbErrorBit() local 103 if (!getSuperBlock(blk_fd, &sb)) { in setSbErrorBit() 108 if (sb.s_state & 0x2) { in setSbErrorBit() 114 sb.s_state |= 0x2; in setSbErrorBit() 122 if (write(blk_fd, &sb, sizeof(sb)) != sizeof(sb)) { in setSbErrorBit() 132 struct ext4_super_block sb; in corruptGdtFreeBlock() local 133 if (!getSuperBlock(blk_fd, &sb)) { in corruptGdtFreeBlock() [all …]
|
/system/extras/f2fs_utils/ |
D | f2fs_sparseblock.c | 35 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/ |
D | bitalloc.c | 135 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 …]
|
D | readsamplesjoint.inc | 72 OI_UINT sb; 76 sb = NROF_SUBBANDS; 86 } while (--sb); 90 sb = NROF_SUBBANDS; 110 } while (--sb);
|
/system/libufdt/utils/src/ |
D | mkdtboimg.py | 101 sb = [] 102 sb.append('{key:>20} = {value:d}'.format(key='dt_size', 104 sb.append('{key:>20} = {value:d}'.format(key='dt_offset', 106 sb.append('{key:>20} = {value:08x}'.format(key='id', 108 sb.append('{key:>20} = {value:08x}'.format(key='rev', 110 sb.append('{key:>20} = {value:08x}'.format(key='custom[0]', 112 sb.append('{key:>20} = {value:08x}'.format(key='custom[1]', 114 sb.append('{key:>20} = {value:08x}'.format(key='custom[2]', 116 sb.append('{key:>20} = {value:08x}'.format(key='custom[3]', 118 return '\n'.join(sb) [all …]
|
/system/core/libcutils/ |
D | fs.cpp | 50 struct stat sb; in fs_prepare_path_impl() local 52 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) { in fs_prepare_path_impl() 62 type_ok = prepare_as_dir ? S_ISDIR(sb.st_mode) : S_ISREG(sb.st_mode); in fs_prepare_path_impl() 68 owner_match = ((sb.st_uid == uid) && (sb.st_gid == gid)); in fs_prepare_path_impl() 69 mode_match = ((sb.st_mode & ALL_PERMS) == mode); in fs_prepare_path_impl() 77 path, uid, gid, sb.st_uid, sb.st_gid); in fs_prepare_path_impl() 81 path, mode, (sb.st_mode & ALL_PERMS)); in fs_prepare_path_impl() 208 struct stat sb; in fs_mkdirs() local 223 if (fstatat(fd, segment, &sb, AT_SYMLINK_NOFOLLOW) != 0) { in fs_mkdirs() 241 if (S_ISLNK(sb.st_mode)) { in fs_mkdirs() [all …]
|
/system/extras/pagecache/ |
D | dumpcache.c | 75 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/sepolicy/tools/sepolicy-analyze/ |
D | utils.c | 28 struct stat sb; in load_policy() local 37 if (fstat(fd, &sb) < 0) { in load_policy() 41 map = mmap(NULL, sb.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); in load_policy() 50 pf->len = sb.st_size; in load_policy() 64 munmap(map, sb.st_size); in load_policy()
|
/system/core/fs_mgr/libvbmeta/ |
D | utility.cpp | 33 struct stat sb; in GetFileSize() local 34 if (fstat(fd, &sb) == -1) { in GetFileSize() 37 return sb.st_size; in GetFileSize()
|
/system/core/init/ |
D | persistent_properties.cpp | 79 struct stat sb; in LoadLegacyPersistentProperties() local 80 if (fstat(fd, &sb) == -1) { in LoadLegacyPersistentProperties() 87 if (((sb.st_mode & (S_IRWXG | S_IRWXO)) != 0) || sb.st_uid != 0 || sb.st_gid != 0 || in LoadLegacyPersistentProperties() 88 sb.st_nlink != 1) { in LoadLegacyPersistentProperties() 90 << " (uid=" << sb.st_uid << " gid=" << sb.st_gid << " nlink=" << sb.st_nlink in LoadLegacyPersistentProperties() 91 << " mode=" << std::oct << sb.st_mode << ")"; in LoadLegacyPersistentProperties()
|
D | mount_handler.cpp | 83 struct stat sb; in SetMountProperty() local 84 if (stat(queue.c_str(), &sb) || !S_ISDIR(sb.st_mode)) value = ""; in SetMountProperty() 85 if (stat(entry.mount_point.c_str(), &sb) || !S_ISDIR(sb.st_mode)) value = ""; in SetMountProperty()
|
/system/extras/ext4_utils/include/ext4_utils/ |
D | ext4.h | 363 #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 …]
|
/system/core/fs_mgr/ |
D | fs_mgr.cpp | 310 struct ext4_super_block* sb, int* fs_stat) { in read_ext4_superblock() argument 318 if (TEMP_FAILURE_RETRY(pread(fd, sb, sizeof(*sb), 1024)) != sizeof(*sb)) { in read_ext4_superblock() 323 if (!is_ext4_superblock_valid(sb)) { in read_ext4_superblock() 337 if (TEMP_FAILURE_RETRY(pread(fd, sb, sizeof(*sb), superblock * blocksize)) != in read_ext4_superblock() 338 sizeof(*sb)) { in read_ext4_superblock() 342 if (is_ext4_superblock_valid(sb) && in read_ext4_superblock() 343 (1 << (10 + sb->s_log_block_size) == blocksize)) { in read_ext4_superblock() 352 LINFO << "superblock s_max_mnt_count:" << sb->s_max_mnt_count << "," << blk_device; in read_ext4_superblock() 353 if (sb->s_max_mnt_count == 0xffff) { // -1 (int16) in ext2, but uint16 in ext4 in read_ext4_superblock() 364 ext4_super_block sb; in fs_mgr_is_ext4() local [all …]
|
/system/timezone/input_tools/android/common/src/main/java/com/android/libcore/timezone/util/ |
D | Errors.java | 79 StringBuilder sb = new StringBuilder(); in asString() local 81 sb.append(message); in asString() 82 sb.append("\n"); in asString() 84 return sb.toString(); in asString()
|
/system/core/libprocessgroup/cgrouprc/ |
D | cgroup_file.cpp | 37 struct stat sb; in LoadRcFile() local 45 if (fstat(fd, &sb) < 0) { in LoadRcFile() 50 size_t file_size = sb.st_size; in LoadRcFile()
|
/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/adb/ |
D | adb_utils.cpp | 77 struct stat sb; in directory_exists() local 78 return stat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode); in directory_exists() 124 struct stat sb; in mkdirs() local 125 if (stat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode)) { in mkdirs()
|
/system/gsid/ |
D | partition_installer.cpp | 127 struct statvfs sb; in PerformSanityChecks() local 128 if (statvfs(install_dir_.c_str(), &sb)) { in PerformSanityChecks() 135 uint64_t free_space = 1ULL * sb.f_bavail * sb.f_frsize; in PerformSanityChecks() 136 uint64_t fs_size = sb.f_blocks * sb.f_frsize; in PerformSanityChecks()
|
/system/memory/libmeminfo/libdmabufinfo/ |
D | dmabufinfo.cpp | 143 struct stat sb; in ReadDmaBufFdRefs() local 144 if (stat(path.c_str(), &sb) < 0) { in ReadDmaBufFdRefs() 149 uint64_t inode = sb.st_ino; in ReadDmaBufFdRefs() 160 DmaBuffer& db = dmabufs->emplace_back(sb.st_ino, sb.st_blocks * 512, count, exporter, name); in ReadDmaBufFdRefs()
|
/system/core/fs_mgr/libfiemap/ |
D | fiemap_writer.cpp | 172 struct stat sb; in GetBlockDeviceForFile() local 173 if (stat(file_path.c_str(), &sb)) { in GetBlockDeviceForFile() 179 if (!BlockDeviceToName(major(sb.st_dev), minor(sb.st_dev), &bdev)) { in GetBlockDeviceForFile() 180 LOG(ERROR) << "Failed to get block device name for " << major(sb.st_dev) << ":" in GetBlockDeviceForFile() 181 << minor(sb.st_dev); in GetBlockDeviceForFile() 201 if (stat(bdev_path->c_str(), &sb)) { in GetBlockDeviceForFile() 206 if ((sb.st_mode & S_IFMT) != S_IFBLK) { in GetBlockDeviceForFile() 227 struct stat sb; in GetFileSize() local 228 if (stat(file_path.c_str(), &sb)) { in GetFileSize() 233 return sb.st_size; in GetFileSize()
|