Dave Chinner | 3ebe7d2 | 2013-06-27 16:04:53 +1000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2008-2010, Dave Chinner |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope that it would be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write the Free Software Foundation, |
| 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | */ |
| 18 | #ifndef XFS_ICREATE_ITEM_H |
| 19 | #define XFS_ICREATE_ITEM_H 1 |
| 20 | |
| 21 | /* |
| 22 | * on disk log item structure |
| 23 | * |
| 24 | * Log recovery assumes the first two entries are the type and size and they fit |
| 25 | * in 32 bits. Also in host order (ugh) so they have to be 32 bit aligned so |
| 26 | * decoding can be done correctly. |
| 27 | */ |
| 28 | struct xfs_icreate_log { |
| 29 | __uint16_t icl_type; /* type of log format structure */ |
| 30 | __uint16_t icl_size; /* size of log format structure */ |
| 31 | __be32 icl_ag; /* ag being allocated in */ |
| 32 | __be32 icl_agbno; /* start block of inode range */ |
| 33 | __be32 icl_count; /* number of inodes to initialise */ |
| 34 | __be32 icl_isize; /* size of inodes */ |
| 35 | __be32 icl_length; /* length of extent to initialise */ |
| 36 | __be32 icl_gen; /* inode generation number to use */ |
| 37 | }; |
| 38 | |
| 39 | /* in memory log item structure */ |
| 40 | struct xfs_icreate_item { |
| 41 | struct xfs_log_item ic_item; |
| 42 | struct xfs_icreate_log ic_format; |
| 43 | }; |
| 44 | |
| 45 | extern kmem_zone_t *xfs_icreate_zone; /* inode create item zone */ |
| 46 | |
| 47 | void xfs_icreate_log(struct xfs_trans *tp, xfs_agnumber_t agno, |
| 48 | xfs_agblock_t agbno, unsigned int count, |
| 49 | unsigned int inode_size, xfs_agblock_t length, |
| 50 | unsigned int generation); |
| 51 | |
| 52 | #endif /* XFS_ICREATE_ITEM_H */ |