xfs_mount_t *xfs_mount_init(void);
void xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
int xfs_mountfs(struct vfs *, xfs_mount_t *mp, kdev_t, int);
-int xfs_mountargs(struct mounta *, struct xfs_args *);
int xfs_unmountfs(xfs_mount_t *, int, struct cred *);
void xfs_unmountfs_close(xfs_mount_t *, int, struct cred *);
xfs_agnumber_t sagno; /* starting allocation group number */
xfs_alloctype_t type; /* input allocation type */
int bump_rotor = 0;
+ int no_min = 0;
mp = args->mp;
type = args->otype = args->type;
TRACE_ALLOC("badargs", args);
return 0;
}
+ minleft = args->minleft;
+
switch (type) {
case XFS_ALLOCTYPE_THIS_AG:
case XFS_ALLOCTYPE_NEAR_BNO:
args->agno = XFS_FSB_TO_AGNO(mp, args->fsbno);
down_read(&mp->m_peraglock);
args->pag = &mp->m_perag[args->agno];
- minleft = args->minleft;
args->minleft = 0;
error = xfs_alloc_fix_freelist(args, 0);
args->minleft = minleft;
down_read(&mp->m_peraglock);
for (;;) {
args->pag = &mp->m_perag[args->agno];
- if ((error = xfs_alloc_fix_freelist(args, flags))) {
+ if (no_min) args->minleft = 0;
+ error = xfs_alloc_fix_freelist(args, flags);
+ args->minleft = minleft;
+ if (error) {
TRACE_ALLOC("nofix", args);
goto error0;
}
* or switch to non-trylock mode.
*/
if (args->agno == sagno) {
- if (flags == 0) {
+ if (no_min == 1) {
args->agbno = NULLAGBLOCK;
TRACE_ALLOC("allfailed", args);
break;
}
- flags = 0;
- if (type == XFS_ALLOCTYPE_START_BNO) {
- args->agbno = XFS_FSB_TO_AGBNO(mp,
- args->fsbno);
- args->type = XFS_ALLOCTYPE_NEAR_BNO;
+ if (flags == 0) {
+ no_min = 1;
+ } else {
+ flags = 0;
+ if (type == XFS_ALLOCTYPE_START_BNO) {
+ args->agbno = XFS_FSB_TO_AGBNO(mp,
+ args->fsbno);
+ args->type = XFS_ALLOCTYPE_NEAR_BNO;
+ }
}
}
}