File: fakelibattr.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 (36 lines) | stat: -rw-r--r-- 834 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
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (c) 2024 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <djwong@kernel.org>
 */
#ifndef __LIBFROG_FAKELIBATTR_H__
#define __LIBFROG_FAKELIBATTR_H__

/* This file emulates APIs from the deprecated libattr. */

struct attrlist_cursor;

static inline struct xfs_attrlist_ent *
libfrog_attr_entry(
	struct xfs_attrlist	*list,
	unsigned int		index)
{
	char			*buffer = (char *)list;

	return (struct xfs_attrlist_ent *)&buffer[list->al_offset[index]];
}

static inline int
libfrog_attr_list_by_handle(
	void				*hanp,
	size_t				hlen,
	void				*buf,
	size_t				bufsize,
	int				flags,
	struct xfs_attrlist_cursor	*cursor)
{
	return attr_list_by_handle(hanp, hlen, buf, bufsize, flags,
			(struct attrlist_cursor *)cursor);
}

#endif /* __LIBFROG_FAKELIBATTR_H__ */