Lines Matching refs:iag
50 /* iag free list lock */
55 /* per ag iag list locks */
65 static int diAllocBit(struct inomap *, struct iag *, int);
69 static int diNewExt(struct inomap *, struct iag *, int);
146 /* allocate and init iag free list lock */
276 * for regular inodes, the iag describing the disk inode
298 struct iag *iagp;
312 /* determine the iag number for this inode (number) */
315 /* read the iag */
325 iagp = (struct iag *) mp->data;
342 /* get the ag for the iag */
813 * free inode within the iag, the iag will be placed on
819 * up the inode extent will be freed. in addition, the iag
821 * is the first free extent in the iag. if freeing the
823 * the iag, the iag will also be removed from the ag free
826 * the iag describing the inode will be freed if the extent
828 * the iag. in this case, the iag will be removed from the
830 * the inode map's free iag list.
848 struct iag *iagp, *aiagp, *biagp, *ciagp, *diagp;
867 /* get the iag number containing the inode.
871 /* make sure that the iag is contained within
895 /* read the iag.
902 iagp = (struct iag *) mp->data;
905 * the iag and the inode number within the extent.
944 /* if the iag currently has no free inodes (i.e.,
945 * the inode being freed is the first free inode of iag),
946 * insert the iag at head of the inode free list for the ag.
951 * we can link the current iag onto the list at
955 /* read the iag that currently is the head
964 aiagp = (struct iag *) amp->data;
966 /* make current head point back to the iag.
973 /* iag points forward to current head and iag
999 /* update the free inode counts at the iag, ag and
1010 /* write the iag */
1023 * prepare to update iag list(s) (careful update step 1)
1028 /* check if the iag currently has no free extents. if so,
1033 * if so, read the iag at the head of the list now.
1034 * this (head) iag will be updated later to reflect
1035 * the addition of the current iag at the head of
1041 aiagp = (struct iag *) amp->data;
1044 /* iag has free extents. check if the addition of a free
1046 * iag. if so, the iag will be removed from the ag extent
1047 * free list and placed on the inode map's free iag list.
1050 /* in preparation for removing the iag from the
1052 * and following the iag on the ag extent free
1058 aiagp = (struct iag *) amp->data;
1064 biagp = (struct iag *) bmp->data;
1069 /* remove the iag from the ag inode free list if freeing
1070 * this extent cause the iag to have no free inodes.
1076 /* in preparation for removing the iag from the
1078 * and following the iag on the ag inode free
1081 * from up above, since re-reading an iag (buffer)
1087 ciagp = (struct iag *) amp->data;
1089 ciagp = (struct iag *) bmp->data;
1094 ciagp = (struct iag *) cmp->data;
1101 diagp = (struct iag *) amp->data;
1103 diagp = (struct iag *) bmp->data;
1108 diagp = (struct iag *) dmp->data;
1123 * update iag list(s) (careful update step 2)
1125 /* add the iag to the ag extent free list if this is the
1126 * first free extent for the iag.
1137 /* remove the iag from the ag extent list if all extents
1138 * are now free and place it on the inode map iag free list.
1159 /* remove the iag from the ag inode free list if freeing
1160 * this extent causes the iag to have no free inodes.
1199 * for the iag.
1225 * N.B. AG_LOCK is released and iag will be released below, and
1233 /* acquire tlock of the iag page of the freed ixad
1235 * logged from the iag page) until NOREDOPAGE|FREEXTENT log
1295 diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp)
1330 struct iag *iagp;
1351 * the same iag containing the parent disk inode:
1356 * file system and the iag.
1359 /* get the ag number of this iag */
1379 /* back off the hint if it is outside of the iag */
1389 /* get the iag number and read the iag */
1396 iagp = (struct iag *) mp->data;
1398 /* determine if new inode extent is allowed to be added to the iag.
1399 * new inode extent can be added to the iag if the ag
1400 * has less than 32 free disk inodes and the iag has free extents.
1407 /* check if the inode may be allocated from the iag
1435 * and write the iag.
1508 * iag and allocate the inode from the
1518 * and write the iag.
1557 * and write the iag.
1582 /* nothing doing in this iag, so release it. */
1749 * allocation occurs from the first iag on the list using
1750 * the iag's free inode summary map to find the leftmost
1751 * free inode in the iag.
1771 struct iag *iagp;
1781 /* read the iag at the head of the list.
1787 iagp = (struct iag *) mp->data;
1789 /* better be free inodes in this iag if it is on the
1795 jfs_error(ip->i_sb, "nfreeinos = 0, but iag on freelist\n");
1837 /* compute the inode number within the iag.
1850 /* set the results of the allocation and write the iag.
1862 * FUNCTION: add a new extent of free inodes to an iag, allocating
1866 * this routine first tries to find an existing iag with free
1870 * empty), a new iag will be allocated for the ag to contain
1873 * once an iag has been selected, the free extent summary map
1874 * is used to locate a free extent within the iag and diNewExt()
1895 struct iag *iagp;
1898 * allocate a new iag for the ag.
1907 iagp = (struct iag *) mp->data;
1909 /* set the ag number if this a brand new iag
1914 /* read the iag.
1919 jfs_error(ip->i_sb, "error reading iag\n");
1922 iagp = (struct iag *) mp->data;
1954 /* something bad happened. if a new iag was allocated,
1955 * place it back on the inode map's iag free list, and
1968 /* set the results of the allocation and write the iag.
1981 * FUNCTION: allocate a backed inode from an iag.
1987 * inode within the iag, the iag will be removed from the
2000 * iagp - pointer to iag.
2001 * ino - inode number to be allocated within the iag.
2008 static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
2012 struct iag *aiagp = NULL, *biagp = NULL;
2015 /* check if this is the last free inode within the iag.
2026 aiagp = (struct iag *) amp->data;
2038 biagp = (struct iag *) bmp->data;
2063 jfs_error(imap->im_ipimap->i_sb, "iag inconsistent\n");
2081 /* if this was the last free inode in the iag, remove the
2082 * iag from the ag free inode list.
2100 /* update the free inode count at the iag, ag, inode
2114 * FUNCTION: initialize a new extent of inodes for an iag, allocating
2124 * if the iag is new, it is not yet on an ag extent free list
2127 * if the allocation of the new extent causes the iag to
2128 * have no free extent, the iag will be removed from the
2131 * if the iag has no free backed inodes, it will be placed
2146 * iagp - pointer to iag.
2154 static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
2157 struct iag *aiagp = NULL, *biagp = NULL, *ciagp = NULL;
2181 /* get the ag and iag numbers for this iag.
2190 * iag. if so, the iag must be removed from the ag
2192 * following the iag on this list.
2198 aiagp = (struct iag *) amp->data;
2204 biagp = (struct iag *) bmp->data;
2207 /* the iag has free extents. if all extents are free
2208 * (as is the case for a newly allocated iag), the iag
2210 * the iag at the head of the list in preparation for
2211 * adding this iag to this list.
2218 aiagp = (struct iag *) amp->data;
2223 /* check if the iag has no free inodes. if so, the iag
2225 * the iag at the head of the list in preparation for
2226 * adding this iag to this list. in doing this, we must
2227 * check if we already have the iag at the head of
2241 ciagp = (struct iag *) cmp->data;
2296 /* if this is the last free extent within the iag, remove the
2297 * iag from the ag free extent list.
2311 /* if the iag has all free extents (newly allocated iag),
2312 * add the iag to the ag free extent list.
2324 /* if the iag has no free inodes, add the iag to the
2358 * iag.
2402 * FUNCTION: allocate a new iag for an allocation group.
2404 * first tries to allocate the iag from the inode map
2408 * if the inode map's iag free list is empty, the inode map
2409 * is extended to hold a new iag. this new iag is initialized
2414 * iagnop - pointer to an iag number set with the number of the
2415 * newly allocated iag upon successful return.
2429 * note: new iag transaction:
2430 * . synchronously write iag;
2434 * . at start of logredo(): init in-memory imap with one additional iag page;
2447 struct iag *iagp;
2458 /* acquire the free iag lock */
2461 /* if there are any iags on the inode map free iag list,
2462 * allocate the iag from the head of the list.
2465 /* pick up the iag number at the head of the list */
2468 /* determine the logical block number of the iag */
2472 * to include a new iag.
2487 /* get the next available iag number */
2502 * synchronously append new iag page.
2504 /* determine the logical address of iag page to append */
2507 /* Allocate extent for new iag page */
2518 * addressing structure pointing to the new iag page;
2528 /* Free the blocks allocated for the iag since it was
2563 iagp = (struct iag *) mp->data;
2565 /* init the iag */
2566 memset(iagp, 0, sizeof(struct iag));
2598 /* update the next available iag number */
2601 /* Add the iag to the iag free list so we don't lose the iag
2618 /* read the iag */
2624 iagp = (struct iag *) mp->data;
2626 /* remove the iag from the iag free list */
2630 /* set the return iag number and buffer pointer */
2635 /* release the iag free lock */
2644 * FUNCTION: get the buffer for the specified iag within a fileset
2649 * iagno - iag number.
2667 /* compute the logical block number of the iag. */
2670 /* read the iag. */
2728 struct iag *iagp;
2738 /* get the iag number containing the inode */
2740 /* make sure that the iag is contained within the map */
2742 jfs_error(ipimap->i_sb, "the iag is outside the map\n");
2745 /* read the iag */
2752 iagp = (struct iag *) mp->data;
2754 * the iag and the inode number within the extent.
2805 * update iag lsn
2850 struct iag *iagp = NULL, *hiagp = NULL;
2878 * process each iag page of the map.
2887 iagp = (struct iag *) bp->data;
2894 /* leave free iag in the free iag list */
2923 hiagp = (struct iag *) hbp->data;
2949 hiagp = (struct iag *) hbp->data;