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;
2154 * @base_ni: [IN] open base inode if allocating an extent mft record or NULL
2159 * If @base_ni is NULL make the mft record a base mft record, i.e. a file or
2165 * If @base_ni is not NULL make the allocated mft record an extent record,
2167 * the allocated and opened ntfs inode to the base inode @base_ni. In this
2180 * optimize this we start scanning at the place specified by @base_ni or if
2181 * @base_ni is NULL we start where we last stopped and we perform wrap around
2241 ntfs_inode *base_ni, MFT_RECORD **mrec)
2257 if (base_ni) {
2260 (long long)base_ni->mft_no);
2261 /* @mode and @base_ni are mutually exclusive. */
2266 /* @mode and @base_ni are mutually exclusive. */
2267 BUG_ON(base_ni);
2276 bit = ntfs_mft_bitmap_find_and_alloc_free_rec_nolock(vol, base_ni);
2575 if (base_ni) {
2583 m->base_mft_record = MK_LE_MREF(base_ni->mft_no,
2584 base_ni->seq_no);
2587 * attach it to the base inode @base_ni and map, pin, and lock
2590 m_tmp = map_extent_mft_record(base_ni, bit, &ni);
2727 base_ni ? "extent " : "", (long long)bit);
2778 ntfs_inode *base_ni;
2788 base_ni = ni->ext.base_ntfs_ino;
2791 BUG_ON(base_ni->nr_extents <= 0);
2794 mft_no, base_ni->mft_no);
2796 mutex_lock(&base_ni->extent_lock);
2801 "not freeing.", base_ni->mft_no);
2802 mutex_unlock(&base_ni->extent_lock);
2807 extent_nis = base_ni->ext.extent_ntfs_inos;
2809 for (i = 0; i < base_ni->nr_extents; i++) {
2813 base_ni->nr_extents--;
2814 memmove(extent_nis, extent_nis + 1, (base_ni->nr_extents - i) *
2820 mutex_unlock(&base_ni->extent_lock);
2825 base_ni->mft_no);
2879 mutex_lock(&base_ni->extent_lock);
2880 extent_nis = base_ni->ext.extent_ntfs_inos;
2881 if (!(base_ni->nr_extents & 3)) {
2882 int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode*);
2888 mutex_unlock(&base_ni->extent_lock);
2892 if (base_ni->nr_extents) {
2893 BUG_ON(!base_ni->ext.extent_ntfs_inos);
2894 memcpy(extent_nis, base_ni->ext.extent_ntfs_inos,
2896 kfree(base_ni->ext.extent_ntfs_inos);
2898 base_ni->ext.extent_ntfs_inos = extent_nis;
2902 extent_nis[base_ni->nr_extents++] = ni;
2903 mutex_unlock(&base_ni->extent_lock);