[Libguestfs] [PATCH] ffind API to retrieve a file name given its inode
Matteo Cafasso
noxdafox at gmail.com
Sun Mar 20 17:11:06 UTC 2016
The ffind API allows to retrieve a file name from a device given its inode.
The function returns a struct "tsknode" which contains the file name, its inode and it's allocation status. The struct will be employed by other APIs as well (fls, ifind etc..).
$ ./run guestfish --ro -a /home/noxdafox/disks/ubuntu.qcow2
><fs> run
><fs> ffind /dev/sda1 2
tsk_name: /
tsk_inode: 2
tsk_allocated: 1
><fs> ffind /dev/sda1 3
tsk_name: /usr/bin/
tsk_inode: 3
tsk_allocated: 0
/usr/bin/ has been reallocated to node 786577
><fs> mount /dev/sda1 /
><fs> stat /usr/bin/
dev: 2049
ino: 786577
...
Matteo Cafasso (1):
added ffind API
daemon/tsk.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++
generator/actions.ml | 18 ++++++++++++++++
generator/structs.ml | 14 ++++++++++--
src/MAX_PROC_NR | 2 +-
4 files changed, 91 insertions(+), 3 deletions(-)
--
2.7.0
More information about the Libguestfs
mailing list