2 * debug.c - Debugging output functions. Originated from the Linux-NTFS project.
4 * Copyright (c) 2002-2004 Anton Altaparmakov
5 * Copyright (c) 2004-2006 Szabolcs Szakacsits
7 * This program/include file is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program/include file is distributed in the hope that it will be
13 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program (in the main directory of the NTFS-3G
19 * distribution in the file COPYING); if not, write to the Free Software
20 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 * ntfs_debug_runlist_dump - Dump a runlist.
45 void ntfs_debug_runlist_dump(const runlist_element
*rl
)
48 const char *lcn_str
[5] = { "LCN_HOLE ", "LCN_RL_NOT_MAPPED",
49 "LCN_ENOENT ", "LCN_EINVAL ",
52 ntfs_log_debug("NTFS-fs DEBUG: Dumping runlist (values in hex):\n");
54 ntfs_log_debug("Run list not present.\n");
57 ntfs_log_debug("VCN LCN Run length\n");
59 LCN lcn
= (rl
+ i
)->lcn
;
64 if (idx
> -LCN_EINVAL
- 1)
66 ntfs_log_debug("%-16lld %s %-16lld%s\n",
67 (long long)rl
[i
].vcn
, lcn_str
[idx
],
68 (long long)rl
[i
].length
,
69 rl
[i
].length
? "" : " (runlist end)");
71 ntfs_log_debug("%-16lld %-16lld %-16lld%s\n",
72 (long long)rl
[i
].vcn
, (long long)rl
[i
].lcn
,
73 (long long)rl
[i
].length
,
74 rl
[i
].length
? "" : " (runlist end)");
75 } while (rl
[i
++].length
);