···55 *66 * This program is free software; you can redistribute it and/or modify77 * it under the terms of the GNU General Public License as published by88- * the Free Software Foundation; either version 2 of the License, or 88+ * the Free Software Foundation; either version 2 of the License, or99 * (at your option) any later version.1010- * 1010+ *1111 * This program is distributed in the hope that it will be useful,1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of1313 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1414 * the GNU General Public License for more details.1515 *1616 * You should have received a copy of the GNU General Public License1717- * along with this program; if not, write to the Free Software 1717+ * along with this program; if not, write to the Free Software1818 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919 */2020···183183 posix_acl_release(acl);184184 } else185185 inode->i_mode &= ~current->fs->umask;186186-186186+187187 JFS_IP(inode)->mode2 = (JFS_IP(inode)->mode2 & 0xffff0000) |188188 inode->i_mode;189189
+1-1
fs/jfs/endian24.h
···11/*22- * Copyright (c) International Business Machines Corp., 200122+ * Copyright (C) International Business Machines Corp., 200133 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by
+4-4
fs/jfs/file.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919···108108 .aio_read = generic_file_aio_read,109109 .aio_write = generic_file_aio_write,110110 .mmap = generic_file_mmap,111111- .sendfile = generic_file_sendfile,111111+ .sendfile = generic_file_sendfile,112112 .fsync = jfs_fsync,113113 .release = jfs_release,114114 .ioctl = jfs_ioctl,
+4-4
fs/jfs/inode.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919···33333434void jfs_read_inode(struct inode *inode)3535{3636- if (diRead(inode)) { 3636+ if (diRead(inode)) {3737 make_bad_inode(inode);3838 return;3939 }
+4-4
fs/jfs/jfs_acl.h
···11/*22- * Copyright (c) International Business Machines Corp., 200222+ * Copyright (C) International Business Machines Corp., 200233 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_ACL
+3-3
fs/jfs/jfs_btree.h
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_BTREE
+3-3
fs/jfs/jfs_debug.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919
+4-4
fs/jfs/jfs_dinode.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200122+ * Copyright (C) International Business Machines Corp., 2000-200133 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_DINODE
+91-91
fs/jfs/jfs_dmap.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818···3030 *3131 * the working state of the block allocation map is accessed in3232 * two directions:3333- * 3333+ *3434 * 1) allocation and free requests that start at the dmap3535 * level and move up through the dmap control pages (i.e.3636 * the vast majority of requests).3737- * 3838- * 2) allocation requests that start at dmap control page3939- * level and work down towards the dmaps.4040- * 4141- * the serialization scheme used here is as follows. 4237 *4343- * requests which start at the bottom are serialized against each 4444- * other through buffers and each requests holds onto its buffers 4545- * as it works it way up from a single dmap to the required level 3838+ * 2) allocation requests that start at dmap control page3939+ * level and work down towards the dmaps.4040+ *4141+ * the serialization scheme used here is as follows.4242+ *4343+ * requests which start at the bottom are serialized against each4444+ * other through buffers and each requests holds onto its buffers4545+ * as it works it way up from a single dmap to the required level4646 * of dmap control page.4747 * requests that start at the top are serialized against each other4848 * and request that start from the bottom by the multiple read/single4949 * write inode lock of the bmap inode. requests starting at the top5050 * take this lock in write mode while request starting at the bottom5151 * take the lock in read mode. a single top-down request may proceed5252- * exclusively while multiple bottoms-up requests may proceed 5353- * simultaneously (under the protection of busy buffers).5454- * 5252+ * exclusively while multiple bottoms-up requests may proceed5353+ * simultaneously (under the protection of busy buffers).5454+ *5555 * in addition to information found in dmaps and dmap control pages,5656 * the working state of the block allocation map also includes read/5757 * write information maintained in the bmap descriptor (i.e. total···5959 * a single exclusive lock (BMAP_LOCK) is used to guard this information6060 * in the face of multiple-bottoms up requests.6161 * (lock ordering: IREAD_LOCK, BMAP_LOCK);6262- * 6262+ *6363 * accesses to the persistent state of the block allocation map (limited6464 * to the persistent bitmaps in dmaps) is guarded by (busy) buffers.6565 */···120120/*121121 * buddy table122122 *123123- * table used for determining buddy sizes within characters of 123123+ * table used for determining buddy sizes within characters of124124 * dmap bitmap words. the characters themselves serve as indexes125125 * into the table, with the table elements yielding the maximum126126 * binary buddy of free bits within the character.···146146147147148148/*149149- * NAME: dbMount()149149+ * NAME: dbMount()150150 *151151 * FUNCTION: initializate the block allocation map.152152 *···223223224224225225/*226226- * NAME: dbUnmount()226226+ * NAME: dbUnmount()227227 *228228 * FUNCTION: terminate the block allocation map in preparation for229229 * file system unmount.230230 *231231- * the in-core bmap descriptor is written to disk and231231+ * the in-core bmap descriptor is written to disk and232232 * the memory for this descriptor is freed.233233 *234234 * PARAMETERS:···311311312312313313/*314314- * NAME: dbFree()314314+ * NAME: dbFree()315315 *316316 * FUNCTION: free the specified block range from the working block317317 * allocation map.···397397 *398398 * FUNCTION: update the allocation state (free or allocate) of the399399 * specified block range in the persistent block allocation map.400400- * 400400+ *401401 * the blocks will be updated in the persistent map one402402 * dmap at a time.403403 *···475475 /* update the bits of the dmap words. the first and last476476 * words may only have a subset of their bits updated. if477477 * this is the case, we'll work against that word (i.e.478478- * partial first and/or last) only in a single pass. a 478478+ * partial first and/or last) only in a single pass. a479479 * single pass will also be used to update all words that480480 * are to have all their bits updated.481481 */···662662 * the block allocation policy uses hints and a multi-step663663 * approach.664664 *665665- * for allocation requests smaller than the number of blocks665665+ * for allocation requests smaller than the number of blocks666666 * per dmap, we first try to allocate the new blocks667667 * immediately following the hint. if these blocks are not668668 * available, we try to allocate blocks near the hint. if669669- * no blocks near the hint are available, we next try to 669669+ * no blocks near the hint are available, we next try to670670 * allocate within the same dmap as contains the hint.671671 *672672 * if no blocks are available in the dmap or the allocation···713713#endif /* _STILL_TO_PORT */714714715715 /* get the log2 number of blocks to be allocated.716716- * if the number of blocks is not a log2 multiple, 716716+ * if the number of blocks is not a log2 multiple,717717 * it will be rounded up to the next log2 multiple.718718 */719719 l2nb = BLKSTOL2(nblocks);···906906 * validate extent request:907907 *908908 * note: defragfs policy:909909- * max 64 blocks will be moved. 909909+ * max 64 blocks will be moved.910910 * allocation request size must be satisfied from a single dmap.911911 */912912 if (nblocks <= 0 || nblocks > BPERDMAP || blkno >= bmp->db_mapsize) {···13331333 * or two sub-trees, depending on the allocation group size.13341334 * we search the top nodes of these subtrees left to right for13351335 * sufficient free space. if sufficient free space is found,13361336- * the subtree is searched to find the leftmost leaf that 13361336+ * the subtree is searched to find the leftmost leaf that13371337 * has free space. once we have made it to the leaf, we13381338 * move the search to the next lower level dmap control page13391339 * corresponding to this leaf. we continue down the dmap control···13981398 * that fully describes the allocation group since the allocation13991399 * group is already fully described by a dmap. in this case, we14001400 * just call dbAllocCtl() to search the dmap tree and allocate the14011401- * required space if available. 14011401+ * required space if available.14021402 *14031403 * if the allocation group is completely free, dbAllocCtl() is14041404 * also called to allocate the required space. this is done for···14501450 (1 << (L2LPERCTL - (bmp->db_agheigth << 1))) / bmp->db_agwidth;14511451 ti = bmp->db_agstart + bmp->db_agwidth * (agno & (agperlev - 1));1452145214531453- /* dmap control page trees fan-out by 4 and a single allocation 14531453+ /* dmap control page trees fan-out by 4 and a single allocation14541454 * group may be described by 1 or 2 subtrees within the ag level14551455 * dmap control page, depending upon the ag size. examine the ag's14561456 * subtrees for sufficient free space, starting with the leftmost···1633163316341634 /* starting at the specified dmap control page level and block16351635 * number, search down the dmap control levels for the starting16361636- * block number of a dmap page that contains or starts off 16361636+ * block number of a dmap page that contains or starts off16371637 * sufficient free blocks.16381638 */16391639 for (lev = level, b = *blkno; lev >= 0; lev--) {···16771677 }1678167816791679 /* adjust the block number to reflect the location within16801680- * the dmap control page (i.e. the leaf) at which free 16801680+ * the dmap control page (i.e. the leaf) at which free16811681 * space was found.16821682 */16831683 b += (((s64) leafidx) << budmin);···17001700 * NAME: dbAllocCtl()17011701 *17021702 * FUNCTION: attempt to allocate a specified number of contiguous17031703- * blocks starting within a specific dmap. 17041704- * 17031703+ * blocks starting within a specific dmap.17041704+ *17051705 * this routine is called by higher level routines that search17061706 * the dmap control pages above the actual dmaps for contiguous17071707 * free space. the result of successful searches by these17081708- * routines are the starting block numbers within dmaps, with17081708+ * routines are the starting block numbers within dmaps, with17091709 * the dmaps themselves containing the desired contiguous free17101710 * space or starting a contiguous free space of desired size17111711 * that is made up of the blocks of one or more dmaps. these···18721872 *18731873 * FUNCTION: attempt to allocate a specified number of contiguous blocks18741874 * from a specified dmap.18751875- * 18751875+ *18761876 * this routine checks if the contiguous blocks are available.18771877 * if so, nblocks of blocks are allocated; otherwise, ENOSPC is18781878 * returned.18791879 *18801880 * PARAMETERS:18811881 * mp - pointer to bmap descriptor18821882- * dp - pointer to dmap to attempt to allocate blocks from. 18821882+ * dp - pointer to dmap to attempt to allocate blocks from.18831883 * l2nb - log2 number of contiguous block desired.18841884 * nblocks - actual number of contiguous block desired.18851885 * results - on successful return, set to the starting block number···18901890 * -ENOSPC - insufficient disk resources18911891 * -EIO - i/o error18921892 *18931893- * serialization: IREAD_LOCK(ipbmap), e.g., from dbAlloc(), or 18931893+ * serialization: IREAD_LOCK(ipbmap), e.g., from dbAlloc(), or18941894 * IWRITE_LOCK(ipbmap), e.g., dbAllocCtl(), held on entry/exit;18951895 */18961896static int···2032203220332033 /* root changed. bubble the change up to the dmap control pages.20342034 * if the adjustment of the upper level control pages fails,20352035- * backout the deallocation. 20352035+ * backout the deallocation.20362036 */20372037 if ((rc = dbAdjCtl(bmp, blkno, dp->tree.stree[ROOT], 0, 0))) {20382038 word = (blkno & (BPERDMAP - 1)) >> L2DBWORD;···22452245 * words (i.e. partial first and/or last) on an individual basis22462246 * (a single pass), freeing the bits of interest by hand and updating22472247 * the leaf corresponding to the dmap word. a single pass will be used22482248- * for all dmap words fully contained within the specified range. 22482248+ * for all dmap words fully contained within the specified range.22492249 * within this pass, the bits of all fully contained dmap words will22502250 * be marked as free in a single shot and the leaves will be updated. a22512251 * single leaf may describe the free space of multiple dmap words,···22672267 */22682268 if (nb < DBWORD) {22692269 /* free (zero) the appropriate bits within this22702270- * dmap word. 22702270+ * dmap word.22712271 */22722272 dp->wmap[word] &=22732273 cpu_to_le32(~(ONES << (DBWORD - nb)···2327232723282328 BMAP_LOCK(bmp);2329232923302330- /* update the free count for the allocation group and 23302330+ /* update the free count for the allocation group and23312331 * map.23322332 */23332333 agno = blkno >> bmp->db_agl2size;···23782378 * or deallocation resulted in the root change. this range23792379 * is respresented by a single leaf of the current dmapctl23802380 * and the leaf will be updated with this value, possibly23812381- * causing a binary buddy system within the leaves to be 23812381+ * causing a binary buddy system within the leaves to be23822382 * split or joined. the update may also cause the dmapctl's23832383 * dmtree to be updated.23842384 *···25902590 }25912591 }2592259225932593- /* adjust the dmap tree to reflect the specified leaf's new 25932593+ /* adjust the dmap tree to reflect the specified leaf's new25942594 * value.25952595 */25962596 dbAdjTree(tp, leafno, newval);···26382638 /* the back split is accomplished by iteratively finding the leaf26392639 * that starts the buddy system that contains the specified leaf and26402640 * splitting that system in two. this iteration continues until26412641- * the specified leaf becomes the start of a buddy system. 26412641+ * the specified leaf becomes the start of a buddy system.26422642 *26432643 * determine maximum possible l2 size for the specified leaf.26442644 */···28532853 * NAME: dbFindLeaf()28542854 *28552855 * FUNCTION: search a dmtree_t for sufficient free blocks, returning28562856- * the index of a leaf describing the free blocks if 28562856+ * the index of a leaf describing the free blocks if28572857 * sufficient free blocks are found.28582858 *28592859 * the search starts at the top of the dmtree_t tree and···28692869 *28702870 * RETURN VALUES:28712871 * 0 - success28722872- * -ENOSPC - insufficient free blocks. 28722872+ * -ENOSPC - insufficient free blocks.28732873 */28742874static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx)28752875{···309030903091309130923092/*30933093- * NAME: dbAllocBottomUp()30933093+ * NAME: dbAllocBottomUp()30943094 *30953095 * FUNCTION: alloc the specified block range from the working block30963096 * allocation map.···32413241 BMAP_LOCK(bmp);3242324232433243 /* if this allocation group is completely free,32443244- * update the highest active allocation group number 32443244+ * update the highest active allocation group number32453245 * if this allocation group is the new max.32463246 */32473247 agno = blkno >> bmp->db_agl2size;···32733273 * NAME: dbExtendFS()32743274 *32753275 * FUNCTION: extend bmap from blkno for nblocks;32763276- * dbExtendFS() updates bmap ready for dbAllocBottomUp();32763276+ * dbExtendFS() updates bmap ready for dbAllocBottomUp();32773277 *32783278 * L232793279 * |···32843284 * d0,...,dn d0,...,dn d0,...,dn d0,...,dn d0,...,dn d0,.,dm;32853285 * L2L1L0d0,...,dnL0d0,...,dnL0d0,...,dnL1L0d0,...,dnL0d0,...,dnL0d0,..dm32863286 *32873287- * <---old---><----------------------------extend-----------------------> 32873287+ * <---old---><----------------------------extend----------------------->32883288 */32893289int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)32903290{···33303330 bmp->db_numag += ((u32) newsize % (u32) bmp->db_agsize) ? 1 : 0;3331333133323332 /*33333333- * reconfigure db_agfree[] 33333333+ * reconfigure db_agfree[]33343334 * from old AG configuration to new AG configuration;33353335 *33363336 * coalesce contiguous k (newAGSize/oldAGSize) AGs;···34913491 } /* for each dmap in a L0 */3492349234933493 /*34943494- * build current L0 page from its leaves, and 34943494+ * build current L0 page from its leaves, and34953495 * initialize corresponding parent L1 leaf34963496 */34973497 *l1leaf = dbInitDmapCtl(l0dcp, 0, ++i);···35153515 } /* for each L0 in a L1 */3516351635173517 /*35183518- * build current L1 page from its leaves, and 35183518+ * build current L1 page from its leaves, and35193519 * initialize corresponding parent L2 leaf35203520 */35213521 *l2leaf = dbInitDmapCtl(l1dcp, 1, ++j);···35703570 * finalize bmap control page35713571 */35723572//finalize:35733573- /* 35733573+ /*35743574 * compute db_agpref: preferred ag to allocate from35753575 * (the leftmost ag with average free space in it);35763576 */···3614361436153615 /*36163616 * compute db_aglevel, db_agheigth, db_width, db_agstart:36173617- * an ag is covered in aglevel dmapctl summary tree, 36183618- * at agheight level height (from leaf) with agwidth number of nodes 36193619- * each, which starts at agstart index node of the smmary tree node 36173617+ * an ag is covered in aglevel dmapctl summary tree,36183618+ * at agheight level height (from leaf) with agwidth number of nodes36193619+ * each, which starts at agstart index node of the smmary tree node36203620 * array;36213621 */36223622 bmp->db_aglevel = BMAPSZTOLEV(bmp->db_agsize);···3635363536363636/*36373637 * NAME: dbInitDmap()/ujfs_idmap_page()36383638- * 36383638+ *36393639 * FUNCTION: initialize working/persistent bitmap of the dmap page36403640 * for the specified number of blocks:36413641- * 36413641+ *36423642 * at entry, the bitmaps had been initialized as free (ZEROS);36433643- * The number of blocks will only account for the actually 36443644- * existing blocks. Blocks which don't actually exist in 36433643+ * The number of blocks will only account for the actually36443644+ * existing blocks. Blocks which don't actually exist in36453645 * the aggregate will be marked as allocated (ONES);36463646 *36473647 * PARAMETERS:···3677367736783678 /*36793679 * free the bits corresponding to the block range (ZEROS):36803680- * note: not all bits of the first and last words may be contained 36803680+ * note: not all bits of the first and last words may be contained36813681 * within the block range.36823682 */36833683 for (r = nblocks; r > 0; r -= nb, blkno += nb) {···37093709 }3710371037113711 /*37123712- * mark bits following the range to be freed (non-existing 37123712+ * mark bits following the range to be freed (non-existing37133713 * blocks) as allocated (ONES)37143714 */37153715···3741374137423742/*37433743 * NAME: dbInitDmapTree()/ujfs_complete_dmap()37443744- * 37443744+ *37453745 * FUNCTION: initialize summary tree of the specified dmap:37463746 *37473747 * at entry, bitmap of the dmap has been initialized;37483748- * 37483748+ *37493749 * PARAMETERS:37503750 * dp - dmap to complete37513751 * blkno - starting block number for this dmap···3769376937703770 /* init each leaf from corresponding wmap word:37713771 * note: leaf is set to NOFREE(-1) if all blocks of corresponding37723772- * bitmap word are allocated. 37723772+ * bitmap word are allocated.37733773 */37743774 cp = tp->stree + le32_to_cpu(tp->leafidx);37753775 for (i = 0; i < LPERDMAP; i++)···3782378237833783/*37843784 * NAME: dbInitTree()/ujfs_adjtree()37853785- * 37853785+ *37863786 * FUNCTION: initialize binary buddy summary tree of a dmap or dmapctl.37873787 *37883788- * at entry, the leaves of the tree has been initialized 37883788+ * at entry, the leaves of the tree has been initialized37893789 * from corresponding bitmap word or root of summary tree37903790 * of the child control page;37913791 * configure binary buddy system at the leaf level, then···38133813 /*38143814 * configure the leaf levevl into binary buddy system38153815 *38163816- * Try to combine buddies starting with a buddy size of 1 38173817- * (i.e. two leaves). At a buddy size of 1 two buddy leaves 38183818- * can be combined if both buddies have a maximum free of l2min; 38193819- * the combination will result in the left-most buddy leaf having 38203820- * a maximum free of l2min+1. 38213821- * After processing all buddies for a given size, process buddies 38223822- * at the next higher buddy size (i.e. current size * 2) and 38233823- * the next maximum free (current free + 1). 38243824- * This continues until the maximum possible buddy combination 38163816+ * Try to combine buddies starting with a buddy size of 138173817+ * (i.e. two leaves). At a buddy size of 1 two buddy leaves38183818+ * can be combined if both buddies have a maximum free of l2min;38193819+ * the combination will result in the left-most buddy leaf having38203820+ * a maximum free of l2min+1.38213821+ * After processing all buddies for a given size, process buddies38223822+ * at the next higher buddy size (i.e. current size * 2) and38233823+ * the next maximum free (current free + 1).38243824+ * This continues until the maximum possible buddy combination38253825 * yields maximum free.38263826 */38273827 for (l2free = dtp->budmin, bsize = 1; l2free < l2max;···38453845 * bubble summary information of leaves up the tree.38463846 *38473847 * Starting at the leaf node level, the four nodes described by38483848- * the higher level parent node are compared for a maximum free and 38493849- * this maximum becomes the value of the parent node. 38503850- * when all lower level nodes are processed in this fashion then 38513851- * move up to the next level (parent becomes a lower level node) and 38483848+ * the higher level parent node are compared for a maximum free and38493849+ * this maximum becomes the value of the parent node.38503850+ * when all lower level nodes are processed in this fashion then38513851+ * move up to the next level (parent becomes a lower level node) and38523852 * continue the process for that level.38533853 */38543854 for (child = le32_to_cpu(dtp->leafidx),···38573857 /* get index of 1st node of parent level */38583858 parent = (child - 1) >> 2;3859385938603860- /* set the value of the parent node as the maximum 38603860+ /* set the value of the parent node as the maximum38613861 * of the four nodes of the current level.38623862 */38633863 for (i = 0, cp = tp + child, cp1 = tp + parent;···38853885 dcp->budmin = L2BPERDMAP + L2LPERCTL * level;3886388638873887 /*38883888- * initialize the leaves of current level that were not covered 38893889- * by the specified input block range (i.e. the leaves have no 38883888+ * initialize the leaves of current level that were not covered38893889+ * by the specified input block range (i.e. the leaves have no38903890 * low level dmapctl or dmap).38913891 */38923892 cp = &dcp->stree[CTLLEAFIND + i];···3900390039013901/*39023902 * NAME: dbGetL2AGSize()/ujfs_getagl2size()39033903- * 39033903+ *39043904 * FUNCTION: Determine log2(allocation group size) from aggregate size39053905- * 39053905+ *39063906 * PARAMETERS:39073907 * nblocks - Number of blocks in aggregate39083908 *···3935393539363936/*39373937 * NAME: dbMapFileSizeToMapSize()39383938- * 39393939- * FUNCTION: compute number of blocks the block allocation map file 39383938+ *39393939+ * FUNCTION: compute number of blocks the block allocation map file39403940 * can cover from the map file size;39413941 *39423942 * RETURNS: Number of blocks which can be covered by this block map file;···39683968 npages = nblocks >> JFS_SBI(sb)->l2nbperpage;39693969 level = BMAPPGTOLEV(npages);3970397039713971- /* At each level, accumulate the number of dmap pages covered by 39713971+ /* At each level, accumulate the number of dmap pages covered by39723972 * the number of full child levels below it;39733973 * repeat for the last incomplete child level.39743974 */···39903990 npages--;39913991 }3992399239933993- /* convert the number of dmaps into the number of blocks 39933993+ /* convert the number of dmaps into the number of blocks39943994 * which can be covered by the dmaps;39953995 */39963996 nblocks = ndmaps << L2BPERDMAP;
+14-14
fs/jfs/jfs_dmap.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200222+ * Copyright (C) International Business Machines Corp., 2000-200233 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_DMAP···2727#define L2LPERDMAP 8 /* l2 number of leaves per dmap tree */2828#define DBWORD 32 /* # of blks covered by a map word */2929#define L2DBWORD 5 /* l2 # of blks covered by a mword */3030-#define BUDMIN L2DBWORD /* max free string in a map word */3030+#define BUDMIN L2DBWORD /* max free string in a map word */3131#define BPERDMAP (LPERDMAP * DBWORD) /* num of blks per dmap */3232#define L2BPERDMAP 13 /* l2 num of blks per dmap */3333#define CTLTREESIZE (1024+256+64+16+4+1) /* size of a dmapctl tree */···57575858#define MAXMAPSIZE MAXL2SIZE /* maximum aggregate map size */59596060-/* 6060+/*6161 * determine the maximum free string for four (lower level) nodes6262 * of the tree.6363 */···122122#define BLKTOCTL(b,s,l) \123123 (((l) == 2) ? 1 : ((l) == 1) ? BLKTOL1((b),(s)) : BLKTOL0((b),(s)))124124125125-/* 125125+/*126126 * convert aggregate map size to the zero origin dmapctl level of the127127 * top dmapctl.128128 */···192192193193/* macros for accessing fields within dmtree */194194#define dmt_nleafs t1.nleafs195195-#define dmt_l2nleafs t1.l2nleafs196196-#define dmt_leafidx t1.leafidx197197-#define dmt_height t1.height198198-#define dmt_budmin t1.budmin199199-#define dmt_stree t1.stree195195+#define dmt_l2nleafs t1.l2nleafs196196+#define dmt_leafidx t1.leafidx197197+#define dmt_height t1.height198198+#define dmt_budmin t1.budmin199199+#define dmt_stree t1.stree200200201201-/* 201201+/*202202 * on-disk aggregate disk allocation map descriptor.203203 */204204struct dbmap_disk {···237237 s64 dn_agsize; /* num of blks per alloc group */238238 signed char dn_maxfreebud; /* max free buddy system */239239}; /* - 4096 - */240240-/* 240240+/*241241 * in-memory aggregate disk allocation map descriptor.242242 */243243struct bmap {
+7-7
fs/jfs/jfs_dtree.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818···7878 *7979 * case-insensitive search:8080 *8181- * fold search key;8181+ * fold search key;8282 *8383 * case-insensitive search of B-tree:8484 * for internal entry, router key is already folded;···9393 * else9494 * return no match;9595 *9696- * serialization:9696+ * serialization:9797 * target directory inode lock is being held on entry/exit9898 * of all main directory service routines.9999 *···925925 *926926 * return: 0 - success;927927 * errno - failure;928928- * leaf page unpinned;928928+ * leaf page unpinned;929929 */930930static int dtSplitUp(tid_t tid,931931 struct inode *ip, struct dtsplit * split, struct btstack * btstack)···37673767 * across page boundary37683768 *37693769 * return: non-zero on error37703770- * 37703770+ *37713771 */37723772static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,37733773 int ri, struct component_name * key, int flag)
+5-5
fs/jfs/jfs_dtree.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200222+ * Copyright (C) International Business Machines Corp., 2000-200233 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_DTREE···8080/*8181 * leaf node entry head/only segment8282 *8383- * For legacy filesystems, name contains 13 wchars -- no index field8383+ * For legacy filesystems, name contains 13 wchars -- no index field8484 */8585struct ldtentry {8686 __le32 inumber; /* 4: 4-byte aligned */
+21-21
fs/jfs/jfs_extent.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818···125125 }126126127127 /* allocate the disk blocks for the extent. initially, extBalloc()128128- * will try to allocate disk blocks for the requested size (xlen). 128128+ * will try to allocate disk blocks for the requested size (xlen).129129 * if this fails (xlen contiguous free blocks not avaliable), it'll130130 * try to allocate a smaller number of blocks (producing a smaller131131 * extent), with this smaller number of blocks consisting of the···150150 /* determine the value of the extent flag */151151 xflag = abnr ? XAD_NOTRECORDED : 0;152152153153- /* if we can extend the hint extent to cover the current request, 153153+ /* if we can extend the hint extent to cover the current request,154154 * extend it. otherwise, insert a new extent to155155 * cover the current request.156156 */···159159 else160160 rc = xtInsert(0, ip, xflag, xoff, (int) nxlen, &nxaddr, 0);161161162162- /* if the extend or insert failed, 162162+ /* if the extend or insert failed,163163 * free the newly allocated blocks and return the error.164164 */165165 if (rc) {···235235 xoff = offsetXAD(xp);236236237237 /* if the extend page is abnr and if the request is for238238- * the extent to be allocated and recorded, 238238+ * the extent to be allocated and recorded,239239 * make the page allocated and recorded.240240 */241241 if ((xp->flag & XAD_NOTRECORDED) && !abnr) {···397397 if ((rc = xtLookupList(ip, &lxdl, &xadl, 0)))398398 return (rc);399399400400- /* check if not extent exists for the previous page. 400400+ /* check if not extent exists for the previous page.401401 * this is possible for sparse files.402402 */403403 if (xadl.nxad == 0) {···410410 */411411 xp->flag &= XAD_NOTRECORDED;412412413413- if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) { 413413+ if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) {414414 jfs_error(ip->i_sb, "extHint: corrupt xtree");415415 return -EIO;416416 }···492492 * FUNCTION: allocate disk blocks to form an extent.493493 *494494 * initially, we will try to allocate disk blocks for the495495- * requested size (nblocks). if this fails (nblocks 495495+ * requested size (nblocks). if this fails (nblocks496496 * contiguous free blocks not avaliable), we'll try to allocate497497 * a smaller number of blocks (producing a smaller extent), with498498 * this smaller number of blocks consisting of the requested···500500 * number (i.e. 16 -> 8). we'll continue to round down and501501 * retry the allocation until the number of blocks to allocate502502 * is smaller than the number of blocks per page.503503- * 503503+ *504504 * PARAMETERS:505505 * ip - the inode of the file.506506 * hint - disk block number to be used as an allocation hint.···509509 * exit, this value is set to the number of blocks actually510510 * allocated.511511 * blkno - pointer to a block address that is filled in on successful512512- * return with the starting block number of the newly 512512+ * return with the starting block number of the newly513513 * allocated block range.514514 *515515 * RETURN VALUES:···530530 /* get the number of blocks to initially attempt to allocate.531531 * we'll first try the number of blocks requested unless this532532 * number is greater than the maximum number of contiguous free533533- * blocks in the map. in that case, we'll start off with the 533533+ * blocks in the map. in that case, we'll start off with the534534 * maximum free.535535 */536536 max = (s64) 1 << bmp->db_maxfreebud;···582582 *583583 * FUNCTION: attempt to extend an extent's allocation.584584 *585585- * initially, we will try to extend the extent's allocation586586- * in place. if this fails, we'll try to move the extent587587- * to a new set of blocks. if moving the extent, we initially585585+ * Initially, we will try to extend the extent's allocation586586+ * in place. If this fails, we'll try to move the extent587587+ * to a new set of blocks. If moving the extent, we initially588588 * will try to allocate disk blocks for the requested size589589- * (nnew). if this fails (new contiguous free blocks not590590- * avaliable), we'll try to allocate a smaller number of589589+ * (newnblks). if this fails (new contiguous free blocks not590590+ * avaliable), we'll try to allocate a smaller number of591591 * blocks (producing a smaller extent), with this smaller592592 * number of blocks consisting of the requested number of593593 * blocks rounded down to the next smaller power of 2594594- * number (i.e. 16 -> 8). we'll continue to round down and594594+ * number (i.e. 16 -> 8). We'll continue to round down and595595 * retry the allocation until the number of blocks to allocate596596 * is smaller than the number of blocks per page.597597- * 597597+ *598598 * PARAMETERS:599599 * ip - the inode of the file.600600 * blkno - starting block number of the extents current allocation.···625625 return (rc);626626 }627627628628- /* in place extension not possible. 628628+ /* in place extension not possible.629629 * try to move the extent to a new set of blocks.630630 */631631 return (extBalloc(ip, blkno, newnblks, newblkno));
+4-4
fs/jfs/jfs_extent.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200122+ * Copyright (C) International Business Machines Corp., 2000-200133 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_EXTENT
+12-12
fs/jfs/jfs_filsys.h
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_FILSYS···2121/*2222 * jfs_filsys.h2323 *2424- * file system (implementation-dependent) constants 2424+ * file system (implementation-dependent) constants2525 *2626- * refer to <limits.h> for system wide implementation-dependent constants 2626+ * refer to <limits.h> for system wide implementation-dependent constants2727 */28282929/*···49495050#define JFS_DFS 0x20000000 /* DCE DFS LFS support */51515252-#define JFS_LINUX 0x10000000 /* Linux support */5252+#define JFS_LINUX 0x10000000 /* Linux support */5353/* case-sensitive name/directory support */54545555/* directory option */···5959#define JFS_COMMIT 0x00000f00 /* commit option mask */6060#define JFS_GROUPCOMMIT 0x00000100 /* group (of 1) commit */6161#define JFS_LAZYCOMMIT 0x00000200 /* lazy commit */6262-#define JFS_TMPFS 0x00000400 /* temporary file system - 6262+#define JFS_TMPFS 0x00000400 /* temporary file system -6363 * do not log/commit:6464 */6565···196196 * followed by 1st extent of map197197 */198198#define AITBL_OFF (AIMAP_OFF + (SIZE_OF_MAP_PAGE << 1))199199- /* 199199+ /*200200 * 1st extent of aggregate inode table201201 */202202#define SUPER2_OFF (AITBL_OFF + INODE_EXTENT_SIZE)···270270 */271271#define FM_CLEAN 0x00000000 /* file system is unmounted and clean */272272#define FM_MOUNT 0x00000001 /* file system is mounted cleanly */273273-#define FM_DIRTY 0x00000002 /* file system was not unmounted and clean 274274- * when mounted or 273273+#define FM_DIRTY 0x00000002 /* file system was not unmounted and clean274274+ * when mounted or275275 * commit failure occurred while being mounted:276276- * fsck() must be run to repair 276276+ * fsck() must be run to repair277277 */278278#define FM_LOGREDO 0x00000004 /* log based recovery (logredo()) failed:279279- * fsck() must be run to repair 279279+ * fsck() must be run to repair280280 */281281#define FM_EXTENDFS 0x00000008 /* file system extendfs() in progress */282282
+111-111
fs/jfs/jfs_imap.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818···9898 * FUNCTION: initialize the incore inode map control structures for9999 * a fileset or aggregate init time.100100 *101101- * the inode map's control structure (dinomap) is 101101+ * the inode map's control structure (dinomap) is102102 * brought in from disk and placed in virtual memory.103103 *104104 * PARAMETERS:···107107 * RETURN VALUES:108108 * 0 - success109109 * -ENOMEM - insufficient free virtual memory.110110- * -EIO - i/o error.110110+ * -EIO - i/o error.111111 */112112int diMount(struct inode *ipimap)113113{···191191 * RETURN VALUES:192192 * 0 - success193193 * -ENOMEM - insufficient free virtual memory.194194- * -EIO - i/o error.194194+ * -EIO - i/o error.195195 */196196int diUnmount(struct inode *ipimap, int mounterror)197197{···281281 * on entry, the specifed incore inode should itself282282 * specify the disk inode number corresponding to the283283 * incore inode (i.e. i_number should be initialized).284284- * 284284+ *285285 * this routine handles incore inode initialization for286286 * both "special" and "regular" inodes. special inodes287287 * are those required early in the mount process and···289289 * is not yet initialized. these "special" inodes are290290 * identified by a NULL inode map inode pointer and are291291 * actually initialized by a call to diReadSpecial().292292- * 292292+ *293293 * for regular inodes, the iag describing the disk inode294294 * is read from disk to determine the inode extent address295295 * for the disk inode. with the inode extent address in···302302 *303303 * RETURN VALUES:304304 * 0 - success305305- * -EIO - i/o error.305305+ * -EIO - i/o error.306306 * -ENOMEM - insufficient memory307307- * 307307+ *308308 */309309int diRead(struct inode *ip)310310{···586586 * page of the extent that contains the disk inode is587587 * read and the disk inode portion of the incore inode588588 * is copied to the disk inode.589589- * 589589+ *590590 * PARAMETERS:591591 * tid - transacation id592592 * ip - pointer to incore inode to be written to the inode extent.593593 *594594 * RETURN VALUES:595595 * 0 - success596596- * -EIO - i/o error.596596+ * -EIO - i/o error.597597 */598598int diWrite(tid_t tid, struct inode *ip)599599{···676676 * copy btree root from in-memory inode to on-disk inode677677 *678678 * (tlock is taken from inline B+-tree root in in-memory679679- * inode when the B+-tree root is updated, which is pointed 679679+ * inode when the B+-tree root is updated, which is pointed680680 * by jfs_ip->blid as well as being on tx tlock list)681681 *682682- * further processing of btree root is based on the copy 683683- * in in-memory inode, where txLog() will log from, and, 682682+ * further processing of btree root is based on the copy683683+ * in in-memory inode, where txLog() will log from, and,684684 * for xtree root, txUpdateMap() will update map and reset685685 * XAD_NEW bit;686686 */···824824 memcpy(&dp->di_DASD, &ip->i_DASD, sizeof(struct dasd));825825#endif /* _JFS_FASTDASD */826826827827- /* release the buffer holding the updated on-disk inode. 827827+ /* release the buffer holding the updated on-disk inode.828828 * the buffer will be later written by commit processing.829829 */830830 write_metapage(mp);···842842 * if the inode to be freed represents the first (only)843843 * free inode within the iag, the iag will be placed on844844 * the ag free inode list.845845- * 845845+ *846846 * freeing the inode will cause the inode extent to be847847 * freed if the inode is the only allocated inode within848848 * the extent. in this case all the disk resource backing···865865 * any updates and are held until all updates are complete.866866 *867867 * PARAMETERS:868868- * ip - inode to be freed.868868+ * ip - inode to be freed.869869 *870870 * RETURN VALUES:871871 * 0 - success872872- * -EIO - i/o error.872872+ * -EIO - i/o error.873873 */874874int diFree(struct inode *ip)875875{···898898 */899899 iagno = INOTOIAG(inum);900900901901- /* make sure that the iag is contained within 901901+ /* make sure that the iag is contained within902902 * the map.903903 */904904 if (iagno >= imap->im_nextiag) {···1013101310141014 /* update the free inode summary map for the extent if10151015 * freeing the inode means the extent will now have free10161016- * inodes (i.e., the inode being freed is the first free 10161016+ * inodes (i.e., the inode being freed is the first free10171017 * inode of extent),10181018 */10191019 if (iagp->wmap[extno] == cpu_to_le32(ONES)) {···12041204 iagp->inofreefwd = iagp->inofreeback = cpu_to_le32(-1);12051205 }1206120612071207- /* update the inode extent address and working map 12071207+ /* update the inode extent address and working map12081208 * to reflect the free extent.12091209- * the permanent map should have been updated already 12091209+ * the permanent map should have been updated already12101210 * for the inode being freed.12111211 */12121212 if (iagp->pmap[extno] != 0) {···1218121812191219 /* update the free extent and free inode summary maps12201220 * to reflect the freed extent.12211221- * the inode summary map is marked to indicate no inodes 12211221+ * the inode summary map is marked to indicate no inodes12221222 * available for the freed extent.12231223 */12241224 sword = extno >> L2EXTSPERSUM;···12551255 * start transaction to update block allocation map12561256 * for the inode extent freed;12571257 *12581258- * N.B. AG_LOCK is released and iag will be released below, and 12581258+ * N.B. AG_LOCK is released and iag will be released below, and12591259 * other thread may allocate inode from/reusing the ixad freed12601260- * BUT with new/different backing inode extent from the extent 12611261- * to be freed by the transaction; 12601260+ * BUT with new/different backing inode extent from the extent12611261+ * to be freed by the transaction;12621262 */12631263 tid = txBegin(ipimap->i_sb, COMMIT_FORCE);12641264 mutex_lock(&JFS_IP(ipimap)->commit_mutex);1265126512661266- /* acquire tlock of the iag page of the freed ixad 12661266+ /* acquire tlock of the iag page of the freed ixad12671267 * to force the page NOHOMEOK (even though no data is12681268- * logged from the iag page) until NOREDOPAGE|FREEXTENT log 12681268+ * logged from the iag page) until NOREDOPAGE|FREEXTENT log12691269 * for the free of the extent is committed;12701270 * write FREEXTENT|NOREDOPAGE log record12711271 * N.B. linelock is overlaid as freed extent descriptor;···12841284 * logredo needs the IAG number and IAG extent index in order12851285 * to ensure that the IMap is consistent. The least disruptive12861286 * way to pass these values through to the transaction manager12871287- * is in the iplist array. 12881288- * 12871287+ * is in the iplist array.12881288+ *12891289 * It's not pretty, but it works.12901290 */12911291 iplist[1] = (struct inode *) (size_t)iagno;···13401340/*13411341 * NAME: diAlloc(pip,dir,ip)13421342 *13431343- * FUNCTION: allocate a disk inode from the inode working map 13431343+ * FUNCTION: allocate a disk inode from the inode working map13441344 * for a fileset or aggregate.13451345 *13461346 * PARAMETERS:13471347- * pip - pointer to incore inode for the parent inode.13481348- * dir - 'true' if the new disk inode is for a directory.13491349- * ip - pointer to a new inode13471347+ * pip - pointer to incore inode for the parent inode.13481348+ * dir - 'true' if the new disk inode is for a directory.13491349+ * ip - pointer to a new inode13501350 *13511351 * RETURN VALUES:13521352 * 0 - success.13531353 * -ENOSPC - insufficient disk resources.13541354- * -EIO - i/o error.13541354+ * -EIO - i/o error.13551355 */13561356int diAlloc(struct inode *pip, bool dir, struct inode *ip)13571357{···13721372 JFS_IP(ip)->ipimap = ipimap;13731373 JFS_IP(ip)->fileset = FILESYSTEM_I;1374137413751375- /* for a directory, the allocation policy is to start 13751375+ /* for a directory, the allocation policy is to start13761376 * at the ag level using the preferred ag.13771377 */13781378 if (dir) {···14351435 /*14361436 * try to allocate from the IAG14371437 */14381438- /* check if the inode may be allocated from the iag 14381438+ /* check if the inode may be allocated from the iag14391439 * (i.e. the inode has free inodes or new extent can be added).14401440 */14411441 if (iagp->nfreeinos || addext) {···14901490 * hint or, if appropriate (i.e. addext is true), allocate14911491 * an extent of free inodes at or following the extent14921492 * containing the hint.14931493- * 14931493+ *14941494 * the free inode and free extent summary maps are used14951495 * here, so determine the starting summary map position14961496 * and the number of words we'll have to examine. again,···16411641 * inodes should be added for the allocation group, with16421642 * the current request satisfied from this extent. if this16431643 * is the case, an attempt will be made to do just that. if16441644- * this attempt fails or it has been determined that a new 16441644+ * this attempt fails or it has been determined that a new16451645 * extent should not be added, an attempt is made to satisfy16461646 * the request by allocating an existing (backed) free inode16471647 * from the allocation group.···16491649 * PRE CONDITION: Already have the AG lock for this AG.16501650 *16511651 * PARAMETERS:16521652- * imap - pointer to inode map control structure.16531653- * agno - allocation group to allocate from.16541654- * dir - 'true' if the new disk inode is for a directory.16551655- * ip - pointer to the new inode to be filled in on successful return16521652+ * imap - pointer to inode map control structure.16531653+ * agno - allocation group to allocate from.16541654+ * dir - 'true' if the new disk inode is for a directory.16551655+ * ip - pointer to the new inode to be filled in on successful return16561656 * with the disk inode number allocated, its extent address16571657 * and the start of the ag.16581658 *16591659 * RETURN VALUES:16601660 * 0 - success.16611661 * -ENOSPC - insufficient disk resources.16621662- * -EIO - i/o error.16621662+ * -EIO - i/o error.16631663 */16641664static int16651665diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip)16661666{16671667 int rc, addext, numfree, numinos;1668166816691669- /* get the number of free and the number of backed disk 16691669+ /* get the number of free and the number of backed disk16701670 * inodes currently within the ag.16711671 */16721672 numfree = imap->im_agctl[agno].numfree;···17191719 * specified primary group.17201720 *17211721 * PARAMETERS:17221722- * imap - pointer to inode map control structure.17231723- * agno - primary allocation group (to avoid).17241724- * dir - 'true' if the new disk inode is for a directory.17251725- * ip - pointer to a new inode to be filled in on successful return17221722+ * imap - pointer to inode map control structure.17231723+ * agno - primary allocation group (to avoid).17241724+ * dir - 'true' if the new disk inode is for a directory.17251725+ * ip - pointer to a new inode to be filled in on successful return17261726 * with the disk inode number allocated, its extent address17271727 * and the start of the ag.17281728 *17291729 * RETURN VALUES:17301730 * 0 - success.17311731 * -ENOSPC - insufficient disk resources.17321732- * -EIO - i/o error.17321732+ * -EIO - i/o error.17331733 */17341734static int17351735diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip)···17381738 int maxag = JFS_SBI(imap->im_ipimap->i_sb)->bmap->db_maxag;173917391740174017411741- /* try to allocate from the ags following agno up to 17411741+ /* try to allocate from the ags following agno up to17421742 * the maximum ag number.17431743 */17441744 for (ag = agno + 1; ag <= maxag; ag++) {···17801780 *17811781 * allocation occurs from the first iag on the list using17821782 * the iag's free inode summary map to find the leftmost17831783- * free inode in the iag. 17841784- * 17831783+ * free inode in the iag.17841784+ *17851785 * PRE CONDITION: Already have AG lock for this AG.17861786- * 17861786+ *17871787 * PARAMETERS:17881788- * imap - pointer to inode map control structure.17891789- * agno - allocation group.17901790- * ip - pointer to new inode to be filled in on successful return17881788+ * imap - pointer to inode map control structure.17891789+ * agno - allocation group.17901790+ * ip - pointer to new inode to be filled in on successful return17911791 * with the disk inode number allocated, its extent address17921792 * and the start of the ag.17931793 *17941794 * RETURN VALUES:17951795 * 0 - success.17961796 * -ENOSPC - insufficient disk resources.17971797- * -EIO - i/o error.17971797+ * -EIO - i/o error.17981798 */17991799static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)18001800{···18671867 return -EIO;18681868 }1869186918701870- /* compute the inode number within the iag. 18701870+ /* compute the inode number within the iag.18711871 */18721872 ino = (extno << L2INOSPEREXT) + rem;18731873···18921892/*18931893 * NAME: diAllocExt(imap,agno,ip)18941894 *18951895- * FUNCTION: add a new extent of free inodes to an iag, allocating18961896- * an inode from this extent to satisfy the current allocation18971897- * request.18981898- * 18951895+ * FUNCTION: add a new extent of free inodes to an iag, allocating18961896+ * an inode from this extent to satisfy the current allocation18971897+ * request.18981898+ *18991899 * this routine first tries to find an existing iag with free19001900 * extents through the ag free extent list. if list is not19011901 * empty, the head of the list will be selected as the home19021902 * of the new extent of free inodes. otherwise (the list is19031903 * empty), a new iag will be allocated for the ag to contain19041904 * the extent.19051905- * 19051905+ *19061906 * once an iag has been selected, the free extent summary map19071907 * is used to locate a free extent within the iag and diNewExt()19081908 * is called to initialize the extent, with initialization···19101910 * for the purpose of satisfying this request.19111911 *19121912 * PARAMETERS:19131913- * imap - pointer to inode map control structure.19141914- * agno - allocation group number.19151915- * ip - pointer to new inode to be filled in on successful return19131913+ * imap - pointer to inode map control structure.19141914+ * agno - allocation group number.19151915+ * ip - pointer to new inode to be filled in on successful return19161916 * with the disk inode number allocated, its extent address19171917 * and the start of the ag.19181918 *19191919 * RETURN VALUES:19201920 * 0 - success.19211921 * -ENOSPC - insufficient disk resources.19221922- * -EIO - i/o error.19221922+ * -EIO - i/o error.19231923 */19241924static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)19251925{···20122012/*20132013 * NAME: diAllocBit(imap,iagp,ino)20142014 *20152015- * FUNCTION: allocate a backed inode from an iag.20152015+ * FUNCTION: allocate a backed inode from an iag.20162016 *20172017 * this routine performs the mechanics of allocating a20182018 * specified inode from a backed extent.···20252025 * in the face of updates to multiple buffers. under this20262026 * approach, all required buffers are obtained before making20272027 * any updates and are held all are updates are complete.20282028- * 20282028+ *20292029 * PRE CONDITION: Already have buffer lock on iagp. Already have AG lock on20302030 * this AG. Must have read lock on imap inode.20312031 *20322032 * PARAMETERS:20332033- * imap - pointer to inode map control structure.20342034- * iagp - pointer to iag. 20352035- * ino - inode number to be allocated within the iag.20332033+ * imap - pointer to inode map control structure.20342034+ * iagp - pointer to iag.20352035+ * ino - inode number to be allocated within the iag.20362036 *20372037 * RETURN VALUES:20382038 * 0 - success.20392039 * -ENOSPC - insufficient disk resources.20402040- * -EIO - i/o error.20402040+ * -EIO - i/o error.20412041 */20422042static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)20432043{···21722172 * buffers. under this approach, all required buffers are21732173 * obtained before making any updates and are held until all21742174 * updates are complete.21752175- * 21752175+ *21762176 * PRE CONDITION: Already have buffer lock on iagp. Already have AG lock on21772177 * this AG. Must have read lock on imap inode.21782178 *21792179 * PARAMETERS:21802180- * imap - pointer to inode map control structure.21812181- * iagp - pointer to iag. 21822182- * extno - extent number.21802180+ * imap - pointer to inode map control structure.21812181+ * iagp - pointer to iag.21822182+ * extno - extent number.21832183 *21842184 * RETURN VALUES:21852185 * 0 - success.21862186 * -ENOSPC - insufficient disk resources.21872187- * -EIO - i/o error.21872187+ * -EIO - i/o error.21882188 */21892189static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)21902190{···24322432/*24332433 * NAME: diNewIAG(imap,iagnop,agno)24342434 *24352435- * FUNCTION: allocate a new iag for an allocation group.24362436- * 24372437- * first tries to allocate the iag from the inode map 24382438- * iagfree list: 24392439- * if the list has free iags, the head of the list is removed 24352435+ * FUNCTION: allocate a new iag for an allocation group.24362436+ *24372437+ * first tries to allocate the iag from the inode map24382438+ * iagfree list:24392439+ * if the list has free iags, the head of the list is removed24402440 * and returned to satisfy the request.24412441 * if the inode map's iag free list is empty, the inode map24422442 * is extended to hold a new iag. this new iag is initialized24432443 * and returned to satisfy the request.24442444 *24452445 * PARAMETERS:24462446- * imap - pointer to inode map control structure.24472447- * iagnop - pointer to an iag number set with the number of the24462446+ * imap - pointer to inode map control structure.24472447+ * iagnop - pointer to an iag number set with the number of the24482448 * newly allocated iag upon successful return.24492449- * agno - allocation group number.24492449+ * agno - allocation group number.24502450 * bpp - Buffer pointer to be filled in with new IAG's buffer24512451 *24522452 * RETURN VALUES:24532453 * 0 - success.24542454 * -ENOSPC - insufficient disk resources.24552455- * -EIO - i/o error.24552455+ * -EIO - i/o error.24562456 *24572457- * serialization: 24572457+ * serialization:24582458 * AG lock held on entry/exit;24592459 * write lock on the map is held inside;24602460 * read lock on the map is held on successful completion;24612461 *24622462- * note: new iag transaction: 24622462+ * note: new iag transaction:24632463 * . synchronously write iag;24642464 * . write log of xtree and inode of imap;24652465 * . commit;···24942494 /* acquire the free iag lock */24952495 IAGFREE_LOCK(imap);2496249624972497- /* if there are any iags on the inode map free iag list, 24972497+ /* if there are any iags on the inode map free iag list,24982498 * allocate the iag from the head of the list.24992499 */25002500 if (imap->im_freeiag >= 0) {···26182618 flush_metapage(mp);2619261926202620 /*26212621- * txCommit(COMMIT_FORCE) will synchronously write address 26222622- * index pages and inode after commit in careful update order 26212621+ * txCommit(COMMIT_FORCE) will synchronously write address26222622+ * index pages and inode after commit in careful update order26232623 * of address index pages (right to left, bottom up);26242624 */26252625 iplist[0] = ipimap;···26782678 *26792679 * FUNCTION: get the buffer for the specified iag within a fileset26802680 * or aggregate inode map.26812681- * 26812681+ *26822682 * PARAMETERS:26832683- * imap - pointer to inode map control structure.26842684- * iagno - iag number.26852685- * bpp - point to buffer pointer to be filled in on successful26832683+ * imap - pointer to inode map control structure.26842684+ * iagno - iag number.26852685+ * bpp - point to buffer pointer to be filled in on successful26862686 * exit.26872687 *26882688 * SERIALIZATION:···26922692 *26932693 * RETURN VALUES:26942694 * 0 - success.26952695- * -EIO - i/o error.26952695+ * -EIO - i/o error.26962696 */26972697static int diIAGRead(struct inomap * imap, int iagno, struct metapage ** mpp)26982698{···27182718 * the specified bit position.27192719 *27202720 * PARAMETERS:27212721- * word - word to be examined.27222722- * start - starting bit position.27212721+ * word - word to be examined.27222722+ * start - starting bit position.27232723 *27242724 * RETURN VALUES:27252725 * bit position of first free bit in the word or 32 if···2740274027412741/*27422742 * NAME: diUpdatePMap()27432743- * 27442744- * FUNCTION: Update the persistent map in an IAG for the allocation or 27432743+ *27442744+ * FUNCTION: Update the persistent map in an IAG for the allocation or27452745 * freeing of the specified inode.27462746- * 27462746+ *27472747 * PRE CONDITIONS: Working map has already been updated for allocate.27482748 *27492749 * PARAMETERS:···27522752 * is_free - If 'true' indicates inode should be marked freed, otherwise27532753 * indicates inode should be marked allocated.27542754 *27552755- * RETURN VALUES: 27552755+ * RETURN VALUES:27562756 * 0 for success27572757 */27582758int···27932793 extno = ino >> L2INOSPEREXT;27942794 bitno = ino & (INOSPEREXT - 1);27952795 mask = HIGHORDER >> bitno;27962796- /* 27962796+ /*27972797 * mark the inode free in persistent map:27982798 */27992799 if (is_free) {···28032803 * of last reference release;28042804 */28052805 if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) {28062806- jfs_error(ipimap->i_sb, 28062806+ jfs_error(ipimap->i_sb,28072807 "diUpdatePMap: inode %ld not marked as "28082808 "allocated in wmap!", inum);28092809 }···28772877 * diExtendFS()28782878 *28792879 * function: update imap for extendfs();28802880- * 28812881- * note: AG size has been increased s.t. each k old contiguous AGs are 28802880+ *28812881+ * note: AG size has been increased s.t. each k old contiguous AGs are28822882 * coalesced into a new AG;28832883 */28842884int diExtendFS(struct inode *ipimap, struct inode *ipbmap)···28972897 atomic_read(&imap->im_numfree));2898289828992899 /*29002900- * reconstruct imap 29002900+ * reconstruct imap29012901 *29022902 * coalesce contiguous k (newAGSize/oldAGSize) AGs;29032903 * i.e., (AGi, ..., AGj) where i = k*n and j = k*(n+1) - 1 to AGn;···29312931 }2932293229332933 /* leave free iag in the free iag list */29342934- if (iagp->nfreeexts == cpu_to_le32(EXTSPERIAG)) { 29342934+ if (iagp->nfreeexts == cpu_to_le32(EXTSPERIAG)) {29352935 release_metapage(bp);29362936 continue;29372937 }
+7-7
fs/jfs/jfs_imap.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200222+ * Copyright (C) International Business Machines Corp., 2000-200233 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_IMAP···4545/* get the starting block number of the 4K page of an inode extent4646 * that contains ino.4747 */4848-#define INOPBLK(pxd,ino,l2nbperpg) (addressPXD((pxd)) + \4848+#define INOPBLK(pxd,ino,l2nbperpg) (addressPXD((pxd)) + \4949 ((((ino) & (INOSPEREXT-1)) >> L2INOSPERPAGE) << (l2nbperpg)))50505151/*5252 * inode allocation map:5353- * 5454- * inode allocation map consists of 5353+ *5454+ * inode allocation map consists of5555 * . the inode map control page and5656 * . inode allocation group pages (per 4096 inodes)5757 * which are addressed by standard JFS xtree.
+4-4
fs/jfs/jfs_incore.h
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818- */ 1818+ */1919#ifndef _H_JFS_INCORE2020#define _H_JFS_INCORE2121
+3-3
fs/jfs/jfs_inode.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818
+3-3
fs/jfs/jfs_inode.h
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_INODE
+5-5
fs/jfs/jfs_lock.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200133- * Portions Copyright (c) Christoph Hellwig, 2001-200222+ * Copyright (C) International Business Machines Corp., 2000-200133+ * Portions Copyright (C) Christoph Hellwig, 2001-200244 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919#ifndef _H_JFS_LOCK
+19-19
fs/jfs/jfs_logmgr.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919···337337 * PARAMETER: cd - commit descriptor338338 *339339 * RETURN: end-of-log address340340- * 340340+ *341341 * serialization: LOG_LOCK() held on entry/exit342342 */343343static int···554554 * PARAMETER: log555555 *556556 * RETURN: 0557557- * 557557+ *558558 * serialization: LOG_LOCK() held on entry/exit559559 */560560static int lmNextPage(struct jfs_log * log)···656656 * page number - redrive pageout of the page at the head of657657 * pageout queue until full page has been written.658658 *659659- * RETURN: 659659+ * RETURN:660660 *661661 * NOTE:662662 * LOGGC_LOCK serializes log group commit queue, and···920920 * this code is called again.921921 *922922 * PARAMETERS: log - log structure923923- * hard_sync - 1 to force all metadata to be written923923+ * hard_sync - 1 to force all metadata to be written924924 *925925 * RETURN: 0926926- * 926926+ *927927 * serialization: LOG_LOCK() held on entry/exit928928 */929929static int lmLogSync(struct jfs_log * log, int hard_sync)···10521052 * FUNCTION: write log SYNCPT record for specified log10531053 *10541054 * PARAMETERS: log - log structure10551055- * hard_sync - set to 1 to force metadata to be written10551055+ * hard_sync - set to 1 to force metadata to be written10561056 */10571057void jfs_syncpt(struct jfs_log *log, int hard_sync)10581058{ LOG_LOCK(log);···10671067 * insert filesystem in the active list of the log.10681068 *10691069 * PARAMETER: ipmnt - file system mount inode10701070- * iplog - log inode (out)10701070+ * iplog - log inode (out)10711071 *10721072 * RETURN:10731073 *···1082108210831083 if (sbi->flag & JFS_NOINTEGRITY)10841084 return open_dummy_log(sb);10851085-10851085+10861086 if (sbi->mntflag & JFS_INLINELOG)10871087 return open_inline_log(sb);10881088···1131113111321132 log->bdev = bdev;11331133 memcpy(log->uuid, sbi->loguuid, sizeof(log->uuid));11341134-11341134+11351135 /*11361136 * initialize log:11371137 */···12531253 * initialize the log from log superblock.12541254 * set the log state in the superblock to LOGMOUNT and12551255 * write SYNCPT log record.12561256- * 12561256+ *12571257 * PARAMETER: log - log structure12581258 *12591259 * RETURN: 0 - if ok12601260 * -EINVAL - bad log magic number or superblock dirty12611261 * error returned from logwait()12621262- * 12621262+ *12631263 * serialization: single first open thread12641264 */12651265int lmLogInit(struct jfs_log * log)···1297129712981298 if (!test_bit(log_INLINELOG, &log->flag))12991299 log->l2bsize = L2LOGPSIZE;13001300-13001300+13011301 /* check for disabled journaling to disk */13021302 if (log->no_integrity) {13031303 /*···16511651 * PARAMETER: log - log inode16521652 *16531653 * RETURN: 0 - success16541654- * 16541654+ *16551655 * serialization: single last close thread16561656 */16571657int lmLogShutdown(struct jfs_log * log)···16771677 lrd.type = cpu_to_le16(LOG_SYNCPT);16781678 lrd.length = 0;16791679 lrd.log.syncpt.sync = 0;16801680-16801680+16811681 lsn = lmWriteRecord(log, NULL, &lrd, NULL);16821682 bp = log->bp;16831683 lp = (struct logpage *) bp->l_ldata;···17031703 jfs_info("lmLogShutdown: lsn:0x%x page:%d eor:%d",17041704 lsn, log->page, log->eor);1705170517061706- out: 17061706+ out:17071707 /*17081708 * shutdown per log i/o17091709 */···17691769 lbmFree(bpsuper);17701770 return -EIO;17711771 }17721772-17721772+17731773 }1774177417751775 /*
+37-39
fs/jfs/jfs_logmgr.h
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919#ifndef _H_JFS_LOGMGR···3535/*3636 * log logical volume3737 *3838- * a log is used to make the commit operation on journalled 3838+ * a log is used to make the commit operation on journalled3939 * files within the same logical volume group atomic.4040 * a log is implemented with a logical volume.4141- * there is one log per logical volume group. 4141+ * there is one log per logical volume group.4242 *4343 * block 0 of the log logical volume is not used (ipl etc).4444 * block 1 contains a log "superblock" and is used by logFormat(),4545- * lmLogInit(), lmLogShutdown(), and logRedo() to record status 4646- * of the log but is not otherwise used during normal processing. 4545+ * lmLogInit(), lmLogShutdown(), and logRedo() to record status4646+ * of the log but is not otherwise used during normal processing.4747 * blocks 2 - (N-1) are used to contain log records.4848 *4949- * when a volume group is varied-on-line, logRedo() must have 5050- * been executed before the file systems (logical volumes) in 4949+ * when a volume group is varied-on-line, logRedo() must have5050+ * been executed before the file systems (logical volumes) in5151 * the volume group can be mounted.5252 */5353/*···9797 * log logical page9898 *9999 * (this comment should be rewritten !)100100- * the header and trailer structures (h,t) will normally have 100100+ * the header and trailer structures (h,t) will normally have101101 * the same page and eor value.102102- * An exception to this occurs when a complete page write is not 102102+ * An exception to this occurs when a complete page write is not103103 * accomplished on a power failure. Since the hardware may "split write"104104- * sectors in the page, any out of order sequence may occur during powerfail 104104+ * sectors in the page, any out of order sequence may occur during powerfail105105 * and needs to be recognized during log replay. The xor value is106106 * an "exclusive or" of all log words in the page up to eor. This107107 * 32 bit eor is stored with the top 16 bits in the header and the108108 * bottom 16 bits in the trailer. logredo can easily recognize pages109109- * that were not completed by reconstructing this eor and checking 109109+ * that were not completed by reconstructing this eor and checking110110 * the log page.111111 *112112- * Previous versions of the operating system did not allow split 113113- * writes and detected partially written records in logredo by 114114- * ordering the updates to the header, trailer, and the move of data 115115- * into the logdata area. The order: (1) data is moved (2) header 116116- * is updated (3) trailer is updated. In logredo, when the header 117117- * differed from the trailer, the header and trailer were reconciled 118118- * as follows: if h.page != t.page they were set to the smaller of 119119- * the two and h.eor and t.eor set to 8 (i.e. empty page). if (only) 112112+ * Previous versions of the operating system did not allow split113113+ * writes and detected partially written records in logredo by114114+ * ordering the updates to the header, trailer, and the move of data115115+ * into the logdata area. The order: (1) data is moved (2) header116116+ * is updated (3) trailer is updated. In logredo, when the header117117+ * differed from the trailer, the header and trailer were reconciled118118+ * as follows: if h.page != t.page they were set to the smaller of119119+ * the two and h.eor and t.eor set to 8 (i.e. empty page). if (only)120120 * h.eor != t.eor they were set to the smaller of their two values.121121 */122122struct logpage {···147147 * in a page, pages are written to temporary paging space if148148 * if they must be written to disk before commit, and i/o is149149 * scheduled for modified pages to their home location after150150- * the log records containing the after values and the commit 150150+ * the log records containing the after values and the commit151151 * record is written to the log on disk, undo discards the copy152152 * in main-memory.)153153 *154154- * a log record consists of a data area of variable length followed by 154154+ * a log record consists of a data area of variable length followed by155155 * a descriptor of fixed size LOGRDSIZE bytes.156156- * the data area is rounded up to an integral number of 4-bytes and 156156+ * the data area is rounded up to an integral number of 4-bytes and157157 * must be no longer than LOGPSIZE.158158- * the descriptor is of size of multiple of 4-bytes and aligned on a 159159- * 4-byte boundary. 158158+ * the descriptor is of size of multiple of 4-bytes and aligned on a159159+ * 4-byte boundary.160160 * records are packed one after the other in the data area of log pages.161161- * (sometimes a DUMMY record is inserted so that at least one record ends 161161+ * (sometimes a DUMMY record is inserted so that at least one record ends162162 * on every page or the longest record is placed on at most two pages).163163- * the field eor in page header/trailer points to the byte following 163163+ * the field eor in page header/trailer points to the byte following164164 * the last record on a page.165165 */166166···270270 /*271271 * NOREDOINOEXT: the inode extent is freed272272 *273273- * do not apply after-image records which precede this 274274- * record in the log with the any of the 4 page block 275275- * numbers in this inode extent. 276276- * 277277- * NOTE: The fileset and pxd fields MUST remain in 273273+ * do not apply after-image records which precede this274274+ * record in the log with the any of the 4 page block275275+ * numbers in this inode extent.276276+ *277277+ * NOTE: The fileset and pxd fields MUST remain in278278 * the same fields in the REDOPAGE record format.279279 *280280 */···319319 * do not apply records which precede this record in the log320320 * with the same inode number.321321 *322322- * NOREDILE must be the first to be written at commit322322+ * NOREDOFILE must be the first to be written at commit323323 * (last to be read in logredo()) - it prevents324324 * replay of preceding updates of all preceding generations325325- * of the inumber esp. the on-disk inode itself, 326326- * but does NOT prevent327327- * replay of the 325325+ * of the inumber esp. the on-disk inode itself.328326 */329327 struct {330328 __le32 fileset; /* 4: fileset number */···330332 } noredofile;331333332334 /*333333- * ? NEWPAGE: 335335+ * ? NEWPAGE:334336 *335337 * metadata type dependent336338 */···462464 s64 l_blkno; /* 8: log page block number */463465 caddr_t l_ldata; /* 4: data page */464466 struct page *l_page; /* The page itself */465465- uint l_offset; /* Offset of l_ldata within the page */ 467467+ uint l_offset; /* Offset of l_ldata within the page */466468467469 wait_queue_head_t l_ioevent; /* 4: i/o done event */468470};
+6-6
fs/jfs/jfs_metapage.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919···461461 goto add_failed;462462 if (!bio->bi_size)463463 goto dump_bio;464464-464464+465465 submit_bio(WRITE, bio);466466 }467467 if (redirty)···648648 jfs_err("logical_size = %d, size = %d",649649 mp->logical_size, size);650650 dump_stack();651651- goto unlock; 651651+ goto unlock;652652 }653653 mp->count++;654654 lock_metapage(mp);···658658 "__get_metapage: using a "659659 "discarded metapage");660660 discard_metapage(mp);661661- goto unlock; 661661+ goto unlock;662662 }663663 clear_bit(META_discard, &mp->flag);664664 }
+4-4
fs/jfs/jfs_metapage.h
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919#ifndef _H_JFS_METAPAGE···3333 unsigned long flag; /* See Below */3434 unsigned long count; /* Reference count */3535 void *data; /* Data pointer */3636- sector_t index; /* block address of page */3636+ sector_t index; /* block address of page */3737 wait_queue_head_t wait;38383939 /* implementation */
+17-17
fs/jfs/jfs_mount.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818···2121 *2222 * note: file system in transition to aggregate/fileset:2323 *2424- * file system mount is interpreted as the mount of aggregate, 2525- * if not already mounted, and mount of the single/only fileset in 2424+ * file system mount is interpreted as the mount of aggregate,2525+ * if not already mounted, and mount of the single/only fileset in2626 * the aggregate;2727 *2828 * a file system/aggregate is represented by an internal inode2929 * (aka mount inode) initialized with aggregate superblock;3030- * each vfs represents a fileset, and points to its "fileset inode 3030+ * each vfs represents a fileset, and points to its "fileset inode3131 * allocation map inode" (aka fileset inode):3232- * (an aggregate itself is structured recursively as a filset: 3333- * an internal vfs is constructed and points to its "fileset inode 3434- * allocation map inode" (aka aggregate inode) where each inode 3535- * represents a fileset inode) so that inode number is mapped to 3232+ * (an aggregate itself is structured recursively as a filset:3333+ * an internal vfs is constructed and points to its "fileset inode3434+ * allocation map inode" (aka aggregate inode) where each inode3535+ * represents a fileset inode) so that inode number is mapped to3636 * on-disk inode in uniform way at both aggregate and fileset level;3737 *3838 * each vnode/inode of a fileset is linked to its vfs (to facilitate···4141 * per aggregate information, e.g., block size, etc.) as well as4242 * its file set inode.4343 *4444- * aggregate 4444+ * aggregate4545 * ipmnt4646 * mntvfs -> fileset ipimap+ -> aggregate ipbmap -> aggregate ipaimap;4747 * fileset vfs -> vp(1) <-> ... <-> vp(n) <->vproot;···8888 struct inode *ipbmap = NULL;89899090 /*9191- * read/validate superblock 9191+ * read/validate superblock9292 * (initialize mount inode from the superblock)9393 */9494 if ((rc = chkSuper(sb))) {···238238 */239239int jfs_mount_rw(struct super_block *sb, int remount)240240{241241- struct jfs_sb_info *sbi = JFS_SBI(sb); 241241+ struct jfs_sb_info *sbi = JFS_SBI(sb);242242 int rc;243243244244 /*···291291/*292292 * chkSuper()293293 *294294- * validate the superblock of the file system to be mounted and 294294+ * validate the superblock of the file system to be mounted and295295 * get the file system parameters.296296 *297297 * returns···426426 jfs_err("updateSuper: bad state");427427 } else if (sbi->state == FM_DIRTY)428428 return 0;429429-429429+430430 if ((rc = readSuper(sb, &bh)))431431 return rc;432432···486486 * for this file system past this point in log.487487 * it is harmless if mount fails.488488 *489489- * note: MOUNT record is at aggregate level, not at fileset level, 489489+ * note: MOUNT record is at aggregate level, not at fileset level,490490 * since log records of previous mounts of a fileset491491- * (e.g., AFTER record of extent allocation) have to be processed 491491+ * (e.g., AFTER record of extent allocation) have to be processed492492 * to update block allocation map at aggregate level.493493 */494494static int logMOUNT(struct super_block *sb)
+11-11
fs/jfs/jfs_superblock.h
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_SUPERBLOCK···2121/*2222 * make the magic number something a human could read2323 */2424-#define JFS_MAGIC "JFS1" /* Magic word */2424+#define JFS_MAGIC "JFS1" /* Magic word */25252626#define JFS_VERSION 2 /* Version number: Version 2 */27272828#define LV_NAME_SIZE 11 /* MUST BE 11 for OS/2 boot sector */29293030-/* 3131- * aggregate superblock 3030+/*3131+ * aggregate superblock3232 *3333 * The name superblock is too close to super_block, so the name has been3434 * changed to jfs_superblock. The utilities are still using the old name.···4040 __le64 s_size; /* 8: aggregate size in hardware/LVM blocks;4141 * VFS: number of blocks4242 */4343- __le32 s_bsize; /* 4: aggregate block size in bytes; 4343+ __le32 s_bsize; /* 4: aggregate block size in bytes;4444 * VFS: fragment size4545 */4646 __le16 s_l2bsize; /* 2: log2 of s_bsize */···5454 __le32 s_flag; /* 4: aggregate attributes:5555 * see jfs_filsys.h5656 */5757- __le32 s_state; /* 4: mount/unmount/recovery state: 5757+ __le32 s_state; /* 4: mount/unmount/recovery state:5858 * see jfs_filsys.h5959 */6060 __le32 s_compress; /* 4: > 0 if data compression */···7575 struct timestruc_t s_time; /* 8: time last updated */76767777 __le32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for7878- * the fsck service log. 7878+ * the fsck service log.7979 * N.B. These blocks are divided among the8080 * versions kept. This is not a per8181 * version size.8282- * N.B. These blocks are included in the 8282+ * N.B. These blocks are included in the8383 * length field of s_fsckpxd.8484 */8585 s8 s_fscklog; /* 1: which fsck service log is most recent···8787 * 1 => the first one8888 * 2 => the 2nd one8989 */9090- char s_fpack[11]; /* 11: file system volume name 9090+ char s_fpack[11]; /* 11: file system volume name9191 * N.B. This must be 11 bytes to9292 * conform with the OS/2 BootSector9393 * requirements
+3-3
fs/jfs/jfs_txnmgr.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919
+6-6
fs/jfs/jfs_txnmgr.h
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_TXNMGR···179179 /* (8) */180180181181 struct lv lv[20]; /* 40: */182182-}; /* (48) */182182+}; /* (48) */183183184184#define dt_lock linelock185185···211211 * at tlock.lock/linelock: watch for alignment;212212 * N.B. next field may be set by linelock, and should not213213 * be modified by maplock;214214- * N.B. index of the first pxdlock specifies index of next 215215- * free maplock (i.e., number of maplock) in the tlock; 214214+ * N.B. index of the first pxdlock specifies index of next215215+ * free maplock (i.e., number of maplock) in the tlock;216216 */217217struct maplock {218218 lid_t next; /* 2: */
+12-12
fs/jfs/jfs_umount.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818···2222 * note: file system in transition to aggregate/fileset:2323 * (ref. jfs_mount.c)2424 *2525- * file system unmount is interpreted as mount of the single/only 2626- * fileset in the aggregate and, if unmount of the last fileset, 2525+ * file system unmount is interpreted as mount of the single/only2626+ * fileset in the aggregate and, if unmount of the last fileset,2727 * as unmount of the aggerate;2828 */2929···6060 jfs_info("UnMount JFS: sb:0x%p", sb);61616262 /*6363- * update superblock and close log 6363+ * update superblock and close log6464 *6565 * if mounted read-write and log based recovery was enabled6666 */6767 if ((log = sbi->log))6868 /*6969- * Wait for outstanding transactions to be written to log: 6969+ * Wait for outstanding transactions to be written to log:7070 */7171 jfs_flush_journal(log, 2);7272···112112113113 /*114114 * ensure all file system file pages are propagated to their115115- * home blocks on disk (and their in-memory buffer pages are 115115+ * home blocks on disk (and their in-memory buffer pages are116116 * invalidated) BEFORE updating file system superblock state117117- * (to signify file system is unmounted cleanly, and thus in 118118- * consistent state) and log superblock active file system 117117+ * (to signify file system is unmounted cleanly, and thus in118118+ * consistent state) and log superblock active file system119119 * list (to signify skip logredo()).120120 */121121 if (log) { /* log = NULL if read-only mount */122122 updateSuper(sb, FM_CLEAN);123123124124 /*125125- * close log: 125125+ * close log:126126 *127127 * remove file system from log active file system list.128128 */···142142 return 0;143143144144 /*145145- * close log: 145145+ * close log:146146 *147147 * remove file system from log active file system list.148148 */
+5-5
fs/jfs/jfs_unicode.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818···5757 warn--;5858 warn_again--;5959 printk(KERN_ERR6060- "non-latin1 character 0x%x found in JFS file name\n", 6161- le16_to_cpu(from[i]));6060+ "non-latin1 character 0x%x found in JFS file name\n",6161+ le16_to_cpu(from[i]));6262 printk(KERN_ERR6363 "mount with iocharset=utf8 to access\n");6464 }
+5-5
fs/jfs/jfs_unicode.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200233- * Portions Copyright (c) Christoph Hellwig, 2001-200222+ * Copyright (C) International Business Machines Corp., 2000-200233+ * Portions Copyright (C) Christoph Hellwig, 2001-200244 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919#ifndef _H_JFS_UNICODE
+4-4
fs/jfs/jfs_uniupr.c
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200222+ * Copyright (C) International Business Machines Corp., 2000-200233 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818
+1-1
fs/jfs/jfs_xattr.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200222+ * Copyright (C) International Business Machines Corp., 2000-200233 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by
+6-6
fs/jfs/jfs_xtree.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818/*···24282428 * return:24292429 */24302430int xtAppend(tid_t tid, /* transaction id */24312431- struct inode *ip, int xflag, s64 xoff, s32 maxblocks, 24312431+ struct inode *ip, int xflag, s64 xoff, s32 maxblocks,24322432 s32 * xlenp, /* (in/out) */24332433 s64 * xaddrp, /* (in/out) */24342434 int flag)···24992499 pxdlist.maxnpxd = pxdlist.npxd = 0;25002500 pxd = &pxdlist.pxd[0];25012501 nblocks = JFS_SBI(ip->i_sb)->nbperpage;25022502- for (; nsplit > 0; nsplit--, pxd++, xaddr += nblocks, maxblocks -= nblocks) { 25022502+ for (; nsplit > 0; nsplit--, pxd++, xaddr += nblocks, maxblocks -= nblocks) {25032503 if ((rc = dbAllocBottomUp(ip, xaddr, (s64) nblocks)) == 0) {25042504 PXDaddress(pxd, xaddr);25052505 PXDlength(pxd, nblocks);···25142514 goto out;25152515 }2516251625172517- xlen = min(xlen, maxblocks); 25172517+ xlen = min(xlen, maxblocks);2518251825192519 /*25202520 * allocate data extent requested
+4-4
fs/jfs/jfs_xtree.h
···11/*22- * Copyright (c) International Business Machines Corp., 2000-200222+ * Copyright (C) International Business Machines Corp., 2000-200233 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818#ifndef _H_JFS_XTREE
+25-25
fs/jfs/namei.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919···4141/*4242 * NAME: free_ea_wmap(inode)4343 *4444- * FUNCTION: free uncommitted extended attributes from working map 4444+ * FUNCTION: free uncommitted extended attributes from working map4545 *4646 */4747static inline void free_ea_wmap(struct inode *inode)···6262 * FUNCTION: create a regular file in the parent directory <dip>6363 * with name = <from dentry> and mode = <mode>6464 *6565- * PARAMETER: dip - parent directory vnode6565+ * PARAMETER: dip - parent directory vnode6666 * dentry - dentry of new file6767 * mode - create mode (rwxrwxrwx).6868 * nd- nd struct···190190 * FUNCTION: create a child directory in the parent directory <dip>191191 * with name = <from dentry> and mode = <mode>192192 *193193- * PARAMETER: dip - parent directory vnode193193+ * PARAMETER: dip - parent directory vnode194194 * dentry - dentry of child directory195195 * mode - create mode (rwxrwxrwx).196196 *···324324 *325325 * FUNCTION: remove a link to child directory326326 *327327- * PARAMETER: dip - parent inode327327+ * PARAMETER: dip - parent inode328328 * dentry - child directory dentry329329 *330330 * RETURN: -EINVAL - if name is . or ..···332332 * errors from subroutines333333 *334334 * note:335335- * if other threads have the directory open when the last link 336336- * is removed, the "." and ".." entries, if present, are removed before 337337- * rmdir() returns and no new entries may be created in the directory, 338338- * but the directory is not removed until the last reference to 335335+ * if other threads have the directory open when the last link336336+ * is removed, the "." and ".." entries, if present, are removed before337337+ * rmdir() returns and no new entries may be created in the directory,338338+ * but the directory is not removed until the last reference to339339 * the directory is released (cf.unlink() of regular file).340340 */341341static int jfs_rmdir(struct inode *dip, struct dentry *dentry)···446446/*447447 * NAME: jfs_unlink(dip, dentry)448448 *449449- * FUNCTION: remove a link to object <vp> named by <name> 449449+ * FUNCTION: remove a link to object <vp> named by <name>450450 * from parent directory <dvp>451451 *452452- * PARAMETER: dip - inode of parent directory453453- * dentry - dentry of object to be removed452452+ * PARAMETER: dip - inode of parent directory453453+ * dentry - dentry of object to be removed454454 *455455 * RETURN: errors from subroutines456456 *···598598 *599599 * FUNCTION: for non-directory, called by jfs_remove(),600600 * truncate a regular file, directory or symbolic601601- * link to zero length. return 0 if type is not 601601+ * link to zero length. return 0 if type is not602602 * one of these.603603 *604604 * if the file is currently associated with a VM segment···608608 * map by ctrunc1.609609 * if there is no VM segment on entry, the resources are610610 * freed in both work and permanent map.611611- * (? for temporary file - memory object is cached even 611611+ * (? for temporary file - memory object is cached even612612 * after no reference:613613 * reference count > 0 - )614614 *···662662663663 /*664664 * free xtree/data (truncate to zero length):665665- * free xtree/data pages from cache if COMMIT_PWMAP, 665665+ * free xtree/data pages from cache if COMMIT_PWMAP,666666 * free xtree/data blocks from persistent block map, and667667 * free xtree/data blocks from working block map if COMMIT_PWMAP;668668 */···677677 * NAME: jfs_free_zero_link()678678 *679679 * FUNCTION: for non-directory, called by iClose(),680680- * free resources of a file from cache and WORKING map 680680+ * free resources of a file from cache and WORKING map681681 * for a file previously committed with zero link count682682 * while associated with a pager object,683683 *···762762 * FUNCTION: create a link to <vp> by the name = <name>763763 * in the parent directory <dvp>764764 *765765- * PARAMETER: vp - target object765765+ * PARAMETER: vp - target object766766 * dvp - parent directory of new link767767 * name - name of new link to target object768768 * crp - credential···858858 * in directory <dip>859859 *860860 * PARAMETER: dip - parent directory vnode861861- * dentry - dentry of symbolic link862862- * name - the path name of the existing object 861861+ * dentry - dentry of symbolic link862862+ * name - the path name of the existing object863863 * that will be the source of the link864864 *865865 * RETURN: errors from subroutines···926926 tblk->u.ixpxd = JFS_IP(ip)->ixpxd;927927928928 /* fix symlink access permission929929- * (dir_create() ANDs in the u.u_cmask, 929929+ * (dir_create() ANDs in the u.u_cmask,930930 * but symlinks really need to be 777 access)931931 */932932 ip->i_mode |= 0777;···967967 ip->i_mapping->a_ops = &jfs_aops;968968969969 /*970970- * even though the data of symlink object (source 970970+ * even though the data of symlink object (source971971 * path name) is treated as non-journaled user data,972972 * it is read/written thru buffer cache for performance.973973 */···11751175 /* free block resources */11761176 if ((new_size = commitZeroLink(tid, new_ip)) < 0) {11771177 txAbort(tid, 1); /* Marks FS Dirty */11781178- rc = new_size; 11781178+ rc = new_size;11791179 goto out4;11801180 }11811181 tblk = tid_to_tblock(tid);···12911291 new_size = xtTruncate_pmap(tid, new_ip, new_size);12921292 if (new_size < 0) {12931293 txAbort(tid, 1);12941294- rc = new_size; 12941294+ rc = new_size;12951295 } else12961296 rc = txCommit(tid, 1, &new_ip, COMMIT_SYNC);12971297 txEnd(tid);
+3-3
fs/jfs/resize.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717*/1818
+5-5
fs/jfs/super.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919···8282 "as read-only\n",8383 sb->s_id);8484 sb->s_flags |= MS_RDONLY;8585- } 8585+ }86868787 /* nothing is done for continue beyond marking the superblock dirty */8888}···775775 int rc;776776777777 jfs_inode_cachep =778778- kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0, 778778+ kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0,779779 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,780780 init_once, NULL);781781 if (jfs_inode_cachep == NULL)
+3-3
fs/jfs/symlink.c
···33 *44 * This program is free software; you can redistribute it and/or modify55 * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or 66+ * the Free Software Foundation; either version 2 of the License, or77 * (at your option) any later version.88- * 88+ *99 * This program is distributed in the hope that it will be useful,1010 * but WITHOUT ANY WARRANTY; without even the implied warranty of1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1212 * the GNU General Public License for more details.1313 *1414 * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software 1515+ * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717 */1818
+19-19
fs/jfs/xattr.c
···44 *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or 77+ * the Free Software Foundation; either version 2 of the License, or88 * (at your option) any later version.99- * 99+ *1010 * This program is distributed in the hope that it will be useful,1111 * but WITHOUT ANY WARRANTY; without even the implied warranty of1212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See1313 * the GNU General Public License for more details.1414 *1515 * You should have received a copy of the GNU General Public License1616- * along with this program; if not, write to the Free Software 1616+ * along with this program; if not, write to the Free Software1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919···5757 *5858 * 0 4 4 + EA_SIZE(ea1)5959 * +------------+-------------------+--------------------+-----6060- * | Overall EA | First FEA Element | Second FEA Element | ..... 6060+ * | Overall EA | First FEA Element | Second FEA Element | .....6161 * | List Size | | |6262 * +------------+-------------------+--------------------+-----6363 *···155155156156/*157157 * NAME: ea_write_inline158158- * 158158+ *159159 * FUNCTION: Attempt to write an EA inline if area is available160160- * 160160+ *161161 * PRE CONDITIONS:162162 * Already verified that the specified EA is small enough to fit inline163163 *···216216217217/*218218 * NAME: ea_write219219- * 219219+ *220220 * FUNCTION: Write an EA for an inode221221- * 222222- * PRE CONDITIONS: EA has been verified 221221+ *222222+ * PRE CONDITIONS: EA has been verified223223 *224224 * PARAMETERS:225225 * ip - Inode pointer···340340341341/*342342 * NAME: ea_read_inline343343- * 343343+ *344344 * FUNCTION: Read an inlined EA into user's buffer345345- * 345345+ *346346 * PARAMETERS:347347 * ip - Inode pointer348348 * ealist - Pointer to buffer to fill in with EA···372372373373/*374374 * NAME: ea_read375375- * 375375+ *376376 * FUNCTION: copy EA data into user's buffer377377- * 377377+ *378378 * PARAMETERS:379379 * ip - Inode pointer380380 * ealist - Pointer to buffer to fill in with EA···406406 return -EIO;407407 }408408409409- /* 409409+ /*410410 * Figure out how many blocks were allocated when this EA list was411411 * originally written to disk.412412 */···443443444444/*445445 * NAME: ea_get446446- * 446446+ *447447 * FUNCTION: Returns buffer containing existing extended attributes.448448 * The size of the buffer will be the larger of the existing449449 * attributes size, or min_size.450450 *451451 * The buffer, which may be inlined in the inode or in the452452- * page cache must be release by calling ea_release or ea_put453453- * 452452+ * page cache must be release by calling ea_release or ea_put453453+ *454454 * PARAMETERS:455455 * inode - Inode pointer456456 * ea_buf - Structure to be populated with ealist and its metadata···1054105410551055 /* compute required size of list */10561056 for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) {10571057- if (can_list(ea))10571057+ if (can_list(ea))10581058 size += name_size(ea) + 1;10591059 }10601060···10691069 /* Copy attribute names to buffer */10701070 buffer = data;10711071 for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) {10721072- if (can_list(ea)) {10721072+ if (can_list(ea)) {10731073 int namelen = copy_name(buffer, ea);10741074 buffer += namelen + 1;10751075 }