]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
merge over kernel changes
authorSteve Lord <lord@sgi.com>
Fri, 14 Jun 2002 18:29:38 +0000 (18:29 +0000)
committerSteve Lord <lord@sgi.com>
Fri, 14 Jun 2002 18:29:38 +0000 (18:29 +0000)
include/xfs_mount.h
libxfs/xfs_alloc.c

index 27edd2cf0cac040699a822082d5f2094e59be3a6..31f2e37b0a7cfd0a0f85e754a20c10d8a2403804 100644 (file)
@@ -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 *);
index 36f108dff3f2b3dd26647946c366f23baaf029fa..0492e830ff074fc39cca182d6476a92b4058437b 100644 (file)
@@ -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;
+                                       }
                                }
                        }
                }