Lines Matching defs:count
989 static s64 ntfs_attr_pread_i(ntfs_attr *na, const s64 pos, s64 count, void *b)
1001 return ntfs_compressed_attr_pread(na, pos, count, b);
1019 if (!count)
1038 if (pos + count > max_read) {
1041 count = max_read - pos;
1065 memcpy(b, val + pos, count);
1067 return count;
1071 if (pos + count > max_init) {
1073 memset(b, 0, count);
1074 return count;
1076 total2 = pos + count - max_init;
1077 count -= total2;
1078 memset((u8*)b + count, 0, total2);
1088 ((pos + count) > max_init-2)) {
1090 if (pos+count == max_init) {
1091 if (count == 1) {
1092 *((u8*)b+count-1) = (u8)(efs_padding_length >> 8);
1093 count--;
1096 *(le16*)((u8*)b+count-2) = cpu_to_le16(efs_padding_length);
1097 count -= 2;
1101 *((u8*)b+count-1) = (u8)(efs_padding_length & 0xff);
1102 count--;
1123 * a partial final vcn is taken care of by the @count capping of read
1127 for (; count; rl++, ofs = 0) {
1154 to_read = min(count, (rl->length <<
1159 count -= to_read;
1164 to_read = min(count, (rl->length << vol->cluster_size_bits) -
1175 count -= br;
1203 * @count: number of bytes to read
1206 * This function will read @count bytes starting at offset @pos from the ntfs
1210 * lower than @count this means that the read reached end of file or that an
1212 * end of file or nothing was read (also return 0 when @count is 0).
1218 s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b)
1222 if (!na || !na->ni || !na->ni->vol || !b || pos < 0 || count < 0) {
1224 ntfs_log_perror("%s: na=%p b=%p pos=%lld count=%lld",
1226 (long long)count);
1230 ntfs_log_enter("Entering for inode %lld attr 0x%x pos %lld count "
1232 le32_to_cpu(na->type), (long long)pos, (long long)count);
1234 ret = ntfs_attr_pread_i(na, pos, count, b);
1240 static int ntfs_attr_fill_zero(ntfs_attr *na, s64 pos, s64 count)
1243 s64 written, size, end = pos + count;
1249 ntfs_log_trace("pos %lld, count %lld\n", (long long)pos,
1250 (long long)count);
1252 if (!na || pos < 0 || count < 0) {
1301 static int ntfs_attr_fill_hole(ntfs_attr *na, s64 count, s64 *ofs,
1323 to_write = min(count, ((*rl)->length << vol->cluster_size_bits) - *ofs);
1328 ntfs_log_trace("count: %lld, cur_vcn: %lld, from: %lld, to: %lld, ofs: "
1329 "%lld\n", (long long)count, (long long)cur_vcn,
1518 s64 pos, s64 count, VCN *update_from)
1542 s32 endblock = (((pos + count - 1) >> cluster_size_bits)
1680 s64 pos, s64 count, VCN *update_from, BOOL wasnonresident)
1693 endblock = (((pos + count - 1) >> cluster_size_bits) | (na->compression_block_clusters - 1)) + 1 - rl->vcn;
1832 * @count: number of bytes to write
1835 * This function will write @count bytes from data buffer @b to ntfs attribute
1839 * is lower than @count this means that an error was encountered during the
1841 * 0 when @count is 0).
1847 static s64 ntfs_attr_pwrite_i(ntfs_attr *na, const s64 pos, s64 count,
1904 if (!count)
1907 fullcount = count;
1914 if (pos + count > na->data_size) {
1924 if (ntfs_attr_truncate_i(na, pos + count,
1938 if (ntfs_attr_truncate_i(na, pos + count, HOLES_OK)) {
1954 * so truncate the requested count if needed (big buffers).
1958 if (count > fullcount)
1959 count = fullcount;
1982 memcpy(val + pos, b, count);
1996 total = count;
2002 if (pos + count > na->initialized_size) {
2048 /* Set initialized_size to @pos + @count. */
2062 ctx->attr->initialized_size = cpu_to_sle64(pos + count);
2065 na->data_size = pos + count;
2080 na->initialized_size = pos + count;
2153 &rl, pos, count, &update_from);
2163 &rl, pos, count, &update_from,
2179 * partial final vcn is taken care of by the @count capping of write
2182 for (hole_end = 0; count; rl++, ofs = 0) {
2224 to_write = min(count, (rl->length << vol->cluster_size_bits) - ofs);
2288 count -= written;
2393 s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, const void *b)
2398 ntfs_log_enter("Entering for inode %lld, attr 0x%x, pos 0x%llx, count "
2400 (long long)pos, (long long)count);
2403 if (!na || !na->ni || !na->ni->vol || !b || pos < 0 || count < 0) {
2416 count - total, (const u8*)b + total);
2419 } while ((written > 0) && (total < count));
2500 * partial final vcn is taken care of by the @count capping of write