File: getparents.h

package info (click to toggle)
xfsprogs 6.17.0-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 11,324 kB
  • sloc: ansic: 167,334; sh: 4,604; makefile: 1,336; python: 835; cpp: 5
file content (42 lines) | stat: -rw-r--r-- 1,317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2023-2024 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <djwong@kernel.org>
 */
#ifndef	__LIBFROG_GETPARENTS_H_
#define	__LIBFROG_GETPARENTS_H_

struct path_list;

struct parent_rec {
	/* File handle to parent directory */
	struct xfs_handle	p_handle;

	/* Null-terminated directory entry name in the parent */
	char			*p_name;

	/* Flags for this record; see PARENTREC_* below */
	uint32_t		p_flags;
};

/* This is the root directory. */
#define PARENTREC_FILE_IS_ROOT	(1U << 0)

typedef int (*walk_parent_fn)(const struct parent_rec *rec, void *arg);

int fd_walk_parents(int fd, size_t ioctl_bufsize, walk_parent_fn fn, void *arg);
int handle_walk_parents(const void *hanp, size_t hanlen, size_t ioctl_bufsize,
		walk_parent_fn fn, void *arg);

typedef int (*walk_path_fn)(const char *mntpt, const struct path_list *path,
		void *arg);

int fd_walk_paths(int fd, size_t ioctl_bufsize, walk_path_fn fn, void *arg);
int handle_walk_paths(const void *hanp, size_t hanlen, size_t ioctl_bufsize,
		walk_path_fn fn, void *arg);

int fd_to_path(int fd, size_t ioctl_bufsize, char *path, size_t pathlen);
int handle_to_path(const void *hanp, size_t hlen, size_t ioctl_bufsize,
		char *path, size_t pathlen);

#endif /* __LIBFROG_GETPARENTS_H_ */