Lines Matching refs:newsize
1825 static int ntfs_attr_truncate_i(ntfs_attr *na, const s64 newsize,
5280 static int ntfs_resident_attr_resize(ntfs_attr *na, const s64 newsize);
5285 * @newsize: new size (in bytes) to which to resize the attribute
5287 * Change the size of a resident, open ntfs attribute @na to @newsize bytes.
5297 * ERANGE - @newsize is not valid for the attribute type of @na.
5300 static int ntfs_resident_attr_resize_i(ntfs_attr *na, const s64 newsize,
5310 (long long)newsize);
5325 * sizes against @newsize and fail if @newsize is out of bounds.
5327 if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) {
5335 * If @newsize is bigger than the mft record we need to make the
5339 if ((newsize < vol->mft_record_size) && (holes != HOLES_NONRES)) {
5342 newsize))) {
5344 na->data_size = na->initialized_size = newsize;
5345 na->allocated_size = (newsize + 7) & ~7;
5386 if (newsize != na->data_size) {
5395 return ntfs_attr_truncate_i(na, newsize, holes);
5451 return ntfs_resident_attr_resize_i(na, newsize, holes);
5475 return ntfs_resident_attr_resize_i(na, newsize, holes);
5514 return ntfs_resident_attr_resize_i(na, newsize, holes);
5535 return ntfs_resident_attr_resize_i(na, newsize, holes);
5551 static int ntfs_resident_attr_resize(ntfs_attr *na, const s64 newsize)
5556 ret = ntfs_resident_attr_resize_i(na, newsize, HOLES_OK);
6335 * @newsize: new size (in bytes) to which to shrink the attribute
6337 * Reduce the size of a non-resident, open ntfs attribute @na to @newsize bytes.
6342 * ERANGE - @newsize is not valid for the attribute type of @na.
6344 static int ntfs_non_resident_attr_shrink(ntfs_attr *na, const s64 newsize)
6353 na->ni->mft_no, le32_to_cpu(na->type), (long long)newsize);
6359 * against @newsize and fail if @newsize is too small.
6361 if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) {
6378 first_free_vcn = (((newsize - 1)
6382 first_free_vcn = (newsize + vol->cluster_size - 1) >>
6443 na->data_size = newsize;
6444 ctx->attr->data_size = cpu_to_sle64(newsize);
6445 if (newsize < na->initialized_size) {
6446 na->initialized_size = newsize;
6447 ctx->attr->initialized_size = cpu_to_sle64(newsize);
6464 if (!newsize) {
6488 * @newsize: new size (in bytes) to which to expand the attribute
6490 * Expand the size of a non-resident, open ntfs attribute @na to @newsize bytes,
6496 * ERANGE - @newsize is not valid for the attribute type of @na.
6499 static int ntfs_non_resident_attr_expand_i(ntfs_attr *na, const s64 newsize,
6512 (long long)newsize, (long long)na->data_size);
6518 * against @newsize and fail if @newsize is too big.
6520 if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) {
6532 first_free_vcn = (newsize + vol->cluster_size - 1) >>
6679 na->data_size = newsize;
6680 ctx->attr->data_size = cpu_to_sle64(newsize);
6735 static int ntfs_non_resident_attr_expand(ntfs_attr *na, const s64 newsize,
6741 ret = ntfs_non_resident_attr_expand_i(na, newsize, holes);
6749 * @newsize: new size (in bytes) to which to resize the attribute
6752 * Change the size of an open ntfs attribute @na to @newsize bytes. If the
6767 static int ntfs_attr_truncate_i(ntfs_attr *na, const s64 newsize,
6774 if (!na || newsize < 0 ||
6783 (long long)newsize);
6785 if (na->data_size == newsize) {
6827 if (compressed && newsize && (newsize > na->data_size))
6831 fullsize = newsize;
6838 ret = ntfs_resident_attr_resize_i(na, newsize, holes);
6848 int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize)
6852 r = ntfs_attr_truncate_i(na, newsize, HOLES_OK);
6862 int ntfs_attr_truncate_solid(ntfs_attr *na, const s64 newsize)
6864 return (ntfs_attr_truncate_i(na, newsize, HOLES_NO));