From: Steve Lord Date: Fri, 14 Jun 2002 18:29:38 +0000 (+0000) Subject: merge over kernel changes X-Git-Tag: v2.1.0~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9baa549bea2e0ee4f3ce2f515c57e6c81ad6e855;p=thirdparty%2Fxfsprogs-dev.git merge over kernel changes --- diff --git a/include/xfs_mount.h b/include/xfs_mount.h index 27edd2cf0..31f2e37b0 100644 --- a/include/xfs_mount.h +++ b/include/xfs_mount.h @@ -469,7 +469,6 @@ void xfs_mod_sb(xfs_trans_t *, __int64_t); 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 *); diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index 36f108dff..0492e830f 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -2191,6 +2191,7 @@ xfs_alloc_vextent( 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; @@ -2218,6 +2219,8 @@ xfs_alloc_vextent( TRACE_ALLOC("badargs", args); return 0; } + minleft = args->minleft; + switch (type) { case XFS_ALLOCTYPE_THIS_AG: case XFS_ALLOCTYPE_NEAR_BNO: @@ -2228,7 +2231,6 @@ xfs_alloc_vextent( 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; @@ -2296,7 +2298,10 @@ xfs_alloc_vextent( 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; } @@ -2322,16 +2327,20 @@ xfs_alloc_vextent( * 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; + } } } }