Lines Matching defs:ni

58 	struct ntfs_inode *ni = ntfs_i(inode);
67 if (is_compressed(ni))
70 if (is_encrypted(ni))
85 struct ntfs_inode *ni = ntfs_i(inode);
102 if (!is_dedup(ni) && !is_encrypted(ni) &&
148 struct ntfs_inode *ni = ntfs_i(inode);
151 stat->btime = ni->i_crtime;
152 stat->blksize = ni->mi.sbi->cluster_size; /* 512, 1K, ..., 2M */
160 if (is_compressed(ni))
163 if (is_encrypted(ni))
175 struct ntfs_inode *ni,
179 struct inode *inode = &ni->vfs_inode;
185 if (is_resident(ni)) {
186 ni->i_valid = new_valid;
190 WARN_ON(is_compressed(ni));
199 if (is_sparsed(ni)) {
203 err = attr_data_get_block(ni, vcn, 1, &lcn, &clen, NULL,
210 ni->i_valid = pos;
243 ni->i_valid = valid;
333 struct ntfs_inode *ni = ntfs_i(inode);
341 if (is_encrypted(ni)) {
346 if (is_dedup(ni)) {
351 if (is_compressed(ni) && rw) {
360 if (is_sparsed(ni)) {
369 err = attr_data_get_block(ni, vcn, 1, &lcn,
376 if (ni->i_valid < to) {
378 err = ntfs_extend_initialized_size(file, ni,
379 ni->i_valid, to);
394 struct ntfs_inode *ni = ntfs_i(inode);
397 bool extend_init = file && pos > ni->i_valid;
404 ntfs_set_state(ni->mi.sbi, NTFS_DIRTY_DIRTY);
412 if (extend_init && !is_compressed(ni)) {
413 err = ntfs_extend_initialized_size(file, ni, ni->i_valid, pos);
420 if (file && is_sparsed(ni)) {
425 struct ntfs_sb_info *sbi = ni->mi.sbi;
428 CLST cend_v = bytes_to_cluster(sbi, ni->i_valid);
440 err = attr_data_get_block(ni, vcn, cend_v - vcn, &lcn,
449 err = attr_data_get_block(ni, vcn, cend - vcn, &lcn,
480 struct ntfs_inode *ni = ntfs_i(inode);
487 if (is_compressed(ni)) {
488 if (ni->i_valid > new_size)
489 ni->i_valid = new_size;
497 new_valid = ntfs_up_block(sb, min_t(u64, ni->i_valid, new_size));
501 ni_lock(ni);
503 down_write(&ni->file.run_lock);
504 err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run, new_size,
505 &new_valid, ni->mi.sbi->options->prealloc, NULL);
506 up_write(&ni->file.run_lock);
508 if (new_valid < ni->i_valid)
509 ni->i_valid = new_valid;
511 ni_unlock(ni);
513 ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
546 struct ntfs_inode *ni = ntfs_i(inode);
550 bool is_supported_holes = is_sparsed(ni) || is_compressed(ni);
585 if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
609 ni_lock(ni);
610 err = attr_punch_hole(ni, vbo, len, &frame_size);
611 ni_unlock(ni);
639 ni_lock(ni);
640 err = attr_punch_hole(ni, vbo_a, end_a - vbo_a, NULL);
641 ni_unlock(ni);
664 ni_lock(ni);
665 err = attr_collapse_range(ni, vbo, len);
666 ni_unlock(ni);
682 ni_lock(ni);
683 err = attr_insert_range(ni, vbo, len);
684 ni_unlock(ni);
692 if (is_resident(ni)) {
693 ni_lock(ni);
694 err = attr_force_nonresident(ni);
695 ni_unlock(ni);
728 CLST cend_v = bytes_to_cluster(sbi, ni->i_valid);
740 err = attr_data_get_block(ni, vcn, cend_v - vcn,
750 err = attr_data_get_block(ni, vcn, cend - vcn,
759 ni_lock(ni);
761 err = attr_set_size(ni, ATTR_DATA, NULL, 0,
762 &ni->file.run, i_size, &ni->i_valid,
764 ni_unlock(ni);
797 struct ntfs_inode *ni = ntfs_i(inode);
812 if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
829 ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
842 ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
844 ni->std_fa |= FILE_ATTRIBUTE_READONLY;
860 struct ntfs_inode *ni = ntfs_i(inode);
865 if (is_encrypted(ni)) {
871 if (ni->ni_flags & NI_FLAG_COMPRESSED_MASK) {
879 if (is_dedup(ni)) {
894 struct ntfs_inode *ni = ntfs_i(inode);
901 if (is_compressed(ni) && (iocb->ki_flags & IOCB_DIRECT)) {
977 struct ntfs_inode *ni = ntfs_i(inode);
978 u64 valid = ni->i_valid;
979 struct ntfs_sb_info *sbi = ni->mi.sbi;
1020 err = attr_data_get_block(ni, frame << NTFS_LZNT_CUNIT, 1, &lcn,
1026 ni->i_valid = valid =
1039 err = ni_read_frame(ni, frame_vbo, pages,
1060 ni_lock(ni);
1061 err = ni_write_frame(ni, pages, pages_per_frame);
1062 ni_unlock(ni);
1074 ni->i_valid = valid = frame_vbo + frame_size;
1104 err = ni_read_frame(ni, frame_vbo, pages,
1145 ni_lock(ni);
1146 err = ni_write_frame(ni, pages, pages_per_frame);
1147 ni_unlock(ni);
1180 if (iocb->ki_pos > ni->i_valid)
1181 ni->i_valid = iocb->ki_pos;
1194 struct ntfs_inode *ni = ntfs_i(inode);
1199 if (is_encrypted(ni)) {
1204 if (is_dedup(ni)) {
1219 struct ntfs_inode *ni = ntfs_i(inode);
1227 if (is_compressed(ni) && (iocb->ki_flags & IOCB_DIRECT)) {
1248 if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
1258 ret = is_compressed(ni) ? ntfs_compress_write(iocb, from) :
1275 struct ntfs_inode *ni = ntfs_i(inode);
1280 if (unlikely((is_compressed(ni) || is_encrypted(ni)) &&
1286 if ((ni->ni_flags & NI_FLAG_COMPRESSED_MASK) &&
1289 int err = ni_decompress_file(ni);
1309 struct ntfs_inode *ni = ntfs_i(inode);
1310 struct ntfs_sb_info *sbi = ni->mi.sbi;
1319 * init_rwsem(&ni->file.run_lock) is not called explicitly is MFT.
1324 ni_lock(ni);
1325 down_write(&ni->file.run_lock);
1327 err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run,
1328 i_size_read(inode), &ni->i_valid, false,
1331 up_write(&ni->file.run_lock);
1332 ni_unlock(ni);
1344 struct ntfs_inode *ni = ntfs_i(inode);
1350 ni_lock(ni);
1352 err = ni_fiemap(ni, fieinfo, start, len);
1354 ni_unlock(ni);