Lines Matching refs:base_ni
224 * @base_ni: base ntfs inode
228 * Load the extent mft record @mref and attach it to its base inode @base_ni.
235 MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
247 mft_no, base_ni->mft_no);
249 atomic_inc(&base_ni->count);
255 mutex_lock(&base_ni->extent_lock);
256 if (base_ni->nr_extents > 0) {
257 extent_nis = base_ni->ext.extent_ntfs_inos;
258 for (i = 0; i < base_ni->nr_extents; i++) {
268 mutex_unlock(&base_ni->extent_lock);
269 atomic_dec(&base_ni->count);
282 ntfs_error(base_ni->vol->sb, "Found stale extent mft "
288 ntfs_error(base_ni->vol->sb, "Failed to map extent "
293 ni = ntfs_new_extent_inode(base_ni->vol->sb, mft_no);
295 mutex_unlock(&base_ni->extent_lock);
296 atomic_dec(&base_ni->count);
299 ni->vol = base_ni->vol;
302 ni->ext.base_ntfs_ino = base_ni;
306 mutex_unlock(&base_ni->extent_lock);
307 atomic_dec(&base_ni->count);
313 ntfs_error(base_ni->vol->sb, "Found stale extent mft "
320 if (!(base_ni->nr_extents & 3)) {
322 int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode *);
326 ntfs_error(base_ni->vol->sb, "Failed to allocate "
332 if (base_ni->nr_extents) {
333 BUG_ON(!base_ni->ext.extent_ntfs_inos);
334 memcpy(tmp, base_ni->ext.extent_ntfs_inos, new_size -
336 kfree(base_ni->ext.extent_ntfs_inos);
338 base_ni->ext.extent_ntfs_inos = tmp;
340 base_ni->ext.extent_ntfs_inos[base_ni->nr_extents++] = ni;
341 mutex_unlock(&base_ni->extent_lock);
342 atomic_dec(&base_ni->count);
348 mutex_unlock(&base_ni->extent_lock);
349 atomic_dec(&base_ni->count);
386 ntfs_inode *base_ni;
394 base_ni = ni;
396 base_ni = ni->ext.base_ntfs_ino;
398 __mark_inode_dirty(VFS_I(base_ni), I_DIRTY_DATASYNC);
1110 * @base_ni: open base inode if allocating an extent mft record or NULL
1115 * If @base_ni is NULL start the search at the default allocator position.
1117 * If @base_ni is not NULL start the search at the mft record after the base
1118 * mft record @base_ni.
1127 ntfs_inode *base_ni)
1154 if (!base_ni)
1157 data_pos = base_ni->mft_no + 1;
2152 * @base_ni: [IN] open base inode if allocating an extent mft record or NULL
2157 * If @base_ni is NULL make the mft record a base mft record, i.e. a file or
2163 * If @base_ni is not NULL make the allocated mft record an extent record,
2165 * the allocated and opened ntfs inode to the base inode @base_ni. In this
2178 * optimize this we start scanning at the place specified by @base_ni or if
2179 * @base_ni is NULL we start where we last stopped and we perform wrap around
2239 ntfs_inode *base_ni, MFT_RECORD **mrec)
2255 if (base_ni) {
2258 (long long)base_ni->mft_no);
2259 /* @mode and @base_ni are mutually exclusive. */
2264 /* @mode and @base_ni are mutually exclusive. */
2265 BUG_ON(base_ni);
2274 bit = ntfs_mft_bitmap_find_and_alloc_free_rec_nolock(vol, base_ni);
2573 if (base_ni) {
2581 m->base_mft_record = MK_LE_MREF(base_ni->mft_no,
2582 base_ni->seq_no);
2585 * attach it to the base inode @base_ni and map, pin, and lock
2588 m_tmp = map_extent_mft_record(base_ni, bit, &ni);
2726 base_ni ? "extent " : "", (long long)bit);
2777 ntfs_inode *base_ni;
2787 base_ni = ni->ext.base_ntfs_ino;
2790 BUG_ON(base_ni->nr_extents <= 0);
2793 mft_no, base_ni->mft_no);
2795 mutex_lock(&base_ni->extent_lock);
2800 "not freeing.", base_ni->mft_no);
2801 mutex_unlock(&base_ni->extent_lock);
2806 extent_nis = base_ni->ext.extent_ntfs_inos;
2808 for (i = 0; i < base_ni->nr_extents; i++) {
2812 base_ni->nr_extents--;
2813 memmove(extent_nis, extent_nis + 1, (base_ni->nr_extents - i) *
2819 mutex_unlock(&base_ni->extent_lock);
2824 base_ni->mft_no);
2878 mutex_lock(&base_ni->extent_lock);
2879 extent_nis = base_ni->ext.extent_ntfs_inos;
2880 if (!(base_ni->nr_extents & 3)) {
2881 int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode*);
2887 mutex_unlock(&base_ni->extent_lock);
2891 if (base_ni->nr_extents) {
2892 BUG_ON(!base_ni->ext.extent_ntfs_inos);
2893 memcpy(extent_nis, base_ni->ext.extent_ntfs_inos,
2895 kfree(base_ni->ext.extent_ntfs_inos);
2897 base_ni->ext.extent_ntfs_inos = extent_nis;
2901 extent_nis[base_ni->nr_extents++] = ni;
2902 mutex_unlock(&base_ni->extent_lock);