xfs_attr_item.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* SPDX-License-Identifier: GPL-2.0-or-later
  2. *
  3. * Copyright (C) 2022 Oracle. All Rights Reserved.
  4. * Author: Allison Henderson <allison.henderson@oracle.com>
  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 new_name; /* PPTR_REPLACE only */
  14. struct xfs_log_iovec value;
  15. struct xfs_log_iovec new_value; /* PPTR_REPLACE only */
  16. refcount_t refcount;
  17. /* name and value follow the end of this struct */
  18. };
  19. /*
  20. * This is the "attr intention" log item. It is used to log the fact that some
  21. * extended attribute operations need to be processed. An operation is
  22. * currently either a set or remove. Set or remove operations are described by
  23. * the xfs_attr_intent which may be logged to this intent.
  24. *
  25. * During a normal attr operation, name and value point to the name and value
  26. * fields of the caller's xfs_da_args structure. During a recovery, the name
  27. * and value buffers are copied from the log, and stored in a trailing buffer
  28. * attached to the xfs_attr_intent until they are committed. They are freed
  29. * when the xfs_attr_intent itself is freed when the work is done.
  30. */
  31. struct xfs_attri_log_item {
  32. struct xfs_log_item attri_item;
  33. atomic_t attri_refcount;
  34. struct xfs_attri_log_nameval *attri_nameval;
  35. struct xfs_attri_log_format attri_format;
  36. };
  37. /*
  38. * This is the "attr done" log item. It is used to log the fact that some attrs
  39. * earlier mentioned in an attri item have been freed.
  40. */
  41. struct xfs_attrd_log_item {
  42. struct xfs_log_item attrd_item;
  43. struct xfs_attri_log_item *attrd_attrip;
  44. struct xfs_attrd_log_format attrd_format;
  45. };
  46. extern struct kmem_cache *xfs_attri_cache;
  47. extern struct kmem_cache *xfs_attrd_cache;
  48. enum xfs_attr_defer_op {
  49. XFS_ATTR_DEFER_SET,
  50. XFS_ATTR_DEFER_REMOVE,
  51. XFS_ATTR_DEFER_REPLACE,
  52. };
  53. void xfs_attr_defer_add(struct xfs_da_args *args, enum xfs_attr_defer_op op);
  54. #endif /* __XFS_ATTR_ITEM_H__ */