linux/fs/xfs/scrub/listxattr.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2022-2024 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <[email protected]>
 */
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
#include "xfs_inode.h"
#include "xfs_da_format.h"
#include "xfs_da_btree.h"
#include "xfs_attr.h"
#include "xfs_attr_leaf.h"
#include "xfs_attr_sf.h"
#include "xfs_trans.h"
#include "scrub/scrub.h"
#include "scrub/bitmap.h"
#include "scrub/dab_bitmap.h"
#include "scrub/listxattr.h"

/* Call a function for every entry in a shortform xattr structure. */
STATIC int
xchk_xattr_walk_sf(
	struct xfs_scrub		*sc,
	struct xfs_inode		*ip,
	xchk_xattr_fn			attr_fn,
	void				*priv)
{}

/* Call a function for every entry in this xattr leaf block. */
STATIC int
xchk_xattr_walk_leaf_entries(
	struct xfs_scrub		*sc,
	struct xfs_inode		*ip,
	xchk_xattr_fn			attr_fn,
	struct xfs_buf			*bp,
	void				*priv)
{}

/*
 * Call a function for every entry in a leaf-format xattr structure.  Avoid
 * memory allocations for the loop detector since there's only one block.
 */
STATIC int
xchk_xattr_walk_leaf(
	struct xfs_scrub		*sc,
	struct xfs_inode		*ip,
	xchk_xattr_fn			attr_fn,
	void				*priv)
{}

/* Find the leftmost leaf in the xattr dabtree. */
STATIC int
xchk_xattr_find_leftmost_leaf(
	struct xfs_scrub		*sc,
	struct xfs_inode		*ip,
	struct xdab_bitmap		*seen_dablks,
	struct xfs_buf			**leaf_bpp)
{}

/* Call a function for every entry in a node-format xattr structure. */
STATIC int
xchk_xattr_walk_node(
	struct xfs_scrub		*sc,
	struct xfs_inode		*ip,
	xchk_xattr_fn			attr_fn,
	xchk_xattrleaf_fn		leaf_fn,
	void				*priv)
{}

/*
 * Call a function for every extended attribute in a file.
 *
 * Callers must hold the ILOCK.  No validation or cursor restarts allowed.
 * Returns -EFSCORRUPTED on any problem, including loops in the dabtree.
 */
int
xchk_xattr_walk(
	struct xfs_scrub	*sc,
	struct xfs_inode	*ip,
	xchk_xattr_fn		attr_fn,
	xchk_xattrleaf_fn	leaf_fn,
	void			*priv)
{}