Lines Matching refs:newsize

3779  * @newsize:	new size (in bytes) to which to resize the attribute
3781 * Change the size of a resident, open ntfs attribute @na to @newsize bytes.
3786 * ERANGE - @newsize is not valid for the attribute type of @na.
3791 * @newsize bytes length.
3793 static int ntfs_resident_attr_resize(ntfs_attr *na, const s64 newsize)
3802 (long long)newsize);
3816 * sizes against @newsize and fail if @newsize is out of bounds.
3818 if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) {
3828 * If @newsize is bigger than the MFT record we need to make the
3832 if (newsize < vol->mft_record_size) {
3835 newsize)) {
3837 na->data_size = na->initialized_size = newsize;
3838 na->allocated_size = ROUND_UP(newsize, 3);
3863 return ntfs_attr_truncate(na, newsize);
3904 return ntfs_resident_attr_resize(na, newsize);
3923 return ntfs_resident_attr_resize(na, newsize);
3976 return ntfs_resident_attr_resize(na, newsize);
3997 return ntfs_resident_attr_resize(na, newsize);
4736 * @newsize: new size (in bytes) to which to shrink the attribute
4738 * Reduce the size of a non-resident, open ntfs attribute @na to @newsize bytes.
4743 * ERANGE - @newsize is not valid for the attribute type of @na.
4745 static int ntfs_non_resident_attr_shrink(ntfs_attr *na, const s64 newsize)
4753 ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, newsize %lld.\n",
4755 (long long)newsize);
4761 * against @newsize and fail if @newsize is too small.
4763 if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) {
4773 first_free_vcn = (newsize + vol->cluster_size - 1) >>
4836 na->data_size = newsize;
4837 ctx->attr->u.nonres.data_size = cpu_to_sle64(newsize);
4838 if (newsize < na->initialized_size) {
4839 na->initialized_size = newsize;
4840 ctx->attr->u.nonres.initialized_size = cpu_to_sle64(newsize);
4849 if (!newsize) {
4872 * @newsize: new size (in bytes) to which to expand the attribute
4875 * Expand the size of a non-resident, open ntfs attribute @na to @newsize bytes,
4881 * ERANGE - @newsize is not valid for the attribute type of @na.
4884 static int ntfs_non_resident_attr_expand(ntfs_attr *na, const s64 newsize,
4897 (long long)newsize, (long long)na->data_size);
4903 * against @newsize and fail if @newsize is too big.
4905 if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) {
4917 first_free_vcn = (newsize + vol->cluster_size - 1) >>
5035 na->data_size = newsize;
5036 ctx->attr->u.nonres.data_size = cpu_to_sle64(newsize);
5086 * @newsize: new size (in bytes) to which to resize the attribute
5089 * Change the size of an open ntfs attribute @na to @newsize bytes. If the
5099 * ERANGE - @newsize is not valid for the attribute type of @na.
5104 * @newsize bytes length.
5107 int __ntfs_attr_truncate(ntfs_attr *na, const s64 newsize, BOOL sparse)
5111 if (!na || newsize < 0 ||
5121 if (na->data_size == newsize)
5141 if (newsize > na->data_size)
5142 ret = ntfs_non_resident_attr_expand(na, newsize,
5145 ret = ntfs_non_resident_attr_shrink(na, newsize);
5147 ret = ntfs_resident_attr_resize(na, newsize);
5159 int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize)
5161 return __ntfs_attr_truncate(na, newsize, TRUE);