/system/extras/ext4_utils/ |
D | ext4_utils.c | 119 aux_info.sb = calloc(info.block_size, 1); in ext4_create_fs_aux_info() 123 if (!aux_info.sb) in ext4_create_fs_aux_info() 140 free(aux_info.sb); in ext4_free_fs_aux_info() 148 struct ext4_super_block *sb = aux_info.sb; in ext4_fill_in_sb() local 150 sb->s_inodes_count = info.inodes_per_group * aux_info.groups; in ext4_fill_in_sb() 151 sb->s_blocks_count_lo = aux_info.len_blocks; in ext4_fill_in_sb() 152 sb->s_r_blocks_count_lo = 0; in ext4_fill_in_sb() 153 sb->s_free_blocks_count_lo = 0; in ext4_fill_in_sb() 154 sb->s_free_inodes_count = 0; in ext4_fill_in_sb() 155 sb->s_first_data_block = aux_info.first_data_block; in ext4_fill_in_sb() [all …]
|
D | ext4_jbd2.h | 19 #define EXT4_SINGLEDATA_TRANS_BLOCKS(sb) (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXT… argument 23 … EXT4_DATA_TRANS_BLOCKS(sb) (EXT4_SINGLEDATA_TRANS_BLOCKS(sb) + EXT4_XATTR_TRANS_BLOCKS - 2 + … argument 25 #define EXT4_META_TRANS_BLOCKS(sb) (EXT4_XATTR_TRANS_BLOCKS + EXT4_MAXQUOTAS_TRANS_BLOCKS(sb)) argument 27 #define EXT4_DELETE_TRANS_BLOCKS(sb) (2 * EXT4_DATA_TRANS_BLOCKS(sb) + 64) argument 35 #define EXT4_QUOTA_TRANS_BLOCKS(sb) 0 argument 36 #define EXT4_QUOTA_INIT_BLOCKS(sb) 0 argument 37 #define EXT4_QUOTA_DEL_BLOCKS(sb) 0 argument 38 #define EXT4_MAXQUOTAS_TRANS_BLOCKS(sb) (MAXQUOTAS*EXT4_QUOTA_TRANS_BLOCKS(sb)) argument 39 #define EXT4_MAXQUOTAS_INIT_BLOCKS(sb) (MAXQUOTAS*EXT4_QUOTA_INIT_BLOCKS(sb)) argument 40 #define EXT4_MAXQUOTAS_DEL_BLOCKS(sb) (MAXQUOTAS*EXT4_QUOTA_DEL_BLOCKS(sb)) argument
|
D | ext4fixup.c | 87 static void read_sb(int fd, struct ext4_super_block *sb) in read_sb() argument 95 ret = read(fd, sb, sizeof(*sb)); in read_sb() 98 if (ret != sizeof(*sb)) in read_sb() 103 static void write_sb(int fd, unsigned long long offset, struct ext4_super_block *sb) in write_sb() argument 115 ret = write(fd, sb, sizeof(*sb)); in write_sb() 118 if (ret != sizeof(*sb)) in write_sb() 156 struct ext4_super_block sb; in set_fs_fixup_state() local 186 read_sb(fd, &sb); in set_fs_fixup_state() 189 sb.s_desc_size |= 1; in set_fs_fixup_state() 192 sb.s_desc_size &= ~1; in set_fs_fixup_state() [all …]
|
D | ext2simg.c | 59 struct ext4_super_block sb; in read_ext() local 65 ret = read(fd, &sb, sizeof(sb)); in read_ext() 68 if (ret != sizeof(sb)) in read_ext() 71 ext4_parse_sb(&sb); in read_ext() 99 aux_info.sb->s_inodes_count - aux_info.sb->s_free_inodes_count, in read_ext() 100 aux_info.sb->s_inodes_count, in read_ext() 101 aux_info.sb->s_blocks_count_lo - aux_info.sb->s_free_blocks_count_lo, in read_ext() 102 aux_info.sb->s_blocks_count_lo); in read_ext()
|
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 …]
|
/system/core/libutils/ |
D | SharedBuffer.cpp | 29 SharedBuffer* sb = static_cast<SharedBuffer *>(malloc(sizeof(SharedBuffer) + size)); in alloc() local 30 if (sb) { in alloc() 31 sb->mRefs = 1; in alloc() 32 sb->mSize = size; in alloc() 34 return sb; in alloc() 50 SharedBuffer* sb = alloc(mSize); in edit() local 51 if (sb) { in edit() 52 memcpy(sb->data(), data(), size()); in edit() 55 return sb; in edit() 69 SharedBuffer* sb = alloc(newSize); in editResize() local [all …]
|
D | VectorImpl.cpp | 88 SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage)->attemptEdit(); in editArrayImpl() local 89 if (sb == 0) { in editArrayImpl() 90 sb = SharedBuffer::alloc(capacity() * mItemSize); in editArrayImpl() 91 if (sb) { in editArrayImpl() 92 _do_copy(sb->data(), mStorage, mCount); in editArrayImpl() 94 mStorage = sb->data(); in editArrayImpl() 334 SharedBuffer* sb = SharedBuffer::alloc(new_capacity * mItemSize); in setCapacity() local 335 if (sb) { in setCapacity() 336 void* array = sb->data(); in setCapacity() 359 const SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage); in release_storage() local [all …]
|
D | BasicHashtable.cpp | 84 SharedBuffer* sb = SharedBuffer::bufferFromData(mBuckets); in clear() local 85 if (sb->onlyOwner()) { in clear() 247 SharedBuffer* sb = SharedBuffer::alloc(bytes); in allocateBuckets() local 248 LOG_ALWAYS_FATAL_IF(!sb, "Could not allocate %u bytes for hashtable with %u buckets.", in allocateBuckets() 250 void* buckets = sb->data(); in allocateBuckets() 259 SharedBuffer* sb = SharedBuffer::bufferFromData(buckets); in releaseBuckets() local 260 if (sb->release(SharedBuffer::eKeepStorage) == 1) { in releaseBuckets() 262 SharedBuffer::dealloc(sb); in releaseBuckets()
|
/system/core/libpixelflinger/codeflinger/tinyutils/ |
D | SharedBuffer.cpp | 31 SharedBuffer* sb = static_cast<SharedBuffer *>(malloc(sizeof(SharedBuffer) + size)); in alloc() local 32 if (sb) { in alloc() 33 sb->mRefs = 1; in alloc() 34 sb->mSize = size; in alloc() 36 return sb; in alloc() 52 SharedBuffer* sb = alloc(mSize); in edit() local 53 if (sb) { in edit() 54 memcpy(sb->data(), data(), size()); in edit() 57 return sb; in edit() 71 SharedBuffer* sb = alloc(newSize); in editResize() local [all …]
|
D | VectorImpl.cpp | 91 SharedBuffer* sb = SharedBuffer::sharedBuffer(mStorage)->attemptEdit(); in editArrayImpl() local 92 if (sb == 0) { in editArrayImpl() 93 sb = SharedBuffer::alloc(capacity() * mItemSize); in editArrayImpl() 94 if (sb) { in editArrayImpl() 95 _do_copy(sb->data(), mStorage, mCount); in editArrayImpl() 97 mStorage = sb->data(); in editArrayImpl() 252 SharedBuffer* sb = SharedBuffer::alloc(new_capacity * mItemSize); in setCapacity() local 253 if (sb) { in setCapacity() 254 void* array = sb->data(); in setCapacity() 267 const SharedBuffer* sb = SharedBuffer::sharedBuffer(mStorage); in release_storage() local [all …]
|
/system/extras/tests/ext4/ |
D | corrupt_gdt_free_blocks.c | 19 struct ext4_super_block sb; in main() local 39 if (read(fd, &sb, sizeof(sb)) != sizeof(sb)) { in main() 44 if (sb.s_magic != 0xEF53) { in main() 50 if ((sb.s_log_block_size != 1) && (sb.s_log_block_size != 2)) { in main() 55 block_size = 1 << (10 + sb.s_log_block_size); in main() 56 num_bgs = DIV_ROUND_UP(sb.s_blocks_count_lo, sb.s_blocks_per_group); in main() 58 if (sb.s_desc_size != sizeof(struct ext2_group_desc)) { in main() 60 me, sb.s_desc_size); in main()
|
D | set_ext4_err_bit.c | 16 unsigned char sb[1024]; in main() local 35 if (read(fd, sb, SB_SIZE) != SB_SIZE) { in main() 40 if ((sb[EXT4_MAGIC_OFFSET] != 0x53) || (sb[EXT4_MAGIC_OFFSET+1] != 0xEF)) { in main() 46 sb[EXT4_STATE_OFFSET] |= 0x2; in main() 53 if (write(fd, sb, SB_SIZE) != SB_SIZE) { in main()
|
/system/core/toolbox/ |
D | load_policy.c | 14 struct stat sb; in load_policy_main() local 30 if (fstat(fd, &sb) < 0) { in load_policy_main() 35 map = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in load_policy_main() 41 rc = security_load_policy(map, sb.st_size); in load_policy_main() 46 munmap(map, sb.st_size); in load_policy_main()
|
D | restorecon.c | 23 static int restore(const char *pathname, const struct stat *sb) in restore() argument 32 if (selabel_lookup(sehandle, &newcontext, pathname, sb->st_mode) < 0) { in restore() 122 struct stat sb; in restorecon_main() local 125 rc = lstat(argv[i], &sb); in restorecon_main() 131 restore(argv[i], &sb); in restorecon_main()
|
D | insmod.c | 16 struct stat sb; in read_file() local 26 if (fstat(fd, &sb) < 0) in read_file() 28 size = sb.st_size; in read_file()
|
D | dynarray.c | 91 const char *sb = *(const char **)b; in strlist_compare_strings() local 92 return strcmp(sa, sb); in strlist_compare_strings()
|
/system/core/libcutils/ |
D | dir_hash.c | 42 struct stat sb; in get_file_hash() local 52 if (stat(path, &sb) != 0) { in get_file_hash() 56 if (S_ISLNK(sb.st_mode)) { in get_file_hash() 68 } else if (S_ISREG(sb.st_mode)) { in get_file_hash() 92 if (S_ISLNK(sb.st_mode) || S_ISREG(sb.st_mode)) { in get_file_hash() 101 " %d 0%o %d %d", (int) sb.st_size, sb.st_mode, in get_file_hash() 102 (int) sb.st_uid, (int) sb.st_gid); in get_file_hash() 105 "- - 0%o %d %d", sb.st_mode, in get_file_hash() 106 (int) sb.st_uid, (int) sb.st_gid); in get_file_hash() 175 struct stat sb; in recurse() local [all …]
|
D | fs.c | 42 struct stat sb; in fs_prepare_dir() local 43 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) { in fs_prepare_dir() 53 if (!S_ISDIR(sb.st_mode)) { in fs_prepare_dir() 57 if (((sb.st_mode & ALL_PERMS) == mode) && (sb.st_uid == uid) && (sb.st_gid == gid)) { in fs_prepare_dir() 156 struct stat sb; in fs_mkdirs() local 183 if (fstatat(fd, segment, &sb, AT_SYMLINK_NOFOLLOW) != 0) { in fs_mkdirs() 201 if (S_ISLNK(sb.st_mode)) { in fs_mkdirs() 206 if (!S_ISDIR(sb.st_mode)) { in fs_mkdirs()
|
/system/core/init/ |
D | property_service.c | 487 struct stat sb; in load_persistent_properties() local 505 if (fstat(fd, &sb) < 0) { in load_persistent_properties() 513 if (((sb.st_mode & (S_IRWXG | S_IRWXO)) != 0) in load_persistent_properties() 514 || (sb.st_uid != 0) in load_persistent_properties() 515 || (sb.st_gid != 0) in load_persistent_properties() 516 || (sb.st_nlink != 1)) { in load_persistent_properties() 518 entry->d_name, sb.st_uid, sb.st_gid, sb.st_nlink, sb.st_mode); in load_persistent_properties()
|
D | util.c | 147 struct stat sb; in read_file() local 155 if (fstat(fd, &sb) < 0) { in read_file() 159 if ((sb.st_mode & (S_IWGRP | S_IWOTH)) != 0) { in read_file() 499 struct stat sb; in restorecon() local 505 if (lstat(pathname, &sb) < 0) in restorecon() 507 if (selabel_lookup(sehandle, &secontext, pathname, sb.st_mode) < 0) in restorecon()
|
/system/vold/ |
D | fstrim.c | 59 struct stat sb; in do_fstrim_filesystems() local 81 if (stat(fstab->recs[i].mount_point, &sb) == -1) { in do_fstrim_filesystems() 86 if (!S_ISDIR(sb.st_mode)) { in do_fstrim_filesystems()
|
D | VolumeManager.cpp | 270 struct asec_superblock sb; in createAsec() local 271 memset(&sb, 0, sizeof(sb)); in createAsec() 284 sb.c_opts |= ASEC_SB_C_OPTS_EXT4; in createAsec() 292 sb.magic = ASEC_SB_MAGIC; in createAsec() 293 sb.ver = ASEC_SB_VER; in createAsec() 366 sb.c_cipher = ASEC_SB_C_CIPHER_TWOFISH; in createAsec() 376 sb.c_cipher = ASEC_SB_C_CIPHER_NONE; in createAsec() 406 if (write(sbfd, &sb, sizeof(sb)) != sizeof(sb)) { in createAsec() 525 struct asec_superblock sb; in finalizeAsec() local 527 if (Loop::lookupInfo(loopDevice, &sb, &nr_sec)) { in finalizeAsec() [all …]
|
D | Loop.h | 30 static int lookupInfo(const char *loopDevice, struct asec_superblock *sb, unsigned int *nr_sec);
|
/system/extras/tests/bionic/libc/common/ |
D | bench_pthread.c | 84 uint64_t sb = *(const uint64_t*)b; in compare_stats() local 85 if (sa < sb) in compare_stats() 87 if (sa > sb) in compare_stats()
|
/system/core/fs_mgr/ |
D | fs_mgr_verity.c | 123 struct ext4_super_block sb; in get_target_device_size() local 137 if (read(data_device, &sb, sizeof(sb)) != sizeof(sb)) { in get_target_device_size() 143 ext4_parse_sb(&sb); in get_target_device_size()
|