2
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
2
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
4
4
* This program is free software; you can redistribute it and/or modify it
5
5
* under the terms of version 2 of the GNU General Public License as
6
6
* published by the Free Software Foundation.
8
8
* This program is distributed in the hope that it would be useful, but
9
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
12
* Further, this software is distributed without any warranty that it is
13
13
* free of the rightful claim of any third person regarding infringement
14
* or the like. Any license provided herein, whether implied or
14
* or the like. Any license provided herein, whether implied or
15
15
* otherwise, applies only to this software file. Patent licenses, if
16
16
* any, provided herein do not apply to combinations of this program with
17
17
* other software, or any other product whatsoever.
19
19
* You should have received a copy of the GNU General Public License along
20
20
* with this program; if not, write the Free Software Foundation, Inc., 59
21
21
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
23
23
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
24
* Mountain View, CA 94043, or:
28
* For further information regarding this notice, see:
28
* For further information regarding this notice, see:
30
30
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
45
45
* with its li_desc field.
47
47
xfs_log_item_desc_t *
48
xfs_trans_add_item(xfs_trans_t *tp, xfs_log_item_t *lip)
50
52
xfs_log_item_desc_t *lidp;
51
53
xfs_log_item_chunk_t *licp;
137
139
* Free the given descriptor.
139
141
* This requires setting the bit in the chunk's free mask corresponding
140
142
* to the given slot.
143
xfs_trans_free_item(xfs_trans_t *tp, xfs_log_item_desc_t *lidp)
147
xfs_log_item_desc_t *lidp)
146
150
xfs_log_item_chunk_t *licp;
158
162
* the chunk. First pull it from the chunk list and then
159
163
* free it back to the heap. We didn't bother with a doubly
160
164
* linked list here because the lists should be very short
161
* and this is not a performance path. It's better to save
165
* and this is not a performance path. It's better to save
162
166
* the memory of the extra pointer.
164
168
* Also decrement the transaction structure's count of free items
180
184
* This is called to find the descriptor corresponding to the given
181
185
* log item. It returns a pointer to the descriptor.
182
186
* The log item MUST have a corresponding descriptor in the given
183
* transaction. This routine does not return NULL, it panics.
187
* transaction. This routine does not return NULL, it panics.
185
189
* The descriptor pointer is kept in the log item's li_desc field.
186
190
* Just return it.
188
192
xfs_log_item_desc_t *
189
xfs_trans_find_item(xfs_trans_t *tp, xfs_log_item_t *lip)
191
197
ASSERT(lip->li_desc != NULL);
294
300
(XFS_BUF_ADDR(bp) == blkno) &&
295
301
(XFS_BUF_COUNT(bp) == len)) {
297
* We found it. Break out and
303
* We found it. Break out and
298
304
* return the pointer to the buffer.
376
382
(XFS_BUF_ADDR(bp) == blkno) &&
377
383
(XFS_BUF_COUNT(bp) == len)) {
379
* We found it. Break out and
385
* We found it. Break out and
380
386
* return the pointer to the buffer.
417
423
* Check to see if there is already a buf log item for
418
* this buffer. If there is, it is guaranteed to be
424
* this buffer. If there is, it is guaranteed to be
419
425
* the first. If we do already have one, there is
420
426
* nothing to do here so return.