xfs_attr_item.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0-or-later
  2. *
  3. * Copyright (C) 2022 Oracle. All Rights Reserved.
  4. * Author: Allison Henderson <[email protected]>
  5. */
  6. #ifndef __XFS_ATTR_ITEM_H__
  7. #define __XFS_ATTR_ITEM_H__
  8. /* kernel only ATTRI/ATTRD definitions */
  9. struct xfs_mount;
  10. struct kmem_zone;
  11. struct xfs_attri_log_nameval {
  12. struct xfs_log_iovec name;
  13. struct xfs_log_iovec value;
  14. refcount_t refcount;
  15. /* name and value follow the end of this struct */
  16. };
  17. /*
  18. * This is the "attr intention" log item. It is used to log the fact that some
  19. * extended attribute operations need to be processed. An operation is
  20. * currently either a set or remove. Set or remove operations are described by
  21. * the xfs_attr_intent which may be logged to this intent.
  22. *
  23. * During a normal attr operation, name and value point to the name and value
  24. * fields of the caller's xfs_da_args structure. During a recovery, the name
  25. * and value buffers are copied from the log, and stored in a trailing buffer
  26. * attached to the xfs_attr_intent until they are committed. They are freed
  27. * when the xfs_attr_intent itself is freed when the work is done.
  28. */
  29. struct xfs_attri_log_item {
  30. struct xfs_log_item attri_item;
  31. atomic_t attri_refcount;
  32. struct xfs_attri_log_nameval *attri_nameval;
  33. struct xfs_attri_log_format attri_format;
  34. };
  35. /*
  36. * This is the "attr done" log item. It is used to log the fact that some attrs
  37. * earlier mentioned in an attri item have been freed.
  38. */
  39. struct xfs_attrd_log_item {
  40. struct xfs_log_item attrd_item;
  41. struct xfs_attri_log_item *attrd_attrip;
  42. struct xfs_attrd_log_format attrd_format;
  43. };
  44. extern struct kmem_cache *xfs_attri_cache;
  45. extern struct kmem_cache *xfs_attrd_cache;
  46. #endif /* __XFS_ATTR_ITEM_H__ */