cfg80211: Fix array-bounds warning in fragment copy
[linux/fpc-iii.git] / fs / xfs / xfs_refcount_item.h
blob5b74dddfa64be728f74e7dd1f731983c1523ad1a
1 /*
2 * Copyright (C) 2016 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it would be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __XFS_REFCOUNT_ITEM_H__
21 #define __XFS_REFCOUNT_ITEM_H__
24 * There are (currently) two pairs of refcount btree redo item types:
25 * increase and decrease. The log items for these are CUI (refcount
26 * update intent) and CUD (refcount update done). The redo item type
27 * is encoded in the flags field of each xfs_map_extent.
29 * *I items should be recorded in the *first* of a series of rolled
30 * transactions, and the *D items should be recorded in the same
31 * transaction that records the associated refcountbt updates.
33 * Should the system crash after the commit of the first transaction
34 * but before the commit of the final transaction in a series, log
35 * recovery will use the redo information recorded by the intent items
36 * to replay the refcountbt metadata updates.
39 /* kernel only CUI/CUD definitions */
41 struct xfs_mount;
42 struct kmem_zone;
45 * Max number of extents in fast allocation path.
47 #define XFS_CUI_MAX_FAST_EXTENTS 16
50 * Define CUI flag bits. Manipulated by set/clear/test_bit operators.
52 #define XFS_CUI_RECOVERED 1
55 * This is the "refcount update intent" log item. It is used to log
56 * the fact that some reverse mappings need to change. It is used in
57 * conjunction with the "refcount update done" log item described
58 * below.
60 * These log items follow the same rules as struct xfs_efi_log_item;
61 * see the comments about that structure (in xfs_extfree_item.h) for
62 * more details.
64 struct xfs_cui_log_item {
65 struct xfs_log_item cui_item;
66 atomic_t cui_refcount;
67 atomic_t cui_next_extent;
68 unsigned long cui_flags; /* misc flags */
69 struct xfs_cui_log_format cui_format;
72 static inline size_t
73 xfs_cui_log_item_sizeof(
74 unsigned int nr)
76 return offsetof(struct xfs_cui_log_item, cui_format) +
77 xfs_cui_log_format_sizeof(nr);
81 * This is the "refcount update done" log item. It is used to log the
82 * fact that some refcountbt updates mentioned in an earlier cui item
83 * have been performed.
85 struct xfs_cud_log_item {
86 struct xfs_log_item cud_item;
87 struct xfs_cui_log_item *cud_cuip;
88 struct xfs_cud_log_format cud_format;
91 extern struct kmem_zone *xfs_cui_zone;
92 extern struct kmem_zone *xfs_cud_zone;
94 struct xfs_cui_log_item *xfs_cui_init(struct xfs_mount *, uint);
95 struct xfs_cud_log_item *xfs_cud_init(struct xfs_mount *,
96 struct xfs_cui_log_item *);
97 void xfs_cui_item_free(struct xfs_cui_log_item *);
98 void xfs_cui_release(struct xfs_cui_log_item *);
99 int xfs_cui_recover(struct xfs_mount *mp, struct xfs_cui_log_item *cuip);
101 #endif /* __XFS_REFCOUNT_ITEM_H__ */