xfs_fsmap.c (6f50fa2a6f1395ad5f59ce7b87730f1f3ea19d76) xfs_fsmap.c (e7ee96dfb8c2687a29d2c5c3b06c967fa54b839c)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2017 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 */
6#include "xfs.h"
7#include "xfs_fs.h"
8#include "xfs_shared.h"

--- 262 unchanged lines hidden (view full) ---

271
272 /*
273 * If the record starts past the last physical block we saw,
274 * then we've found a gap. Report the gap as being owned by
275 * whatever the caller specified is the missing owner.
276 */
277 if (rec_daddr > info->next_daddr) {
278 if (info->head->fmh_entries >= info->head->fmh_count)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2017 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 */
6#include "xfs.h"
7#include "xfs_fs.h"
8#include "xfs_shared.h"

--- 262 unchanged lines hidden (view full) ---

271
272 /*
273 * If the record starts past the last physical block we saw,
274 * then we've found a gap. Report the gap as being owned by
275 * whatever the caller specified is the missing owner.
276 */
277 if (rec_daddr > info->next_daddr) {
278 if (info->head->fmh_entries >= info->head->fmh_count)
279 return XFS_BTREE_QUERY_RANGE_ABORT;
279 return -ECANCELED;
280
281 fmr.fmr_device = info->dev;
282 fmr.fmr_physical = info->next_daddr;
283 fmr.fmr_owner = info->missing_owner;
284 fmr.fmr_offset = 0;
285 fmr.fmr_length = rec_daddr - info->next_daddr;
286 fmr.fmr_flags = FMR_OF_SPECIAL_OWNER;
287 error = info->formatter(&fmr, info->format_arg);
288 if (error)
289 return error;
290 info->head->fmh_entries++;
291 }
292
293 if (info->last)
294 goto out;
295
296 /* Fill out the extent we found */
297 if (info->head->fmh_entries >= info->head->fmh_count)
280
281 fmr.fmr_device = info->dev;
282 fmr.fmr_physical = info->next_daddr;
283 fmr.fmr_owner = info->missing_owner;
284 fmr.fmr_offset = 0;
285 fmr.fmr_length = rec_daddr - info->next_daddr;
286 fmr.fmr_flags = FMR_OF_SPECIAL_OWNER;
287 error = info->formatter(&fmr, info->format_arg);
288 if (error)
289 return error;
290 info->head->fmh_entries++;
291 }
292
293 if (info->last)
294 goto out;
295
296 /* Fill out the extent we found */
297 if (info->head->fmh_entries >= info->head->fmh_count)
298 return XFS_BTREE_QUERY_RANGE_ABORT;
298 return -ECANCELED;
299
300 trace_xfs_fsmap_mapping(mp, info->dev, info->agno, rec);
301
302 fmr.fmr_device = info->dev;
303 fmr.fmr_physical = rec_daddr;
304 error = xfs_fsmap_owner_from_rmap(&fmr, rec);
305 if (error)
306 return error;

--- 633 unchanged lines hidden ---
299
300 trace_xfs_fsmap_mapping(mp, info->dev, info->agno, rec);
301
302 fmr.fmr_device = info->dev;
303 fmr.fmr_physical = rec_daddr;
304 error = xfs_fsmap_owner_from_rmap(&fmr, rec);
305 if (error)
306 return error;

--- 633 unchanged lines hidden ---