2 * debug.c - Debugging output functions. Part of the Linux-NTFS project.
4 * Copyright (c) 2002 Anton Altaparmakov
6 * This program/include file is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program/include file is distributed in the hope that it will be
12 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program (in the main directory of the Linux-NTFS
18 * distribution in the file COPYING); if not, write to the Free Software
19 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * ntfs_debug_runlist_dump - Dump a runlist.
28 void ntfs_debug_runlist_dump(const runlist_element *rl)
31 const char *lcn_str[5] = { "LCN_HOLE ", "LCN_RL_NOT_MAPPED",
32 "LCN_ENOENT ", "LCN_EINVAL ",
35 Dputs("NTFS-fs DEBUG: Dumping runlist (values in hex):");
37 Dputs("Run list not present.");
40 Dputs("VCN LCN Run length");
42 LCN lcn = (rl + i)->lcn;
47 if (index > -LCN_EINVAL - 1)
49 Dprintf("%-16Lx %s %-16Lx%s\n", rl[i].vcn,
50 lcn_str[index], rl[i].length,
51 rl[i].length ? "" : " (runlist end)");
53 Dprintf("%-16Lx %-16Lx %-16Lx%s\n", rl[i].vcn,
54 rl[i].lcn, rl[i].length,
55 rl[i].length ? "" : " (runlist end)");
56 } while (rl[i++].length);