diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-03 19:25:58 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-03 19:25:58 -0500 |
| commit | 0f3278d14f0255e4cd9e07ccefc33ff12d8bb59c (patch) | |
| tree | 9bbb209cab841f700162a96e158dfa3ecd361f46 /fs/xfs/xfs_ialloc.h | |
| parent | 06024f217d607369f0ee0071034ebb03071d5fb2 (diff) | |
| parent | 15c84a470116b2a3b58a7353a6cf711c29a91854 (diff) | |
Merge git://oss.sgi.com:8090/oss/git/xfs-2.6
Diffstat (limited to 'fs/xfs/xfs_ialloc.h')
| -rw-r--r-- | fs/xfs/xfs_ialloc.h | 76 |
1 files changed, 23 insertions, 53 deletions
diff --git a/fs/xfs/xfs_ialloc.h b/fs/xfs/xfs_ialloc.h index db6d0015cecf..7f5debe1acb6 100644 --- a/fs/xfs/xfs_ialloc.h +++ b/fs/xfs/xfs_ialloc.h | |||
| @@ -1,33 +1,19 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2000,2005 Silicon Graphics, Inc. |
| 3 | * All Rights Reserved. | ||
| 3 | * | 4 | * |
| 4 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or |
| 5 | * under the terms of version 2 of the GNU General Public License as | 6 | * modify it under the terms of the GNU General Public License as |
| 6 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
| 7 | * | 8 | * |
| 8 | * This program is distributed in the hope that it would be useful, but | 9 | * This program is distributed in the hope that it would be useful, |
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. | ||
| 11 | * | 13 | * |
| 12 | * Further, this software is distributed without any warranty that it is | 14 | * You should have received a copy of the GNU General Public License |
| 13 | * free of the rightful claim of any third person regarding infringement | 15 | * along with this program; if not, write the Free Software Foundation, |
| 14 | * or the like. Any license provided herein, whether implied or | 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 15 | * otherwise, applies only to this software file. Patent licenses, if | ||
| 16 | * any, provided herein do not apply to combinations of this program with | ||
| 17 | * other software, or any other product whatsoever. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License along | ||
| 20 | * with this program; if not, write the Free Software Foundation, Inc., 59 | ||
| 21 | * Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
| 22 | * | ||
| 23 | * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, | ||
| 24 | * Mountain View, CA 94043, or: | ||
| 25 | * | ||
| 26 | * http://www.sgi.com | ||
| 27 | * | ||
| 28 | * For further information regarding this notice, see: | ||
| 29 | * | ||
| 30 | * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ | ||
| 31 | */ | 17 | */ |
| 32 | #ifndef __XFS_IALLOC_H__ | 18 | #ifndef __XFS_IALLOC_H__ |
| 33 | #define __XFS_IALLOC_H__ | 19 | #define __XFS_IALLOC_H__ |
| @@ -40,18 +26,8 @@ struct xfs_trans; | |||
| 40 | /* | 26 | /* |
| 41 | * Allocation parameters for inode allocation. | 27 | * Allocation parameters for inode allocation. |
| 42 | */ | 28 | */ |
| 43 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_INODES) | 29 | #define XFS_IALLOC_INODES(mp) (mp)->m_ialloc_inos |
| 44 | int xfs_ialloc_inodes(struct xfs_mount *mp); | 30 | #define XFS_IALLOC_BLOCKS(mp) (mp)->m_ialloc_blks |
| 45 | #define XFS_IALLOC_INODES(mp) xfs_ialloc_inodes(mp) | ||
| 46 | #else | ||
| 47 | #define XFS_IALLOC_INODES(mp) ((mp)->m_ialloc_inos) | ||
| 48 | #endif | ||
| 49 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_BLOCKS) | ||
| 50 | xfs_extlen_t xfs_ialloc_blocks(struct xfs_mount *mp); | ||
| 51 | #define XFS_IALLOC_BLOCKS(mp) xfs_ialloc_blocks(mp) | ||
| 52 | #else | ||
| 53 | #define XFS_IALLOC_BLOCKS(mp) ((mp)->m_ialloc_blks) | ||
| 54 | #endif | ||
| 55 | 31 | ||
| 56 | /* | 32 | /* |
| 57 | * For small block file systems, move inodes in clusters of this size. | 33 | * For small block file systems, move inodes in clusters of this size. |
| @@ -67,31 +43,25 @@ xfs_extlen_t xfs_ialloc_blocks(struct xfs_mount *mp); | |||
| 67 | /* | 43 | /* |
| 68 | * Make an inode pointer out of the buffer/offset. | 44 | * Make an inode pointer out of the buffer/offset. |
| 69 | */ | 45 | */ |
| 70 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MAKE_IPTR) | ||
| 71 | struct xfs_dinode *xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o); | ||
| 72 | #define XFS_MAKE_IPTR(mp,b,o) xfs_make_iptr(mp,b,o) | 46 | #define XFS_MAKE_IPTR(mp,b,o) xfs_make_iptr(mp,b,o) |
| 73 | #else | 47 | static inline struct xfs_dinode * |
| 74 | #define XFS_MAKE_IPTR(mp,b,o) \ | 48 | xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o) |
| 75 | ((xfs_dinode_t *)(xfs_buf_offset(b, (o) << (mp)->m_sb.sb_inodelog))) | 49 | { |
| 76 | #endif | 50 | return (xfs_dinode_t *) |
| 51 | (xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog)); | ||
| 52 | } | ||
| 77 | 53 | ||
| 78 | /* | 54 | /* |
| 79 | * Find a free (set) bit in the inode bitmask. | 55 | * Find a free (set) bit in the inode bitmask. |
| 80 | */ | 56 | */ |
| 81 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_FIND_FREE) | ||
| 82 | int xfs_ialloc_find_free(xfs_inofree_t *fp); | ||
| 83 | #define XFS_IALLOC_FIND_FREE(fp) xfs_ialloc_find_free(fp) | 57 | #define XFS_IALLOC_FIND_FREE(fp) xfs_ialloc_find_free(fp) |
| 84 | #else | 58 | static inline int xfs_ialloc_find_free(xfs_inofree_t *fp) |
| 85 | #define XFS_IALLOC_FIND_FREE(fp) xfs_lowbit64(*(fp)) | 59 | { |
| 86 | #endif | 60 | return xfs_lowbit64(*fp); |
| 61 | } | ||
| 87 | 62 | ||
| 88 | 63 | ||
| 89 | #ifdef __KERNEL__ | 64 | #ifdef __KERNEL__ |
| 90 | |||
| 91 | /* | ||
| 92 | * Prototypes for visible xfs_ialloc.c routines. | ||
| 93 | */ | ||
| 94 | |||
| 95 | /* | 65 | /* |
| 96 | * Allocate an inode on disk. | 66 | * Allocate an inode on disk. |
| 97 | * Mode is used to tell whether the new inode will need space, and whether | 67 | * Mode is used to tell whether the new inode will need space, and whether |
