Lines Matching refs:ni

59  * @ni:		ntfs inode whose data to read into the page range
66 * Read @size bytes from the ntfs inode @ni, starting at byte offset @attr_ofs
78 * is locked for writing (@ni->lock) thus we cheat and set UPL_NESTED_PAGEOUT
106 * Locking: - Caller must hold an iocount reference on the vnode of @ni.
107 * - Caller must not hold @ni->lock or if it is held it must be for
109 * the caller must hold @ni->lock for reading or writing.
111 int ntfs_pagein(ntfs_inode *ni, s64 attr_ofs, unsigned size, upl_t upl,
123 (unsigned long long)ni->mft_no,
132 ntfs_error(ni->vol->mp, "NULL page list passed in (error "
136 if (S_ISDIR(ni->mode)) {
137 ntfs_error(ni->vol->mp, "Called for directory vnode.");
144 * caller has already taken @ni->lock for exclusive access. We simply
155 lck_rw_lock_shared(&ni->lock);
158 if (NInoDeleted(ni)) {
160 cache_purge(ni->vn);
167 * the size in the ntfs inode thus no need to check @ni->data_size.
169 attr_size = ubc_getsize(ni->vn);
177 if (ni->type != AT_INDEX_ALLOCATION) {
179 if (NInoEncrypted(ni)) {
180 if (ni->type != AT_DATA)
183 ntfs_warning(ni->vol->mp, "Denying access to "
189 if (NInoNonResident(ni) && NInoCompressed(ni) && !NInoRaw(ni)) {
190 if (ni->type != AT_DATA)
197 if (NInoNonResident(ni)) {
201 if (NInoMstProtected(ni) || NInoEncrypted(ni))
204 err = cluster_pagein_ext(ni->vn, upl, upl_ofs, attr_ofs, size,
209 ntfs_error(ni->vol->mp, "Failed (cluster_pagein_ext(), "
212 lck_rw_unlock_shared(&ni->lock);
249 ntfs_error(ni->vol->mp, "ubc_upl_map() failed (error %d).",
254 if (!NInoNonResident(ni)) {
259 err = ntfs_resident_attr_read(ni, attr_ofs, size,
262 ntfs_error(ni->vol->mp, "ntfs_resident_attr_read() "
273 err = ntfs_raw_inode_get(ni, LCK_RW_TYPE_SHARED, &raw_ni);
275 ntfs_error(ni->vol->mp, "Failed to get raw inode "
282 if (vnode_isnocache(ni->vn) ||
285 if (vnode_isnoreadahead(ni->vn) ||
288 err = ntfs_read_compressed(ni, raw_ni, attr_ofs, size,
291 ntfs_error(ni->vol->mp,
300 ntfs_error(ni->vol->mp, "ubc_upl_unmap() failed (error %d).",
311 ntfs_debug("Done (%s).", !NInoNonResident(ni) ?
333 ntfs_error(ni->vol->mp, "Failed (error %d).", err);
336 lck_rw_unlock_shared(&ni->lock);
342 * @ni: ntfs inode of which to map a page
343 * @ofs: byte offset into @ni of which to map a page
350 * Map the page corresponding to byte offset @ofs into the ntfs inode @ni into
364 * Locking: - Caller must hold an iocount reference on the vnode of @ni.
365 * - Caller must hold @ni->lock for reading or writing.
369 errno_t ntfs_page_map_ext(ntfs_inode *ni, s64 ofs, upl_t *upl,
379 (unsigned long long)ni->mft_no,
385 lck_spin_lock(&ni->size_lock);
386 size = ubc_getsize(ni->vn);
387 if (size > ni->data_size)
388 size = ni->data_size;
389 lck_spin_unlock(&ni->size_lock);
391 ntfs_error(ni->vol->mp, "Offset 0x%llx is outside the end of "
399 kerr = ubc_create_upl(ni->vn, ofs, PAGE_SIZE, upl, pl, UPL_SET_LITE |
409 * have the inode locked (@ni->lock is held by the caller).
413 err = ntfs_pagein(ni, ofs, PAGE_SIZE, *upl, 0, UPL_IOSYNC |
416 ntfs_error(ni->vol->mp, "Failed to read page (error "
427 ntfs_error(ni->vol->mp, "Failed to map page (error %d).",
433 (vnode_isnocache(ni->vn) && !upl_dirty_page(*pl, 0)))
443 * @ni: ntfs inode to which the page belongs
448 * Unmap the page belonging to the ntfs inode @ni from memory releasing it back
457 * Locking: Caller must hold an iocount reference on the vnode of @ni.
459 void ntfs_page_unmap(ntfs_inode *ni, upl_t upl, upl_page_info_array_t pl,
469 (unsigned long long)ni->mft_no,
477 ntfs_warning(ni->vol->mp, "ubc_upl_unmap() failed (error %d).",
490 if (was_dirty || mark_dirty || !vnode_isnocache(ni->vn)) {
510 * @ni: ntfs inode to which the page belongs
514 * Unmap the page belonging to the ntfs inode @ni from memory throwing it away.
521 * Locking: Caller must hold an iocount reference on the vnode of @ni.
523 void ntfs_page_dump(ntfs_inode *ni, upl_t upl,
529 (unsigned long long)ni->mft_no,
535 ntfs_warning(ni->vol->mp, "ubc_upl_unmap() failed (error %d).",