~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/xfs/xfs_extfree_item.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 /*
  3  * Copyright (c) 2000,2005 Silicon Graphics, Inc.
  4  * All Rights Reserved.
  5  */
  6 #ifndef __XFS_EXTFREE_ITEM_H__
  7 #define __XFS_EXTFREE_ITEM_H__
  8 
  9 /* kernel only EFI/EFD definitions */
 10 
 11 struct xfs_mount;
 12 struct kmem_cache;
 13 
 14 /*
 15  * Max number of extents in fast allocation path.
 16  */
 17 #define XFS_EFI_MAX_FAST_EXTENTS        16
 18 
 19 /*
 20  * This is the "extent free intention" log item.  It is used to log the fact
 21  * that some extents need to be free.  It is used in conjunction with the
 22  * "extent free done" log item described below.
 23  *
 24  * The EFI is reference counted so that it is not freed prior to both the EFI
 25  * and EFD being committed and unpinned. This ensures the EFI is inserted into
 26  * the AIL even in the event of out of order EFI/EFD processing. In other words,
 27  * an EFI is born with two references:
 28  *
 29  *      1.) an EFI held reference to track EFI AIL insertion
 30  *      2.) an EFD held reference to track EFD commit
 31  *
 32  * On allocation, both references are the responsibility of the caller. Once the
 33  * EFI is added to and dirtied in a transaction, ownership of reference one
 34  * transfers to the transaction. The reference is dropped once the EFI is
 35  * inserted to the AIL or in the event of failure along the way (e.g., commit
 36  * failure, log I/O error, etc.). Note that the caller remains responsible for
 37  * the EFD reference under all circumstances to this point. The caller has no
 38  * means to detect failure once the transaction is committed, however.
 39  * Therefore, an EFD is required after this point, even in the event of
 40  * unrelated failure.
 41  *
 42  * Once an EFD is allocated and dirtied in a transaction, reference two
 43  * transfers to the transaction. The EFD reference is dropped once it reaches
 44  * the unpin handler. Similar to the EFI, the reference also drops in the event
 45  * of commit failure or log I/O errors. Note that the EFD is not inserted in the
 46  * AIL, so at this point both the EFI and EFD are freed.
 47  */
 48 struct xfs_efi_log_item {
 49         struct xfs_log_item     efi_item;
 50         atomic_t                efi_refcount;
 51         atomic_t                efi_next_extent;
 52         xfs_efi_log_format_t    efi_format;
 53 };
 54 
 55 static inline size_t
 56 xfs_efi_log_item_sizeof(
 57         unsigned int            nr)
 58 {
 59         return offsetof(struct xfs_efi_log_item, efi_format) +
 60                         xfs_efi_log_format_sizeof(nr);
 61 }
 62 
 63 /*
 64  * This is the "extent free done" log item.  It is used to log
 65  * the fact that some extents earlier mentioned in an efi item
 66  * have been freed.
 67  */
 68 struct xfs_efd_log_item {
 69         struct xfs_log_item     efd_item;
 70         struct xfs_efi_log_item *efd_efip;
 71         uint                    efd_next_extent;
 72         xfs_efd_log_format_t    efd_format;
 73 };
 74 
 75 static inline size_t
 76 xfs_efd_log_item_sizeof(
 77         unsigned int            nr)
 78 {
 79         return offsetof(struct xfs_efd_log_item, efd_format) +
 80                         xfs_efd_log_format_sizeof(nr);
 81 }
 82 
 83 /*
 84  * Max number of extents in fast allocation path.
 85  */
 86 #define XFS_EFD_MAX_FAST_EXTENTS        16
 87 
 88 extern struct kmem_cache        *xfs_efi_cache;
 89 extern struct kmem_cache        *xfs_efd_cache;
 90 
 91 struct xfs_extent_free_item;
 92 
 93 void xfs_extent_free_defer_add(struct xfs_trans *tp,
 94                 struct xfs_extent_free_item *xefi,
 95                 struct xfs_defer_pending **dfpp);
 96 
 97 #endif  /* __XFS_EXTFREE_ITEM_H__ */
 98 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php