Hi,

Read message '[Jfs-patches] [PATCH] cleanup dbAlloc' on this list today and
read about preparation for quota support. Any idea when quota support will
be supported ?

Thanks,
Bas.

----- Original Message -----
From: "Christoph Hellwig" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 3:09 PM
Subject: [Jfs-patches] [PATCH] cleanup dbAlloc


> Reduces number of return pathes to two.  This is a preparation
> for quota support.
>
>
> Index: fs/jfs/jfs_dmap.c
> ===================================================================
> RCS file: /usr/cvs/jfs/linux24/fs/jfs/jfs_dmap.c,v
> retrieving revision 1.15
> diff -u -u -r1.15 jfs_dmap.c
> --- fs/jfs/jfs_dmap.c 3 Apr 2002 20:49:54 -0000 1.15
> +++ fs/jfs/jfs_dmap.c 10 Apr 2002 13:03:13 -0000
> @@ -780,8 +780,7 @@
>   nblocks);
>   }
>
> - IWRITE_UNLOCK(ipbmap);
> - return (rc);
> + goto write_unlock;
>   }
>
>   /* we would like to allocate close to the hint.  adjust the
> @@ -827,12 +826,12 @@
>
>   /* get the buffer for the dmap containing the hint.
>   */
> + rc = EIO;
>   lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
>   mp = read_metapage(ipbmap, lblkno, PSIZE, 0);
> - if (mp == NULL) {
> - IREAD_UNLOCK(ipbmap);
> - return (EIO);
> - }
> + if (mp == NULL)
> + goto read_unlock;
> +
>   dp = (dmap_t *) mp->data;
>
>   /* first, try to satisfy the allocation request with the
> @@ -845,14 +844,11 @@
>   *results = blkno;
>   DBALLOC(bmp->db_DBmap, bmp->db_mapsize,
>   *results, nblocks);
> - write_metapage(mp);
> - } else {
> - assert(rc == EIO);
> - release_metapage(mp);
> + mark_metapage_dirty(mp);
>   }
>
> - IREAD_UNLOCK(ipbmap);
> - return (rc);
> + release_metapage(mp);
> + goto read_unlock;
>   }
>
>   /* next, try to satisfy the allocation request with blocks
> @@ -867,10 +863,9 @@
>   *results, nblocks);
>   mark_metapage_dirty(mp);
>   }
> - release_metapage(mp);
>
> - IREAD_UNLOCK(ipbmap);
> - return (rc);
> + release_metapage(mp);
> + goto read_unlock;
>   }
>
>   /* try to satisfy the allocation request with blocks within
> @@ -884,10 +879,9 @@
>   *results, nblocks);
>   mark_metapage_dirty(mp);
>   }
> - release_metapage(mp);
>
> - IREAD_UNLOCK(ipbmap);
> - return (rc);
> + release_metapage(mp);
> + goto read_unlock;
>   }
>
>   release_metapage(mp);
> @@ -908,7 +902,13 @@
>   DBALLOC(bmp->db_DBmap, bmp->db_mapsize, *results, nblocks);
>   }
>
> +      write_unlock:
>   IWRITE_UNLOCK(ipbmap);
> +
> + return (rc);
> +
> +      read_unlock:
> + IREAD_UNLOCK(ipbmap);
>
>   return (rc);
>  }
> _______________________________________________
> Jfs-patches mailing list
> [EMAIL PROTECTED]
> http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-patches
>
>

_______________________________________________
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion

Reply via email to