2
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
2
* Copyright (c) 2000,2005 Silicon Graphics, Inc.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of version 2 of the GNU General Public License as
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
6
7
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it would be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* Further, this software is distributed without any warranty that it is
13
* free of the rightful claim of any third person regarding infringement
14
* or the like. Any license provided herein, whether implied or
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.
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.
23
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
* Mountain View, CA 94043, or:
28
* For further information regarding this notice, see:
30
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
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.
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
32
18
#ifndef __XFS_IALLOC_H__
33
19
#define __XFS_IALLOC_H__
41
27
* Allocation parameters for inode allocation.
43
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_INODES)
44
int xfs_ialloc_inodes(struct xfs_mount *mp);
45
#define XFS_IALLOC_INODES(mp) xfs_ialloc_inodes(mp)
47
#define XFS_IALLOC_INODES(mp) ((mp)->m_ialloc_inos)
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)
53
#define XFS_IALLOC_BLOCKS(mp) ((mp)->m_ialloc_blks)
29
#define XFS_IALLOC_INODES(mp) (mp)->m_ialloc_inos
30
#define XFS_IALLOC_BLOCKS(mp) (mp)->m_ialloc_blks
57
33
* For small block file systems, move inodes in clusters of this size.
68
44
* Make an inode pointer out of the buffer/offset.
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
46
#define XFS_MAKE_IPTR(mp,b,o) xfs_make_iptr(mp,b,o)
74
#define XFS_MAKE_IPTR(mp,b,o) \
75
((xfs_dinode_t *)(xfs_buf_offset(b, (o) << (mp)->m_sb.sb_inodelog)))
47
static inline struct xfs_dinode *
48
xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o)
50
return (xfs_dinode_t *)
51
(xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog));
79
55
* Find a free (set) bit in the inode bitmask.
81
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_FIND_FREE)
82
int xfs_ialloc_find_free(xfs_inofree_t *fp);
83
57
#define XFS_IALLOC_FIND_FREE(fp) xfs_ialloc_find_free(fp)
85
#define XFS_IALLOC_FIND_FREE(fp) xfs_lowbit64(*(fp))
58
static inline int xfs_ialloc_find_free(xfs_inofree_t *fp)
60
return xfs_lowbit64(*fp);
92
* Prototypes for visible xfs_ialloc.c routines.
96
66
* Allocate an inode on disk.
97
67
* Mode is used to tell whether the new inode will need space, and whether