1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2001-2003,2005 Silicon Graphics, Inc.
12 static cmdinfo_t imap_cmd
;
15 imap_f(int argc
, char **argv
)
22 xfs_fsop_bulkreq_t bulkreq
;
29 t
= malloc(nent
* sizeof(*t
));
33 bulkreq
.lastip
= &last
;
34 bulkreq
.icount
= nent
;
35 bulkreq
.ubuffer
= (void *)t
;
36 bulkreq
.ocount
= &count
;
38 while (xfsctl(file
->name
, file
->fd
, XFS_IOC_FSINUMBERS
, &bulkreq
) == 0) {
41 for (i
= 0; i
< count
; i
++) {
42 printf(_("ino %10llu count %2d mask %016llx\n"),
43 (unsigned long long)t
[i
].xi_startino
,
45 (unsigned long long)t
[i
].xi_allocmask
);
48 perror("xfsctl(XFS_IOC_FSINUMBERS)");
58 imap_cmd
.name
= "imap";
59 imap_cmd
.cfunc
= imap_f
;
62 imap_cmd
.args
= _("[nentries]");
63 imap_cmd
.flags
= CMD_NOMAP_OK
| CMD_FLAG_ONESHOT
;
64 imap_cmd
.oneline
= _("inode map for filesystem of current file");
67 add_command(&imap_cmd
);