Commit 44f54921 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  JFS: White space cleanup
  [PATCH] JFS: return correct error when i-node allocation failed
  JFS: Remove shadow variable from fs/jfs/jfs_txnmgr.c:xtLog()
parents 3e04767a 63f83c9f
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -183,7 +183,7 @@ int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir) ...@@ -183,7 +183,7 @@ int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir)
posix_acl_release(acl); posix_acl_release(acl);
} else } else
inode->i_mode &= ~current->fs->umask; inode->i_mode &= ~current->fs->umask;
JFS_IP(inode)->mode2 = (JFS_IP(inode)->mode2 & 0xffff0000) | JFS_IP(inode)->mode2 = (JFS_IP(inode)->mode2 & 0xffff0000) |
inode->i_mode; inode->i_mode;
......
/* /*
* Copyright (c) International Business Machines Corp., 2001 * Copyright (C) International Business Machines Corp., 2001
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -108,7 +108,7 @@ const struct file_operations jfs_file_operations = { ...@@ -108,7 +108,7 @@ const struct file_operations jfs_file_operations = {
.aio_read = generic_file_aio_read, .aio_read = generic_file_aio_read,
.aio_write = generic_file_aio_write, .aio_write = generic_file_aio_write,
.mmap = generic_file_mmap, .mmap = generic_file_mmap,
.sendfile = generic_file_sendfile, .sendfile = generic_file_sendfile,
.fsync = jfs_fsync, .fsync = jfs_fsync,
.release = jfs_release, .release = jfs_release,
.ioctl = jfs_ioctl, .ioctl = jfs_ioctl,
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
void jfs_read_inode(struct inode *inode) void jfs_read_inode(struct inode *inode)
{ {
if (diRead(inode)) { if (diRead(inode)) {
make_bad_inode(inode); make_bad_inode(inode);
return; return;
} }
......
/* /*
* Copyright (c) International Business Machines Corp., 2002 * Copyright (C) International Business Machines Corp., 2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_ACL #ifndef _H_JFS_ACL
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_BTREE #ifndef _H_JFS_BTREE
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2001 * Copyright (C) International Business Machines Corp., 2000-2001
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_DINODE #ifndef _H_JFS_DINODE
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -30,28 +30,28 @@ ...@@ -30,28 +30,28 @@
* *
* the working state of the block allocation map is accessed in * the working state of the block allocation map is accessed in
* two directions: * two directions:
* *
* 1) allocation and free requests that start at the dmap * 1) allocation and free requests that start at the dmap
* level and move up through the dmap control pages (i.e. * level and move up through the dmap control pages (i.e.
* the vast majority of requests). * the vast majority of requests).
* *
* 2) allocation requests that start at dmap control page * 2) allocation requests that start at dmap control page
* level and work down towards the dmaps. * level and work down towards the dmaps.
*
* the serialization scheme used here is as follows.
* *
* requests which start at the bottom are serialized against each * the serialization scheme used here is as follows.
* other through buffers and each requests holds onto its buffers *
* as it works it way up from a single dmap to the required level * requests which start at the bottom are serialized against each
* other through buffers and each requests holds onto its buffers
* as it works it way up from a single dmap to the required level
* of dmap control page. * of dmap control page.
* requests that start at the top are serialized against each other * requests that start at the top are serialized against each other
* and request that start from the bottom by the multiple read/single * and request that start from the bottom by the multiple read/single
* write inode lock of the bmap inode. requests starting at the top * write inode lock of the bmap inode. requests starting at the top
* take this lock in write mode while request starting at the bottom * take this lock in write mode while request starting at the bottom
* take the lock in read mode. a single top-down request may proceed * take the lock in read mode. a single top-down request may proceed
* exclusively while multiple bottoms-up requests may proceed * exclusively while multiple bottoms-up requests may proceed
* simultaneously (under the protection of busy buffers). * simultaneously (under the protection of busy buffers).
* *
* in addition to information found in dmaps and dmap control pages, * in addition to information found in dmaps and dmap control pages,
* the working state of the block allocation map also includes read/ * the working state of the block allocation map also includes read/
* write information maintained in the bmap descriptor (i.e. total * write information maintained in the bmap descriptor (i.e. total
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
* a single exclusive lock (BMAP_LOCK) is used to guard this information * a single exclusive lock (BMAP_LOCK) is used to guard this information
* in the face of multiple-bottoms up requests. * in the face of multiple-bottoms up requests.
* (lock ordering: IREAD_LOCK, BMAP_LOCK); * (lock ordering: IREAD_LOCK, BMAP_LOCK);
* *
* accesses to the persistent state of the block allocation map (limited * accesses to the persistent state of the block allocation map (limited
* to the persistent bitmaps in dmaps) is guarded by (busy) buffers. * to the persistent bitmaps in dmaps) is guarded by (busy) buffers.
*/ */
...@@ -120,7 +120,7 @@ static int dbGetL2AGSize(s64 nblocks); ...@@ -120,7 +120,7 @@ static int dbGetL2AGSize(s64 nblocks);
/* /*
* buddy table * buddy table
* *
* table used for determining buddy sizes within characters of * table used for determining buddy sizes within characters of
* dmap bitmap words. the characters themselves serve as indexes * dmap bitmap words. the characters themselves serve as indexes
* into the table, with the table elements yielding the maximum * into the table, with the table elements yielding the maximum
* binary buddy of free bits within the character. * binary buddy of free bits within the character.
...@@ -146,7 +146,7 @@ static const s8 budtab[256] = { ...@@ -146,7 +146,7 @@ static const s8 budtab[256] = {
/* /*
* NAME: dbMount() * NAME: dbMount()
* *
* FUNCTION: initializate the block allocation map. * FUNCTION: initializate the block allocation map.
* *
...@@ -223,12 +223,12 @@ int dbMount(struct inode *ipbmap) ...@@ -223,12 +223,12 @@ int dbMount(struct inode *ipbmap)
/* /*
* NAME: dbUnmount() * NAME: dbUnmount()
* *
* FUNCTION: terminate the block allocation map in preparation for * FUNCTION: terminate the block allocation map in preparation for
* file system unmount. * file system unmount.
* *
* the in-core bmap descriptor is written to disk and * the in-core bmap descriptor is written to disk and
* the memory for this descriptor is freed. * the memory for this descriptor is freed.
* *
* PARAMETERS: * PARAMETERS:
...@@ -311,7 +311,7 @@ int dbSync(struct inode *ipbmap) ...@@ -311,7 +311,7 @@ int dbSync(struct inode *ipbmap)
/* /*
* NAME: dbFree() * NAME: dbFree()
* *
* FUNCTION: free the specified block range from the working block * FUNCTION: free the specified block range from the working block
* allocation map. * allocation map.
...@@ -397,7 +397,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks) ...@@ -397,7 +397,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
* *
* FUNCTION: update the allocation state (free or allocate) of the * FUNCTION: update the allocation state (free or allocate) of the
* specified block range in the persistent block allocation map. * specified block range in the persistent block allocation map.
* *
* the blocks will be updated in the persistent map one * the blocks will be updated in the persistent map one
* dmap at a time. * dmap at a time.
* *
...@@ -475,7 +475,7 @@ dbUpdatePMap(struct inode *ipbmap, ...@@ -475,7 +475,7 @@ dbUpdatePMap(struct inode *ipbmap,
/* update the bits of the dmap words. the first and last /* update the bits of the dmap words. the first and last
* words may only have a subset of their bits updated. if * words may only have a subset of their bits updated. if
* this is the case, we'll work against that word (i.e. * this is the case, we'll work against that word (i.e.
* partial first and/or last) only in a single pass. a * partial first and/or last) only in a single pass. a
* single pass will also be used to update all words that * single pass will also be used to update all words that
* are to have all their bits updated. * are to have all their bits updated.
*/ */
...@@ -662,11 +662,11 @@ int dbNextAG(struct inode *ipbmap) ...@@ -662,11 +662,11 @@ int dbNextAG(struct inode *ipbmap)
* the block allocation policy uses hints and a multi-step * the block allocation policy uses hints and a multi-step
* approach. * approach.
* *
* for allocation requests smaller than the number of blocks * for allocation requests smaller than the number of blocks
* per dmap, we first try to allocate the new blocks * per dmap, we first try to allocate the new blocks
* immediately following the hint. if these blocks are not * immediately following the hint. if these blocks are not
* available, we try to allocate blocks near the hint. if * available, we try to allocate blocks near the hint. if
* no blocks near the hint are available, we next try to * no blocks near the hint are available, we next try to
* allocate within the same dmap as contains the hint. * allocate within the same dmap as contains the hint.
* *
* if no blocks are available in the dmap or the allocation * if no blocks are available in the dmap or the allocation
...@@ -713,7 +713,7 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results) ...@@ -713,7 +713,7 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results)
#endif /* _STILL_TO_PORT */ #endif /* _STILL_TO_PORT */
/* get the log2 number of blocks to be allocated. /* get the log2 number of blocks to be allocated.
* if the number of blocks is not a log2 multiple, * if the number of blocks is not a log2 multiple,
* it will be rounded up to the next log2 multiple. * it will be rounded up to the next log2 multiple.
*/ */
l2nb = BLKSTOL2(nblocks); l2nb = BLKSTOL2(nblocks);
...@@ -906,7 +906,7 @@ int dbAllocExact(struct inode *ip, s64 blkno, int nblocks) ...@@ -906,7 +906,7 @@ int dbAllocExact(struct inode *ip, s64 blkno, int nblocks)
* validate extent request: * validate extent request:
* *
* note: defragfs policy: * note: defragfs policy:
* max 64 blocks will be moved. * max 64 blocks will be moved.
* allocation request size must be satisfied from a single dmap. * allocation request size must be satisfied from a single dmap.
*/ */
if (nblocks <= 0 || nblocks > BPERDMAP || blkno >= bmp->db_mapsize) { if (nblocks <= 0 || nblocks > BPERDMAP || blkno >= bmp->db_mapsize) {
...@@ -1333,7 +1333,7 @@ dbAllocNear(struct bmap * bmp, ...@@ -1333,7 +1333,7 @@ dbAllocNear(struct bmap * bmp,
* or two sub-trees, depending on the allocation group size. * or two sub-trees, depending on the allocation group size.
* we search the top nodes of these subtrees left to right for * we search the top nodes of these subtrees left to right for
* sufficient free space. if sufficient free space is found, * sufficient free space. if sufficient free space is found,
* the subtree is searched to find the leftmost leaf that * the subtree is searched to find the leftmost leaf that
* has free space. once we have made it to the leaf, we * has free space. once we have made it to the leaf, we
* move the search to the next lower level dmap control page * move the search to the next lower level dmap control page
* corresponding to this leaf. we continue down the dmap control * corresponding to this leaf. we continue down the dmap control
...@@ -1398,7 +1398,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results) ...@@ -1398,7 +1398,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
* that fully describes the allocation group since the allocation * that fully describes the allocation group since the allocation
* group is already fully described by a dmap. in this case, we * group is already fully described by a dmap. in this case, we
* just call dbAllocCtl() to search the dmap tree and allocate the * just call dbAllocCtl() to search the dmap tree and allocate the
* required space if available. * required space if available.
* *
* if the allocation group is completely free, dbAllocCtl() is * if the allocation group is completely free, dbAllocCtl() is
* also called to allocate the required space. this is done for * also called to allocate the required space. this is done for
...@@ -1450,7 +1450,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results) ...@@ -1450,7 +1450,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
(1 << (L2LPERCTL - (bmp->db_agheigth << 1))) / bmp->db_agwidth; (1 << (L2LPERCTL - (bmp->db_agheigth << 1))) / bmp->db_agwidth;
ti = bmp->db_agstart + bmp->db_agwidth * (agno & (agperlev - 1)); ti = bmp->db_agstart + bmp->db_agwidth * (agno & (agperlev - 1));
/* dmap control page trees fan-out by 4 and a single allocation /* dmap control page trees fan-out by 4 and a single allocation
* group may be described by 1 or 2 subtrees within the ag level * group may be described by 1 or 2 subtrees within the ag level
* dmap control page, depending upon the ag size. examine the ag's * dmap control page, depending upon the ag size. examine the ag's
* subtrees for sufficient free space, starting with the leftmost * subtrees for sufficient free space, starting with the leftmost
...@@ -1633,7 +1633,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno) ...@@ -1633,7 +1633,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
/* starting at the specified dmap control page level and block /* starting at the specified dmap control page level and block
* number, search down the dmap control levels for the starting * number, search down the dmap control levels for the starting
* block number of a dmap page that contains or starts off * block number of a dmap page that contains or starts off
* sufficient free blocks. * sufficient free blocks.
*/ */
for (lev = level, b = *blkno; lev >= 0; lev--) { for (lev = level, b = *blkno; lev >= 0; lev--) {
...@@ -1677,7 +1677,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno) ...@@ -1677,7 +1677,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
} }
/* adjust the block number to reflect the location within /* adjust the block number to reflect the location within
* the dmap control page (i.e. the leaf) at which free * the dmap control page (i.e. the leaf) at which free
* space was found. * space was found.
*/ */
b += (((s64) leafidx) << budmin); b += (((s64) leafidx) << budmin);
...@@ -1700,12 +1700,12 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno) ...@@ -1700,12 +1700,12 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
* NAME: dbAllocCtl() * NAME: dbAllocCtl()
* *
* FUNCTION: attempt to allocate a specified number of contiguous * FUNCTION: attempt to allocate a specified number of contiguous
* blocks starting within a specific dmap. * blocks starting within a specific dmap.
* *
* this routine is called by higher level routines that search * this routine is called by higher level routines that search
* the dmap control pages above the actual dmaps for contiguous * the dmap control pages above the actual dmaps for contiguous
* free space. the result of successful searches by these * free space. the result of successful searches by these
* routines are the starting block numbers within dmaps, with * routines are the starting block numbers within dmaps, with
* the dmaps themselves containing the desired contiguous free * the dmaps themselves containing the desired contiguous free
* space or starting a contiguous free space of desired size * space or starting a contiguous free space of desired size
* that is made up of the blocks of one or more dmaps. these * that is made up of the blocks of one or more dmaps. these
...@@ -1872,14 +1872,14 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results) ...@@ -1872,14 +1872,14 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
* *
* FUNCTION: attempt to allocate a specified number of contiguous blocks * FUNCTION: attempt to allocate a specified number of contiguous blocks
* from a specified dmap. * from a specified dmap.
* *
* this routine checks if the contiguous blocks are available. * this routine checks if the contiguous blocks are available.
* if so, nblocks of blocks are allocated; otherwise, ENOSPC is * if so, nblocks of blocks are allocated; otherwise, ENOSPC is
* returned. * returned.
* *
* PARAMETERS: * PARAMETERS:
* mp - pointer to bmap descriptor * mp - pointer to bmap descriptor
* dp - pointer to dmap to attempt to allocate blocks from. * dp - pointer to dmap to attempt to allocate blocks from.
* l2nb - log2 number of contiguous block desired. * l2nb - log2 number of contiguous block desired.
* nblocks - actual number of contiguous block desired. * nblocks - actual number of contiguous block desired.
* results - on successful return, set to the starting block number * results - on successful return, set to the starting block number
...@@ -1890,7 +1890,7 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results) ...@@ -1890,7 +1890,7 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
* -ENOSPC - insufficient disk resources * -ENOSPC - insufficient disk resources
* -EIO - i/o error * -EIO - i/o error
* *
* serialization: IREAD_LOCK(ipbmap), e.g., from dbAlloc(), or * serialization: IREAD_LOCK(ipbmap), e.g., from dbAlloc(), or
* IWRITE_LOCK(ipbmap), e.g., dbAllocCtl(), held on entry/exit; * IWRITE_LOCK(ipbmap), e.g., dbAllocCtl(), held on entry/exit;
*/ */
static int static int
...@@ -2032,7 +2032,7 @@ static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -2032,7 +2032,7 @@ static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
/* root changed. bubble the change up to the dmap control pages. /* root changed. bubble the change up to the dmap control pages.
* if the adjustment of the upper level control pages fails, * if the adjustment of the upper level control pages fails,
* backout the deallocation. * backout the deallocation.
*/ */
if ((rc = dbAdjCtl(bmp, blkno, dp->tree.stree[ROOT], 0, 0))) { if ((rc = dbAdjCtl(bmp, blkno, dp->tree.stree[ROOT], 0, 0))) {
word = (blkno & (BPERDMAP - 1)) >> L2DBWORD; word = (blkno & (BPERDMAP - 1)) >> L2DBWORD;
...@@ -2245,7 +2245,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -2245,7 +2245,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
* words (i.e. partial first and/or last) on an individual basis * words (i.e. partial first and/or last) on an individual basis
* (a single pass), freeing the bits of interest by hand and updating * (a single pass), freeing the bits of interest by hand and updating
* the leaf corresponding to the dmap word. a single pass will be used * the leaf corresponding to the dmap word. a single pass will be used
* for all dmap words fully contained within the specified range. * for all dmap words fully contained within the specified range.
* within this pass, the bits of all fully contained dmap words will * within this pass, the bits of all fully contained dmap words will
* be marked as free in a single shot and the leaves will be updated. a * be marked as free in a single shot and the leaves will be updated. a
* single leaf may describe the free space of multiple dmap words, * single leaf may describe the free space of multiple dmap words,
...@@ -2267,7 +2267,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -2267,7 +2267,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
*/ */
if (nb < DBWORD) { if (nb < DBWORD) {
/* free (zero) the appropriate bits within this /* free (zero) the appropriate bits within this
* dmap word. * dmap word.
*/ */
dp->wmap[word] &= dp->wmap[word] &=
cpu_to_le32(~(ONES << (DBWORD - nb) cpu_to_le32(~(ONES << (DBWORD - nb)
...@@ -2327,7 +2327,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -2327,7 +2327,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
BMAP_LOCK(bmp); BMAP_LOCK(bmp);
/* update the free count for the allocation group and /* update the free count for the allocation group and
* map. * map.
*/ */
agno = blkno >> bmp->db_agl2size; agno = blkno >> bmp->db_agl2size;
...@@ -2378,7 +2378,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -2378,7 +2378,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
* or deallocation resulted in the root change. this range * or deallocation resulted in the root change. this range
* is respresented by a single leaf of the current dmapctl * is respresented by a single leaf of the current dmapctl
* and the leaf will be updated with this value, possibly * and the leaf will be updated with this value, possibly
* causing a binary buddy system within the leaves to be * causing a binary buddy system within the leaves to be
* split or joined. the update may also cause the dmapctl's * split or joined. the update may also cause the dmapctl's
* dmtree to be updated. * dmtree to be updated.
* *
...@@ -2590,7 +2590,7 @@ static void dbSplit(dmtree_t * tp, int leafno, int splitsz, int newval) ...@@ -2590,7 +2590,7 @@ static void dbSplit(dmtree_t * tp, int leafno, int splitsz, int newval)
} }
} }
/* adjust the dmap tree to reflect the specified leaf's new /* adjust the dmap tree to reflect the specified leaf's new
* value. * value.
*/ */
dbAdjTree(tp, leafno, newval); dbAdjTree(tp, leafno, newval);
...@@ -2638,7 +2638,7 @@ static int dbBackSplit(dmtree_t * tp, int leafno) ...@@ -2638,7 +2638,7 @@ static int dbBackSplit(dmtree_t * tp, int leafno)
/* the back split is accomplished by iteratively finding the leaf /* the back split is accomplished by iteratively finding the leaf
* that starts the buddy system that contains the specified leaf and * that starts the buddy system that contains the specified leaf and
* splitting that system in two. this iteration continues until * splitting that system in two. this iteration continues until
* the specified leaf becomes the start of a buddy system. * the specified leaf becomes the start of a buddy system.
* *
* determine maximum possible l2 size for the specified leaf. * determine maximum possible l2 size for the specified leaf.
*/ */
...@@ -2853,7 +2853,7 @@ static void dbAdjTree(dmtree_t * tp, int leafno, int newval) ...@@ -2853,7 +2853,7 @@ static void dbAdjTree(dmtree_t * tp, int leafno, int newval)
* NAME: dbFindLeaf() * NAME: dbFindLeaf()
* *
* FUNCTION: search a dmtree_t for sufficient free blocks, returning * FUNCTION: search a dmtree_t for sufficient free blocks, returning
* the index of a leaf describing the free blocks if * the index of a leaf describing the free blocks if
* sufficient free blocks are found. * sufficient free blocks are found.
* *
* the search starts at the top of the dmtree_t tree and * the search starts at the top of the dmtree_t tree and
...@@ -2869,7 +2869,7 @@ static void dbAdjTree(dmtree_t * tp, int leafno, int newval) ...@@ -2869,7 +2869,7 @@ static void dbAdjTree(dmtree_t * tp, int leafno, int newval)
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -ENOSPC - insufficient free blocks. * -ENOSPC - insufficient free blocks.
*/ */
static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx) static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx)
{ {
...@@ -3090,7 +3090,7 @@ static int blkstol2(s64 nb) ...@@ -3090,7 +3090,7 @@ static int blkstol2(s64 nb)
/* /*
* NAME: dbAllocBottomUp() * NAME: dbAllocBottomUp()
* *
* FUNCTION: alloc the specified block range from the working block * FUNCTION: alloc the specified block range from the working block
* allocation map. * allocation map.
...@@ -3241,7 +3241,7 @@ static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -3241,7 +3241,7 @@ static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
BMAP_LOCK(bmp); BMAP_LOCK(bmp);
/* if this allocation group is completely free, /* if this allocation group is completely free,
* update the highest active allocation group number * update the highest active allocation group number
* if this allocation group is the new max. * if this allocation group is the new max.
*/ */
agno = blkno >> bmp->db_agl2size; agno = blkno >> bmp->db_agl2size;
...@@ -3273,7 +3273,7 @@ static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -3273,7 +3273,7 @@ static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
* NAME: dbExtendFS() * NAME: dbExtendFS()
* *
* FUNCTION: extend bmap from blkno for nblocks; * FUNCTION: extend bmap from blkno for nblocks;
* dbExtendFS() updates bmap ready for dbAllocBottomUp(); * dbExtendFS() updates bmap ready for dbAllocBottomUp();
* *
* L2 * L2
* | * |
...@@ -3284,7 +3284,7 @@ static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -3284,7 +3284,7 @@ static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
* d0,...,dn d0,...,dn d0,...,dn d0,...,dn d0,...,dn d0,.,dm; * d0,...,dn d0,...,dn d0,...,dn d0,...,dn d0,...,dn d0,.,dm;
* L2L1L0d0,...,dnL0d0,...,dnL0d0,...,dnL1L0d0,...,dnL0d0,...,dnL0d0,..dm * L2L1L0d0,...,dnL0d0,...,dnL0d0,...,dnL1L0d0,...,dnL0d0,...,dnL0d0,..dm
* *
* <---old---><----------------------------extend-----------------------> * <---old---><----------------------------extend----------------------->
*/ */
int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)
{ {
...@@ -3330,7 +3330,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) ...@@ -3330,7 +3330,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)
bmp->db_numag += ((u32) newsize % (u32) bmp->db_agsize) ? 1 : 0; bmp->db_numag += ((u32) newsize % (u32) bmp->db_agsize) ? 1 : 0;
/* /*
* reconfigure db_agfree[] * reconfigure db_agfree[]
* from old AG configuration to new AG configuration; * from old AG configuration to new AG configuration;
* *
* coalesce contiguous k (newAGSize/oldAGSize) AGs; * coalesce contiguous k (newAGSize/oldAGSize) AGs;
...@@ -3491,7 +3491,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) ...@@ -3491,7 +3491,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)
} /* for each dmap in a L0 */ } /* for each dmap in a L0 */
/* /*
* build current L0 page from its leaves, and * build current L0 page from its leaves, and
* initialize corresponding parent L1 leaf * initialize corresponding parent L1 leaf
*/ */
*l1leaf = dbInitDmapCtl(l0dcp, 0, ++i); *l1leaf = dbInitDmapCtl(l0dcp, 0, ++i);
...@@ -3515,7 +3515,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) ...@@ -3515,7 +3515,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)
} /* for each L0 in a L1 */ } /* for each L0 in a L1 */
/* /*
* build current L1 page from its leaves, and * build current L1 page from its leaves, and
* initialize corresponding parent L2 leaf * initialize corresponding parent L2 leaf
*/ */
*l2leaf = dbInitDmapCtl(l1dcp, 1, ++j); *l2leaf = dbInitDmapCtl(l1dcp, 1, ++j);
...@@ -3570,7 +3570,7 @@ void dbFinalizeBmap(struct inode *ipbmap) ...@@ -3570,7 +3570,7 @@ void dbFinalizeBmap(struct inode *ipbmap)
* finalize bmap control page * finalize bmap control page
*/ */
//finalize: //finalize:
/* /*
* compute db_agpref: preferred ag to allocate from * compute db_agpref: preferred ag to allocate from
* (the leftmost ag with average free space in it); * (the leftmost ag with average free space in it);
*/ */
...@@ -3614,9 +3614,9 @@ void dbFinalizeBmap(struct inode *ipbmap) ...@@ -3614,9 +3614,9 @@ void dbFinalizeBmap(struct inode *ipbmap)
/* /*
* compute db_aglevel, db_agheigth, db_width, db_agstart: * compute db_aglevel, db_agheigth, db_width, db_agstart:
* an ag is covered in aglevel dmapctl summary tree, * an ag is covered in aglevel dmapctl summary tree,
* at agheight level height (from leaf) with agwidth number of nodes * at agheight level height (from leaf) with agwidth number of nodes
* each, which starts at agstart index node of the smmary tree node * each, which starts at agstart index node of the smmary tree node
* array; * array;
*/ */
bmp->db_aglevel = BMAPSZTOLEV(bmp->db_agsize); bmp->db_aglevel = BMAPSZTOLEV(bmp->db_agsize);
...@@ -3635,13 +3635,13 @@ void dbFinalizeBmap(struct inode *ipbmap) ...@@ -3635,13 +3635,13 @@ void dbFinalizeBmap(struct inode *ipbmap)
/* /*
* NAME: dbInitDmap()/ujfs_idmap_page() * NAME: dbInitDmap()/ujfs_idmap_page()
* *
* FUNCTION: initialize working/persistent bitmap of the dmap page * FUNCTION: initialize working/persistent bitmap of the dmap page
* for the specified number of blocks: * for the specified number of blocks:
* *
* at entry, the bitmaps had been initialized as free (ZEROS); * at entry, the bitmaps had been initialized as free (ZEROS);
* The number of blocks will only account for the actually * The number of blocks will only account for the actually
* existing blocks. Blocks which don't actually exist in * existing blocks. Blocks which don't actually exist in
* the aggregate will be marked as allocated (ONES); * the aggregate will be marked as allocated (ONES);
* *
* PARAMETERS: * PARAMETERS:
...@@ -3677,7 +3677,7 @@ static int dbInitDmap(struct dmap * dp, s64 Blkno, int nblocks) ...@@ -3677,7 +3677,7 @@ static int dbInitDmap(struct dmap * dp, s64 Blkno, int nblocks)
/* /*
* free the bits corresponding to the block range (ZEROS): * free the bits corresponding to the block range (ZEROS):
* note: not all bits of the first and last words may be contained * note: not all bits of the first and last words may be contained
* within the block range. * within the block range.
*/ */
for (r = nblocks; r > 0; r -= nb, blkno += nb) { for (r = nblocks; r > 0; r -= nb, blkno += nb) {
...@@ -3709,7 +3709,7 @@ static int dbInitDmap(struct dmap * dp, s64 Blkno, int nblocks) ...@@ -3709,7 +3709,7 @@ static int dbInitDmap(struct dmap * dp, s64 Blkno, int nblocks)
} }
/* /*
* mark bits following the range to be freed (non-existing * mark bits following the range to be freed (non-existing
* blocks) as allocated (ONES) * blocks) as allocated (ONES)
*/ */
...@@ -3741,11 +3741,11 @@ static int dbInitDmap(struct dmap * dp, s64 Blkno, int nblocks) ...@@ -3741,11 +3741,11 @@ static int dbInitDmap(struct dmap * dp, s64 Blkno, int nblocks)
/* /*
* NAME: dbInitDmapTree()/ujfs_complete_dmap() * NAME: dbInitDmapTree()/ujfs_complete_dmap()
* *
* FUNCTION: initialize summary tree of the specified dmap: * FUNCTION: initialize summary tree of the specified dmap:
* *
* at entry, bitmap of the dmap has been initialized; * at entry, bitmap of the dmap has been initialized;
* *
* PARAMETERS: * PARAMETERS:
* dp - dmap to complete * dp - dmap to complete
* blkno - starting block number for this dmap * blkno - starting block number for this dmap
...@@ -3769,7 +3769,7 @@ static int dbInitDmapTree(struct dmap * dp) ...@@ -3769,7 +3769,7 @@ static int dbInitDmapTree(struct dmap * dp)
/* init each leaf from corresponding wmap word: /* init each leaf from corresponding wmap word:
* note: leaf is set to NOFREE(-1) if all blocks of corresponding * note: leaf is set to NOFREE(-1) if all blocks of corresponding
* bitmap word are allocated. * bitmap word are allocated.
*/ */
cp = tp->stree + le32_to_cpu(tp->leafidx); cp = tp->stree + le32_to_cpu(tp->leafidx);
for (i = 0; i < LPERDMAP; i++) for (i = 0; i < LPERDMAP; i++)
...@@ -3782,10 +3782,10 @@ static int dbInitDmapTree(struct dmap * dp) ...@@ -3782,10 +3782,10 @@ static int dbInitDmapTree(struct dmap * dp)
/* /*
* NAME: dbInitTree()/ujfs_adjtree() * NAME: dbInitTree()/ujfs_adjtree()
* *
* FUNCTION: initialize binary buddy summary tree of a dmap or dmapctl. * FUNCTION: initialize binary buddy summary tree of a dmap or dmapctl.
* *
* at entry, the leaves of the tree has been initialized * at entry, the leaves of the tree has been initialized
* from corresponding bitmap word or root of summary tree * from corresponding bitmap word or root of summary tree
* of the child control page; * of the child control page;
* configure binary buddy system at the leaf level, then * configure binary buddy system at the leaf level, then
...@@ -3813,15 +3813,15 @@ static int dbInitTree(struct dmaptree * dtp) ...@@ -3813,15 +3813,15 @@ static int dbInitTree(struct dmaptree * dtp)
/* /*
* configure the leaf levevl into binary buddy system * configure the leaf levevl into binary buddy system
* *
* Try to combine buddies starting with a buddy size of 1 * Try to combine buddies starting with a buddy size of 1
* (i.e. two leaves). At a buddy size of 1 two buddy leaves * (i.e. two leaves). At a buddy size of 1 two buddy leaves
* can be combined if both buddies have a maximum free of l2min; * can be combined if both buddies have a maximum free of l2min;
* the combination will result in the left-most buddy leaf having * the combination will result in the left-most buddy leaf having
* a maximum free of l2min+1. * a maximum free of l2min+1.
* After processing all buddies for a given size, process buddies * After processing all buddies for a given size, process buddies
* at the next higher buddy size (i.e. current size * 2) and * at the next higher buddy size (i.e. current size * 2) and
* the next maximum free (current free + 1). * the next maximum free (current free + 1).
* This continues until the maximum possible buddy combination * This continues until the maximum possible buddy combination
* yields maximum free. * yields maximum free.
*/ */
for (l2free = dtp->budmin, bsize = 1; l2free < l2max; for (l2free = dtp->budmin, bsize = 1; l2free < l2max;
...@@ -3845,10 +3845,10 @@ static int dbInitTree(struct dmaptree * dtp) ...@@ -3845,10 +3845,10 @@ static int dbInitTree(struct dmaptree * dtp)
* bubble summary information of leaves up the tree. * bubble summary information of leaves up the tree.
* *
* Starting at the leaf node level, the four nodes described by * Starting at the leaf node level, the four nodes described by
* the higher level parent node are compared for a maximum free and * the higher level parent node are compared for a maximum free and
* this maximum becomes the value of the parent node. * this maximum becomes the value of the parent node.
* when all lower level nodes are processed in this fashion then * when all lower level nodes are processed in this fashion then
* move up to the next level (parent becomes a lower level node) and * move up to the next level (parent becomes a lower level node) and
* continue the process for that level. * continue the process for that level.
*/ */
for (child = le32_to_cpu(dtp->leafidx), for (child = le32_to_cpu(dtp->leafidx),
...@@ -3857,7 +3857,7 @@ static int dbInitTree(struct dmaptree * dtp) ...@@ -3857,7 +3857,7 @@ static int dbInitTree(struct dmaptree * dtp)
/* get index of 1st node of parent level */ /* get index of 1st node of parent level */
parent = (child - 1) >> 2; parent = (child - 1) >> 2;
/* set the value of the parent node as the maximum /* set the value of the parent node as the maximum
* of the four nodes of the current level. * of the four nodes of the current level.
*/ */
for (i = 0, cp = tp + child, cp1 = tp + parent; for (i = 0, cp = tp + child, cp1 = tp + parent;
...@@ -3885,8 +3885,8 @@ static int dbInitDmapCtl(struct dmapctl * dcp, int level, int i) ...@@ -3885,8 +3885,8 @@ static int dbInitDmapCtl(struct dmapctl * dcp, int level, int i)
dcp->budmin = L2BPERDMAP + L2LPERCTL * level; dcp->budmin = L2BPERDMAP + L2LPERCTL * level;
/* /*
* initialize the leaves of current level that were not covered * initialize the leaves of current level that were not covered
* by the specified input block range (i.e. the leaves have no * by the specified input block range (i.e. the leaves have no
* low level dmapctl or dmap). * low level dmapctl or dmap).
*/ */
cp = &dcp->stree[CTLLEAFIND + i]; cp = &dcp->stree[CTLLEAFIND + i];
...@@ -3900,9 +3900,9 @@ static int dbInitDmapCtl(struct dmapctl * dcp, int level, int i) ...@@ -3900,9 +3900,9 @@ static int dbInitDmapCtl(struct dmapctl * dcp, int level, int i)
/* /*
* NAME: dbGetL2AGSize()/ujfs_getagl2size() * NAME: dbGetL2AGSize()/ujfs_getagl2size()
* *
* FUNCTION: Determine log2(allocation group size) from aggregate size * FUNCTION: Determine log2(allocation group size) from aggregate size
* *
* PARAMETERS: * PARAMETERS:
* nblocks - Number of blocks in aggregate * nblocks - Number of blocks in aggregate
* *
...@@ -3935,8 +3935,8 @@ static int dbGetL2AGSize(s64 nblocks) ...@@ -3935,8 +3935,8 @@ static int dbGetL2AGSize(s64 nblocks)
/* /*
* NAME: dbMapFileSizeToMapSize() * NAME: dbMapFileSizeToMapSize()
* *
* FUNCTION: compute number of blocks the block allocation map file * FUNCTION: compute number of blocks the block allocation map file
* can cover from the map file size; * can cover from the map file size;
* *
* RETURNS: Number of blocks which can be covered by this block map file; * RETURNS: Number of blocks which can be covered by this block map file;
...@@ -3968,7 +3968,7 @@ s64 dbMapFileSizeToMapSize(struct inode * ipbmap) ...@@ -3968,7 +3968,7 @@ s64 dbMapFileSizeToMapSize(struct inode * ipbmap)
npages = nblocks >> JFS_SBI(sb)->l2nbperpage; npages = nblocks >> JFS_SBI(sb)->l2nbperpage;
level = BMAPPGTOLEV(npages); level = BMAPPGTOLEV(npages);
/* At each level, accumulate the number of dmap pages covered by /* At each level, accumulate the number of dmap pages covered by
* the number of full child levels below it; * the number of full child levels below it;
* repeat for the last incomplete child level. * repeat for the last incomplete child level.
*/ */
...@@ -3990,7 +3990,7 @@ s64 dbMapFileSizeToMapSize(struct inode * ipbmap) ...@@ -3990,7 +3990,7 @@ s64 dbMapFileSizeToMapSize(struct inode * ipbmap)
npages--; npages--;
} }
/* convert the number of dmaps into the number of blocks /* convert the number of dmaps into the number of blocks
* which can be covered by the dmaps; * which can be covered by the dmaps;
*/ */
nblocks = ndmaps << L2BPERDMAP; nblocks = ndmaps << L2BPERDMAP;
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_DMAP #ifndef _H_JFS_DMAP
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define L2LPERDMAP 8 /* l2 number of leaves per dmap tree */ #define L2LPERDMAP 8 /* l2 number of leaves per dmap tree */
#define DBWORD 32 /* # of blks covered by a map word */ #define DBWORD 32 /* # of blks covered by a map word */
#define L2DBWORD 5 /* l2 # of blks covered by a mword */ #define L2DBWORD 5 /* l2 # of blks covered by a mword */
#define BUDMIN L2DBWORD /* max free string in a map word */ #define BUDMIN L2DBWORD /* max free string in a map word */
#define BPERDMAP (LPERDMAP * DBWORD) /* num of blks per dmap */ #define BPERDMAP (LPERDMAP * DBWORD) /* num of blks per dmap */
#define L2BPERDMAP 13 /* l2 num of blks per dmap */ #define L2BPERDMAP 13 /* l2 num of blks per dmap */
#define CTLTREESIZE (1024+256+64+16+4+1) /* size of a dmapctl tree */ #define CTLTREESIZE (1024+256+64+16+4+1) /* size of a dmapctl tree */
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#define MAXMAPSIZE MAXL2SIZE /* maximum aggregate map size */ #define MAXMAPSIZE MAXL2SIZE /* maximum aggregate map size */
/* /*
* determine the maximum free string for four (lower level) nodes * determine the maximum free string for four (lower level) nodes
* of the tree. * of the tree.
*/ */
...@@ -122,7 +122,7 @@ static __inline signed char TREEMAX(signed char *cp) ...@@ -122,7 +122,7 @@ static __inline signed char TREEMAX(signed char *cp)
#define BLKTOCTL(b,s,l) \ #define BLKTOCTL(b,s,l) \
(((l) == 2) ? 1 : ((l) == 1) ? BLKTOL1((b),(s)) : BLKTOL0((b),(s))) (((l) == 2) ? 1 : ((l) == 1) ? BLKTOL1((b),(s)) : BLKTOL0((b),(s)))
/* /*
* convert aggregate map size to the zero origin dmapctl level of the * convert aggregate map size to the zero origin dmapctl level of the
* top dmapctl. * top dmapctl.
*/ */
...@@ -192,13 +192,13 @@ typedef union dmtree { ...@@ -192,13 +192,13 @@ typedef union dmtree {
/* macros for accessing fields within dmtree */ /* macros for accessing fields within dmtree */
#define dmt_nleafs t1.nleafs #define dmt_nleafs t1.nleafs
#define dmt_l2nleafs t1.l2nleafs #define dmt_l2nleafs t1.l2nleafs
#define dmt_leafidx t1.leafidx #define dmt_leafidx t1.leafidx
#define dmt_height t1.height #define dmt_height t1.height
#define dmt_budmin t1.budmin #define dmt_budmin t1.budmin
#define dmt_stree t1.stree #define dmt_stree t1.stree
/* /*
* on-disk aggregate disk allocation map descriptor. * on-disk aggregate disk allocation map descriptor.
*/ */
struct dbmap_disk { struct dbmap_disk {
...@@ -237,7 +237,7 @@ struct dbmap { ...@@ -237,7 +237,7 @@ struct dbmap {
s64 dn_agsize; /* num of blks per alloc group */ s64 dn_agsize; /* num of blks per alloc group */
signed char dn_maxfreebud; /* max free buddy system */ signed char dn_maxfreebud; /* max free buddy system */
}; /* - 4096 - */ }; /* - 4096 - */
/* /*
* in-memory aggregate disk allocation map descriptor. * in-memory aggregate disk allocation map descriptor.
*/ */
struct bmap { struct bmap {
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
* *
* case-insensitive search: * case-insensitive search:
* *
* fold search key; * fold search key;
* *
* case-insensitive search of B-tree: * case-insensitive search of B-tree:
* for internal entry, router key is already folded; * for internal entry, router key is already folded;
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
* else * else
* return no match; * return no match;
* *
* serialization: * serialization:
* target directory inode lock is being held on entry/exit * target directory inode lock is being held on entry/exit
* of all main directory service routines. * of all main directory service routines.
* *
...@@ -925,7 +925,7 @@ int dtInsert(tid_t tid, struct inode *ip, ...@@ -925,7 +925,7 @@ int dtInsert(tid_t tid, struct inode *ip,
* *
* return: 0 - success; * return: 0 - success;
* errno - failure; * errno - failure;
* leaf page unpinned; * leaf page unpinned;
*/ */
static int dtSplitUp(tid_t tid, static int dtSplitUp(tid_t tid,
struct inode *ip, struct dtsplit * split, struct btstack * btstack) struct inode *ip, struct dtsplit * split, struct btstack * btstack)
...@@ -3767,7 +3767,7 @@ static int ciCompare(struct component_name * key, /* search key */ ...@@ -3767,7 +3767,7 @@ static int ciCompare(struct component_name * key, /* search key */
* across page boundary * across page boundary
* *
* return: non-zero on error * return: non-zero on error
* *
*/ */
static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp, static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
int ri, struct component_name * key, int flag) int ri, struct component_name * key, int flag)
...@@ -3780,13 +3780,13 @@ static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp, ...@@ -3780,13 +3780,13 @@ static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
lkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), lkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
GFP_KERNEL); GFP_KERNEL);
if (lkey.name == NULL) if (lkey.name == NULL)
return -ENOSPC; return -ENOMEM;
rkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), rkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
GFP_KERNEL); GFP_KERNEL);
if (rkey.name == NULL) { if (rkey.name == NULL) {
kfree(lkey.name); kfree(lkey.name);
return -ENOSPC; return -ENOMEM;
} }
/* get left and right key */ /* get left and right key */
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_DTREE #ifndef _H_JFS_DTREE
...@@ -80,7 +80,7 @@ struct idtentry { ...@@ -80,7 +80,7 @@ struct idtentry {
/* /*
* leaf node entry head/only segment * leaf node entry head/only segment
* *
* For legacy filesystems, name contains 13 wchars -- no index field * For legacy filesystems, name contains 13 wchars -- no index field
*/ */
struct ldtentry { struct ldtentry {
__le32 inumber; /* 4: 4-byte aligned */ __le32 inumber; /* 4: 4-byte aligned */
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -125,7 +125,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr) ...@@ -125,7 +125,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
} }
/* allocate the disk blocks for the extent. initially, extBalloc() /* allocate the disk blocks for the extent. initially, extBalloc()
* will try to allocate disk blocks for the requested size (xlen). * will try to allocate disk blocks for the requested size (xlen).
* if this fails (xlen contiguous free blocks not avaliable), it'll * if this fails (xlen contiguous free blocks not avaliable), it'll
* try to allocate a smaller number of blocks (producing a smaller * try to allocate a smaller number of blocks (producing a smaller
* extent), with this smaller number of blocks consisting of the * extent), with this smaller number of blocks consisting of the
...@@ -150,7 +150,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr) ...@@ -150,7 +150,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
/* determine the value of the extent flag */ /* determine the value of the extent flag */
xflag = abnr ? XAD_NOTRECORDED : 0; xflag = abnr ? XAD_NOTRECORDED : 0;
/* if we can extend the hint extent to cover the current request, /* if we can extend the hint extent to cover the current request,
* extend it. otherwise, insert a new extent to * extend it. otherwise, insert a new extent to
* cover the current request. * cover the current request.
*/ */
...@@ -159,7 +159,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr) ...@@ -159,7 +159,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
else else
rc = xtInsert(0, ip, xflag, xoff, (int) nxlen, &nxaddr, 0); rc = xtInsert(0, ip, xflag, xoff, (int) nxlen, &nxaddr, 0);
/* if the extend or insert failed, /* if the extend or insert failed,
* free the newly allocated blocks and return the error. * free the newly allocated blocks and return the error.
*/ */
if (rc) { if (rc) {
...@@ -235,7 +235,7 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr) ...@@ -235,7 +235,7 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr)
xoff = offsetXAD(xp); xoff = offsetXAD(xp);
/* if the extend page is abnr and if the request is for /* if the extend page is abnr and if the request is for
* the extent to be allocated and recorded, * the extent to be allocated and recorded,
* make the page allocated and recorded. * make the page allocated and recorded.
*/ */
if ((xp->flag & XAD_NOTRECORDED) && !abnr) { if ((xp->flag & XAD_NOTRECORDED) && !abnr) {
...@@ -397,7 +397,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp) ...@@ -397,7 +397,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
if ((rc = xtLookupList(ip, &lxdl, &xadl, 0))) if ((rc = xtLookupList(ip, &lxdl, &xadl, 0)))
return (rc); return (rc);
/* check if not extent exists for the previous page. /* check if not extent exists for the previous page.
* this is possible for sparse files. * this is possible for sparse files.
*/ */
if (xadl.nxad == 0) { if (xadl.nxad == 0) {
...@@ -410,7 +410,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp) ...@@ -410,7 +410,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
*/ */
xp->flag &= XAD_NOTRECORDED; xp->flag &= XAD_NOTRECORDED;
if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) { if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) {
jfs_error(ip->i_sb, "extHint: corrupt xtree"); jfs_error(ip->i_sb, "extHint: corrupt xtree");
return -EIO; return -EIO;
} }
...@@ -492,7 +492,7 @@ int extFill(struct inode *ip, xad_t * xp) ...@@ -492,7 +492,7 @@ int extFill(struct inode *ip, xad_t * xp)
* FUNCTION: allocate disk blocks to form an extent. * FUNCTION: allocate disk blocks to form an extent.
* *
* initially, we will try to allocate disk blocks for the * initially, we will try to allocate disk blocks for the
* requested size (nblocks). if this fails (nblocks * requested size (nblocks). if this fails (nblocks
* contiguous free blocks not avaliable), we'll try to allocate * contiguous free blocks not avaliable), we'll try to allocate
* a smaller number of blocks (producing a smaller extent), with * a smaller number of blocks (producing a smaller extent), with
* this smaller number of blocks consisting of the requested * this smaller number of blocks consisting of the requested
...@@ -500,7 +500,7 @@ int extFill(struct inode *ip, xad_t * xp) ...@@ -500,7 +500,7 @@ int extFill(struct inode *ip, xad_t * xp)
* number (i.e. 16 -> 8). we'll continue to round down and * number (i.e. 16 -> 8). we'll continue to round down and
* retry the allocation until the number of blocks to allocate * retry the allocation until the number of blocks to allocate
* is smaller than the number of blocks per page. * is smaller than the number of blocks per page.
* *
* PARAMETERS: * PARAMETERS:
* ip - the inode of the file. * ip - the inode of the file.
* hint - disk block number to be used as an allocation hint. * hint - disk block number to be used as an allocation hint.
...@@ -509,7 +509,7 @@ int extFill(struct inode *ip, xad_t * xp) ...@@ -509,7 +509,7 @@ int extFill(struct inode *ip, xad_t * xp)
* exit, this value is set to the number of blocks actually * exit, this value is set to the number of blocks actually
* allocated. * allocated.
* blkno - pointer to a block address that is filled in on successful * blkno - pointer to a block address that is filled in on successful
* return with the starting block number of the newly * return with the starting block number of the newly
* allocated block range. * allocated block range.
* *
* RETURN VALUES: * RETURN VALUES:
...@@ -530,7 +530,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) ...@@ -530,7 +530,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
/* get the number of blocks to initially attempt to allocate. /* get the number of blocks to initially attempt to allocate.
* we'll first try the number of blocks requested unless this * we'll first try the number of blocks requested unless this
* number is greater than the maximum number of contiguous free * number is greater than the maximum number of contiguous free
* blocks in the map. in that case, we'll start off with the * blocks in the map. in that case, we'll start off with the
* maximum free. * maximum free.
*/ */
max = (s64) 1 << bmp->db_maxfreebud; max = (s64) 1 << bmp->db_maxfreebud;
...@@ -582,19 +582,19 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) ...@@ -582,19 +582,19 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
* *
* FUNCTION: attempt to extend an extent's allocation. * FUNCTION: attempt to extend an extent's allocation.
* *
* initially, we will try to extend the extent's allocation * Initially, we will try to extend the extent's allocation
* in place. if this fails, we'll try to move the extent * in place. If this fails, we'll try to move the extent
* to a new set of blocks. if moving the extent, we initially * to a new set of blocks. If moving the extent, we initially
* will try to allocate disk blocks for the requested size * will try to allocate disk blocks for the requested size
* (nnew). if this fails (new contiguous free blocks not * (newnblks). if this fails (new contiguous free blocks not
* avaliable), we'll try to allocate a smaller number of * avaliable), we'll try to allocate a smaller number of
* blocks (producing a smaller extent), with this smaller * blocks (producing a smaller extent), with this smaller
* number of blocks consisting of the requested number of * number of blocks consisting of the requested number of
* blocks rounded down to the next smaller power of 2 * blocks rounded down to the next smaller power of 2
* number (i.e. 16 -> 8). we'll continue to round down and * number (i.e. 16 -> 8). We'll continue to round down and
* retry the allocation until the number of blocks to allocate * retry the allocation until the number of blocks to allocate
* is smaller than the number of blocks per page. * is smaller than the number of blocks per page.
* *
* PARAMETERS: * PARAMETERS:
* ip - the inode of the file. * ip - the inode of the file.
* blkno - starting block number of the extents current allocation. * blkno - starting block number of the extents current allocation.
...@@ -625,7 +625,7 @@ extBrealloc(struct inode *ip, ...@@ -625,7 +625,7 @@ extBrealloc(struct inode *ip,
return (rc); return (rc);
} }
/* in place extension not possible. /* in place extension not possible.
* try to move the extent to a new set of blocks. * try to move the extent to a new set of blocks.
*/ */
return (extBalloc(ip, blkno, newnblks, newblkno)); return (extBalloc(ip, blkno, newnblks, newblkno));
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2001 * Copyright (C) International Business Machines Corp., 2000-2001
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_EXTENT #ifndef _H_JFS_EXTENT
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_FILSYS #ifndef _H_JFS_FILSYS
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
/* /*
* jfs_filsys.h * jfs_filsys.h
* *
* file system (implementation-dependent) constants * file system (implementation-dependent) constants
* *
* refer to <limits.h> for system wide implementation-dependent constants * refer to <limits.h> for system wide implementation-dependent constants
*/ */
/* /*
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#define JFS_DFS 0x20000000 /* DCE DFS LFS support */ #define JFS_DFS 0x20000000 /* DCE DFS LFS support */
#define JFS_LINUX 0x10000000 /* Linux support */ #define JFS_LINUX 0x10000000 /* Linux support */
/* case-sensitive name/directory support */ /* case-sensitive name/directory support */
/* directory option */ /* directory option */
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#define JFS_COMMIT 0x00000f00 /* commit option mask */ #define JFS_COMMIT 0x00000f00 /* commit option mask */
#define JFS_GROUPCOMMIT 0x00000100 /* group (of 1) commit */ #define JFS_GROUPCOMMIT 0x00000100 /* group (of 1) commit */
#define JFS_LAZYCOMMIT 0x00000200 /* lazy commit */ #define JFS_LAZYCOMMIT 0x00000200 /* lazy commit */
#define JFS_TMPFS 0x00000400 /* temporary file system - #define JFS_TMPFS 0x00000400 /* temporary file system -
* do not log/commit: * do not log/commit:
*/ */
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
* followed by 1st extent of map * followed by 1st extent of map
*/ */
#define AITBL_OFF (AIMAP_OFF + (SIZE_OF_MAP_PAGE << 1)) #define AITBL_OFF (AIMAP_OFF + (SIZE_OF_MAP_PAGE << 1))
/* /*
* 1st extent of aggregate inode table * 1st extent of aggregate inode table
*/ */
#define SUPER2_OFF (AITBL_OFF + INODE_EXTENT_SIZE) #define SUPER2_OFF (AITBL_OFF + INODE_EXTENT_SIZE)
...@@ -270,13 +270,13 @@ ...@@ -270,13 +270,13 @@
*/ */
#define FM_CLEAN 0x00000000 /* file system is unmounted and clean */ #define FM_CLEAN 0x00000000 /* file system is unmounted and clean */
#define FM_MOUNT 0x00000001 /* file system is mounted cleanly */ #define FM_MOUNT 0x00000001 /* file system is mounted cleanly */
#define FM_DIRTY 0x00000002 /* file system was not unmounted and clean #define FM_DIRTY 0x00000002 /* file system was not unmounted and clean
* when mounted or * when mounted or
* commit failure occurred while being mounted: * commit failure occurred while being mounted:
* fsck() must be run to repair * fsck() must be run to repair
*/ */
#define FM_LOGREDO 0x00000004 /* log based recovery (logredo()) failed: #define FM_LOGREDO 0x00000004 /* log based recovery (logredo()) failed:
* fsck() must be run to repair * fsck() must be run to repair
*/ */
#define FM_EXTENDFS 0x00000008 /* file system extendfs() in progress */ #define FM_EXTENDFS 0x00000008 /* file system extendfs() in progress */
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -98,7 +98,7 @@ static void copy_to_dinode(struct dinode *, struct inode *); ...@@ -98,7 +98,7 @@ static void copy_to_dinode(struct dinode *, struct inode *);
* FUNCTION: initialize the incore inode map control structures for * FUNCTION: initialize the incore inode map control structures for
* a fileset or aggregate init time. * a fileset or aggregate init time.
* *
* the inode map's control structure (dinomap) is * the inode map's control structure (dinomap) is
* brought in from disk and placed in virtual memory. * brought in from disk and placed in virtual memory.
* *
* PARAMETERS: * PARAMETERS:
...@@ -107,7 +107,7 @@ static void copy_to_dinode(struct dinode *, struct inode *); ...@@ -107,7 +107,7 @@ static void copy_to_dinode(struct dinode *, struct inode *);
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -ENOMEM - insufficient free virtual memory. * -ENOMEM - insufficient free virtual memory.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
int diMount(struct inode *ipimap) int diMount(struct inode *ipimap)
{ {
...@@ -191,7 +191,7 @@ int diMount(struct inode *ipimap) ...@@ -191,7 +191,7 @@ int diMount(struct inode *ipimap)
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -ENOMEM - insufficient free virtual memory. * -ENOMEM - insufficient free virtual memory.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
int diUnmount(struct inode *ipimap, int mounterror) int diUnmount(struct inode *ipimap, int mounterror)
{ {
...@@ -281,7 +281,7 @@ int diSync(struct inode *ipimap) ...@@ -281,7 +281,7 @@ int diSync(struct inode *ipimap)
* on entry, the specifed incore inode should itself * on entry, the specifed incore inode should itself
* specify the disk inode number corresponding to the * specify the disk inode number corresponding to the
* incore inode (i.e. i_number should be initialized). * incore inode (i.e. i_number should be initialized).
* *
* this routine handles incore inode initialization for * this routine handles incore inode initialization for
* both "special" and "regular" inodes. special inodes * both "special" and "regular" inodes. special inodes
* are those required early in the mount process and * are those required early in the mount process and
...@@ -289,7 +289,7 @@ int diSync(struct inode *ipimap) ...@@ -289,7 +289,7 @@ int diSync(struct inode *ipimap)
* is not yet initialized. these "special" inodes are * is not yet initialized. these "special" inodes are
* identified by a NULL inode map inode pointer and are * identified by a NULL inode map inode pointer and are
* actually initialized by a call to diReadSpecial(). * actually initialized by a call to diReadSpecial().
* *
* for regular inodes, the iag describing the disk inode * for regular inodes, the iag describing the disk inode
* is read from disk to determine the inode extent address * is read from disk to determine the inode extent address
* for the disk inode. with the inode extent address in * for the disk inode. with the inode extent address in
...@@ -302,9 +302,9 @@ int diSync(struct inode *ipimap) ...@@ -302,9 +302,9 @@ int diSync(struct inode *ipimap)
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
* -ENOMEM - insufficient memory * -ENOMEM - insufficient memory
* *
*/ */
int diRead(struct inode *ip) int diRead(struct inode *ip)
{ {
...@@ -586,14 +586,14 @@ void diFreeSpecial(struct inode *ip) ...@@ -586,14 +586,14 @@ void diFreeSpecial(struct inode *ip)
* page of the extent that contains the disk inode is * page of the extent that contains the disk inode is
* read and the disk inode portion of the incore inode * read and the disk inode portion of the incore inode
* is copied to the disk inode. * is copied to the disk inode.
* *
* PARAMETERS: * PARAMETERS:
* tid - transacation id * tid - transacation id
* ip - pointer to incore inode to be written to the inode extent. * ip - pointer to incore inode to be written to the inode extent.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
*/ */
int diWrite(tid_t tid, struct inode *ip) int diWrite(tid_t tid, struct inode *ip)
{ {
...@@ -676,11 +676,11 @@ int diWrite(tid_t tid, struct inode *ip) ...@@ -676,11 +676,11 @@ int diWrite(tid_t tid, struct inode *ip)
* copy btree root from in-memory inode to on-disk inode * copy btree root from in-memory inode to on-disk inode
* *
* (tlock is taken from inline B+-tree root in in-memory * (tlock is taken from inline B+-tree root in in-memory
* inode when the B+-tree root is updated, which is pointed * inode when the B+-tree root is updated, which is pointed
* by jfs_ip->blid as well as being on tx tlock list) * by jfs_ip->blid as well as being on tx tlock list)
* *
* further processing of btree root is based on the copy * further processing of btree root is based on the copy
* in in-memory inode, where txLog() will log from, and, * in in-memory inode, where txLog() will log from, and,
* for xtree root, txUpdateMap() will update map and reset * for xtree root, txUpdateMap() will update map and reset
* XAD_NEW bit; * XAD_NEW bit;
*/ */
...@@ -824,7 +824,7 @@ int diWrite(tid_t tid, struct inode *ip) ...@@ -824,7 +824,7 @@ int diWrite(tid_t tid, struct inode *ip)
memcpy(&dp->di_DASD, &ip->i_DASD, sizeof(struct dasd)); memcpy(&dp->di_DASD, &ip->i_DASD, sizeof(struct dasd));
#endif /* _JFS_FASTDASD */ #endif /* _JFS_FASTDASD */
/* release the buffer holding the updated on-disk inode. /* release the buffer holding the updated on-disk inode.
* the buffer will be later written by commit processing. * the buffer will be later written by commit processing.
*/ */
write_metapage(mp); write_metapage(mp);
...@@ -842,7 +842,7 @@ int diWrite(tid_t tid, struct inode *ip) ...@@ -842,7 +842,7 @@ int diWrite(tid_t tid, struct inode *ip)
* if the inode to be freed represents the first (only) * if the inode to be freed represents the first (only)
* free inode within the iag, the iag will be placed on * free inode within the iag, the iag will be placed on
* the ag free inode list. * the ag free inode list.
* *
* freeing the inode will cause the inode extent to be * freeing the inode will cause the inode extent to be
* freed if the inode is the only allocated inode within * freed if the inode is the only allocated inode within
* the extent. in this case all the disk resource backing * the extent. in this case all the disk resource backing
...@@ -865,11 +865,11 @@ int diWrite(tid_t tid, struct inode *ip) ...@@ -865,11 +865,11 @@ int diWrite(tid_t tid, struct inode *ip)
* any updates and are held until all updates are complete. * any updates and are held until all updates are complete.
* *
* PARAMETERS: * PARAMETERS:
* ip - inode to be freed. * ip - inode to be freed.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
*/ */
int diFree(struct inode *ip) int diFree(struct inode *ip)
{ {
...@@ -898,7 +898,7 @@ int diFree(struct inode *ip) ...@@ -898,7 +898,7 @@ int diFree(struct inode *ip)
*/ */
iagno = INOTOIAG(inum); iagno = INOTOIAG(inum);
/* make sure that the iag is contained within /* make sure that the iag is contained within
* the map. * the map.
*/ */
if (iagno >= imap->im_nextiag) { if (iagno >= imap->im_nextiag) {
...@@ -1013,7 +1013,7 @@ int diFree(struct inode *ip) ...@@ -1013,7 +1013,7 @@ int diFree(struct inode *ip)
/* update the free inode summary map for the extent if /* update the free inode summary map for the extent if
* freeing the inode means the extent will now have free * freeing the inode means the extent will now have free
* inodes (i.e., the inode being freed is the first free * inodes (i.e., the inode being freed is the first free
* inode of extent), * inode of extent),
*/ */
if (iagp->wmap[extno] == cpu_to_le32(ONES)) { if (iagp->wmap[extno] == cpu_to_le32(ONES)) {
...@@ -1204,9 +1204,9 @@ int diFree(struct inode *ip) ...@@ -1204,9 +1204,9 @@ int diFree(struct inode *ip)
iagp->inofreefwd = iagp->inofreeback = cpu_to_le32(-1); iagp->inofreefwd = iagp->inofreeback = cpu_to_le32(-1);
} }
/* update the inode extent address and working map /* update the inode extent address and working map
* to reflect the free extent. * to reflect the free extent.
* the permanent map should have been updated already * the permanent map should have been updated already
* for the inode being freed. * for the inode being freed.
*/ */
if (iagp->pmap[extno] != 0) { if (iagp->pmap[extno] != 0) {
...@@ -1218,7 +1218,7 @@ int diFree(struct inode *ip) ...@@ -1218,7 +1218,7 @@ int diFree(struct inode *ip)
/* update the free extent and free inode summary maps /* update the free extent and free inode summary maps
* to reflect the freed extent. * to reflect the freed extent.
* the inode summary map is marked to indicate no inodes * the inode summary map is marked to indicate no inodes
* available for the freed extent. * available for the freed extent.
*/ */
sword = extno >> L2EXTSPERSUM; sword = extno >> L2EXTSPERSUM;
...@@ -1255,17 +1255,17 @@ int diFree(struct inode *ip) ...@@ -1255,17 +1255,17 @@ int diFree(struct inode *ip)
* start transaction to update block allocation map * start transaction to update block allocation map
* for the inode extent freed; * for the inode extent freed;
* *
* N.B. AG_LOCK is released and iag will be released below, and * N.B. AG_LOCK is released and iag will be released below, and
* other thread may allocate inode from/reusing the ixad freed * other thread may allocate inode from/reusing the ixad freed
* BUT with new/different backing inode extent from the extent * BUT with new/different backing inode extent from the extent
* to be freed by the transaction; * to be freed by the transaction;
*/ */
tid = txBegin(ipimap->i_sb, COMMIT_FORCE); tid = txBegin(ipimap->i_sb, COMMIT_FORCE);
mutex_lock(&JFS_IP(ipimap)->commit_mutex); mutex_lock(&JFS_IP(ipimap)->commit_mutex);
/* acquire tlock of the iag page of the freed ixad /* acquire tlock of the iag page of the freed ixad
* to force the page NOHOMEOK (even though no data is * to force the page NOHOMEOK (even though no data is
* logged from the iag page) until NOREDOPAGE|FREEXTENT log * logged from the iag page) until NOREDOPAGE|FREEXTENT log
* for the free of the extent is committed; * for the free of the extent is committed;
* write FREEXTENT|NOREDOPAGE log record * write FREEXTENT|NOREDOPAGE log record
* N.B. linelock is overlaid as freed extent descriptor; * N.B. linelock is overlaid as freed extent descriptor;
...@@ -1284,8 +1284,8 @@ int diFree(struct inode *ip) ...@@ -1284,8 +1284,8 @@ int diFree(struct inode *ip)
* logredo needs the IAG number and IAG extent index in order * logredo needs the IAG number and IAG extent index in order
* to ensure that the IMap is consistent. The least disruptive * to ensure that the IMap is consistent. The least disruptive
* way to pass these values through to the transaction manager * way to pass these values through to the transaction manager
* is in the iplist array. * is in the iplist array.
* *
* It's not pretty, but it works. * It's not pretty, but it works.
*/ */
iplist[1] = (struct inode *) (size_t)iagno; iplist[1] = (struct inode *) (size_t)iagno;
...@@ -1340,18 +1340,18 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp) ...@@ -1340,18 +1340,18 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp)
/* /*
* NAME: diAlloc(pip,dir,ip) * NAME: diAlloc(pip,dir,ip)
* *
* FUNCTION: allocate a disk inode from the inode working map * FUNCTION: allocate a disk inode from the inode working map
* for a fileset or aggregate. * for a fileset or aggregate.
* *
* PARAMETERS: * PARAMETERS:
* pip - pointer to incore inode for the parent inode. * pip - pointer to incore inode for the parent inode.
* dir - 'true' if the new disk inode is for a directory. * dir - 'true' if the new disk inode is for a directory.
* ip - pointer to a new inode * ip - pointer to a new inode
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
int diAlloc(struct inode *pip, bool dir, struct inode *ip) int diAlloc(struct inode *pip, bool dir, struct inode *ip)
{ {
...@@ -1372,7 +1372,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip) ...@@ -1372,7 +1372,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
JFS_IP(ip)->ipimap = ipimap; JFS_IP(ip)->ipimap = ipimap;
JFS_IP(ip)->fileset = FILESYSTEM_I; JFS_IP(ip)->fileset = FILESYSTEM_I;
/* for a directory, the allocation policy is to start /* for a directory, the allocation policy is to start
* at the ag level using the preferred ag. * at the ag level using the preferred ag.
*/ */
if (dir) { if (dir) {
...@@ -1435,7 +1435,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip) ...@@ -1435,7 +1435,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
/* /*
* try to allocate from the IAG * try to allocate from the IAG
*/ */
/* check if the inode may be allocated from the iag /* check if the inode may be allocated from the iag
* (i.e. the inode has free inodes or new extent can be added). * (i.e. the inode has free inodes or new extent can be added).
*/ */
if (iagp->nfreeinos || addext) { if (iagp->nfreeinos || addext) {
...@@ -1490,7 +1490,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip) ...@@ -1490,7 +1490,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
* hint or, if appropriate (i.e. addext is true), allocate * hint or, if appropriate (i.e. addext is true), allocate
* an extent of free inodes at or following the extent * an extent of free inodes at or following the extent
* containing the hint. * containing the hint.
* *
* the free inode and free extent summary maps are used * the free inode and free extent summary maps are used
* here, so determine the starting summary map position * here, so determine the starting summary map position
* and the number of words we'll have to examine. again, * and the number of words we'll have to examine. again,
...@@ -1641,7 +1641,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip) ...@@ -1641,7 +1641,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
* inodes should be added for the allocation group, with * inodes should be added for the allocation group, with
* the current request satisfied from this extent. if this * the current request satisfied from this extent. if this
* is the case, an attempt will be made to do just that. if * is the case, an attempt will be made to do just that. if
* this attempt fails or it has been determined that a new * this attempt fails or it has been determined that a new
* extent should not be added, an attempt is made to satisfy * extent should not be added, an attempt is made to satisfy
* the request by allocating an existing (backed) free inode * the request by allocating an existing (backed) free inode
* from the allocation group. * from the allocation group.
...@@ -1649,24 +1649,24 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip) ...@@ -1649,24 +1649,24 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
* PRE CONDITION: Already have the AG lock for this AG. * PRE CONDITION: Already have the AG lock for this AG.
* *
* PARAMETERS: * PARAMETERS:
* imap - pointer to inode map control structure. * imap - pointer to inode map control structure.
* agno - allocation group to allocate from. * agno - allocation group to allocate from.
* dir - 'true' if the new disk inode is for a directory. * dir - 'true' if the new disk inode is for a directory.
* ip - pointer to the new inode to be filled in on successful return * ip - pointer to the new inode to be filled in on successful return
* with the disk inode number allocated, its extent address * with the disk inode number allocated, its extent address
* and the start of the ag. * and the start of the ag.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
static int static int
diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip) diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip)
{ {
int rc, addext, numfree, numinos; int rc, addext, numfree, numinos;
/* get the number of free and the number of backed disk /* get the number of free and the number of backed disk
* inodes currently within the ag. * inodes currently within the ag.
*/ */
numfree = imap->im_agctl[agno].numfree; numfree = imap->im_agctl[agno].numfree;
...@@ -1719,17 +1719,17 @@ diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip) ...@@ -1719,17 +1719,17 @@ diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip)
* specified primary group. * specified primary group.
* *
* PARAMETERS: * PARAMETERS:
* imap - pointer to inode map control structure. * imap - pointer to inode map control structure.
* agno - primary allocation group (to avoid). * agno - primary allocation group (to avoid).
* dir - 'true' if the new disk inode is for a directory. * dir - 'true' if the new disk inode is for a directory.
* ip - pointer to a new inode to be filled in on successful return * ip - pointer to a new inode to be filled in on successful return
* with the disk inode number allocated, its extent address * with the disk inode number allocated, its extent address
* and the start of the ag. * and the start of the ag.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
static int static int
diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip) diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip)
...@@ -1738,7 +1738,7 @@ diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip) ...@@ -1738,7 +1738,7 @@ diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip)
int maxag = JFS_SBI(imap->im_ipimap->i_sb)->bmap->db_maxag; int maxag = JFS_SBI(imap->im_ipimap->i_sb)->bmap->db_maxag;
/* try to allocate from the ags following agno up to /* try to allocate from the ags following agno up to
* the maximum ag number. * the maximum ag number.
*/ */
for (ag = agno + 1; ag <= maxag; ag++) { for (ag = agno + 1; ag <= maxag; ag++) {
...@@ -1780,21 +1780,21 @@ diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip) ...@@ -1780,21 +1780,21 @@ diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip)
* *
* allocation occurs from the first iag on the list using * allocation occurs from the first iag on the list using
* the iag's free inode summary map to find the leftmost * the iag's free inode summary map to find the leftmost
* free inode in the iag. * free inode in the iag.
* *
* PRE CONDITION: Already have AG lock for this AG. * PRE CONDITION: Already have AG lock for this AG.
* *
* PARAMETERS: * PARAMETERS:
* imap - pointer to inode map control structure. * imap - pointer to inode map control structure.
* agno - allocation group. * agno - allocation group.
* ip - pointer to new inode to be filled in on successful return * ip - pointer to new inode to be filled in on successful return
* with the disk inode number allocated, its extent address * with the disk inode number allocated, its extent address
* and the start of the ag. * and the start of the ag.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
{ {
...@@ -1867,7 +1867,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) ...@@ -1867,7 +1867,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
return -EIO; return -EIO;
} }
/* compute the inode number within the iag. /* compute the inode number within the iag.
*/ */
ino = (extno << L2INOSPEREXT) + rem; ino = (extno << L2INOSPEREXT) + rem;
...@@ -1892,17 +1892,17 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) ...@@ -1892,17 +1892,17 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
/* /*
* NAME: diAllocExt(imap,agno,ip) * NAME: diAllocExt(imap,agno,ip)
* *
* FUNCTION: add a new extent of free inodes to an iag, allocating * FUNCTION: add a new extent of free inodes to an iag, allocating
* an inode from this extent to satisfy the current allocation * an inode from this extent to satisfy the current allocation
* request. * request.
* *
* this routine first tries to find an existing iag with free * this routine first tries to find an existing iag with free
* extents through the ag free extent list. if list is not * extents through the ag free extent list. if list is not
* empty, the head of the list will be selected as the home * empty, the head of the list will be selected as the home
* of the new extent of free inodes. otherwise (the list is * of the new extent of free inodes. otherwise (the list is
* empty), a new iag will be allocated for the ag to contain * empty), a new iag will be allocated for the ag to contain
* the extent. * the extent.
* *
* once an iag has been selected, the free extent summary map * once an iag has been selected, the free extent summary map
* is used to locate a free extent within the iag and diNewExt() * is used to locate a free extent within the iag and diNewExt()
* is called to initialize the extent, with initialization * is called to initialize the extent, with initialization
...@@ -1910,16 +1910,16 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) ...@@ -1910,16 +1910,16 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
* for the purpose of satisfying this request. * for the purpose of satisfying this request.
* *
* PARAMETERS: * PARAMETERS:
* imap - pointer to inode map control structure. * imap - pointer to inode map control structure.
* agno - allocation group number. * agno - allocation group number.
* ip - pointer to new inode to be filled in on successful return * ip - pointer to new inode to be filled in on successful return
* with the disk inode number allocated, its extent address * with the disk inode number allocated, its extent address
* and the start of the ag. * and the start of the ag.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
static int diAllocExt(struct inomap * imap, int agno, struct inode *ip) static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
{ {
...@@ -2012,7 +2012,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip) ...@@ -2012,7 +2012,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
/* /*
* NAME: diAllocBit(imap,iagp,ino) * NAME: diAllocBit(imap,iagp,ino)
* *
* FUNCTION: allocate a backed inode from an iag. * FUNCTION: allocate a backed inode from an iag.
* *
* this routine performs the mechanics of allocating a * this routine performs the mechanics of allocating a
* specified inode from a backed extent. * specified inode from a backed extent.
...@@ -2025,19 +2025,19 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip) ...@@ -2025,19 +2025,19 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
* in the face of updates to multiple buffers. under this * in the face of updates to multiple buffers. under this
* approach, all required buffers are obtained before making * approach, all required buffers are obtained before making
* any updates and are held all are updates are complete. * any updates and are held all are updates are complete.
* *
* PRE CONDITION: Already have buffer lock on iagp. Already have AG lock on * PRE CONDITION: Already have buffer lock on iagp. Already have AG lock on
* this AG. Must have read lock on imap inode. * this AG. Must have read lock on imap inode.
* *
* PARAMETERS: * PARAMETERS:
* imap - pointer to inode map control structure. * imap - pointer to inode map control structure.
* iagp - pointer to iag. * iagp - pointer to iag.
* ino - inode number to be allocated within the iag. * ino - inode number to be allocated within the iag.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino) static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
{ {
...@@ -2172,19 +2172,19 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino) ...@@ -2172,19 +2172,19 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
* buffers. under this approach, all required buffers are * buffers. under this approach, all required buffers are
* obtained before making any updates and are held until all * obtained before making any updates and are held until all
* updates are complete. * updates are complete.
* *
* PRE CONDITION: Already have buffer lock on iagp. Already have AG lock on * PRE CONDITION: Already have buffer lock on iagp. Already have AG lock on
* this AG. Must have read lock on imap inode. * this AG. Must have read lock on imap inode.
* *
* PARAMETERS: * PARAMETERS:
* imap - pointer to inode map control structure. * imap - pointer to inode map control structure.
* iagp - pointer to iag. * iagp - pointer to iag.
* extno - extent number. * extno - extent number.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
static int diNewExt(struct inomap * imap, struct iag * iagp, int extno) static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
{ {
...@@ -2432,34 +2432,34 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno) ...@@ -2432,34 +2432,34 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
/* /*
* NAME: diNewIAG(imap,iagnop,agno) * NAME: diNewIAG(imap,iagnop,agno)
* *
* FUNCTION: allocate a new iag for an allocation group. * FUNCTION: allocate a new iag for an allocation group.
* *
* first tries to allocate the iag from the inode map * first tries to allocate the iag from the inode map
* iagfree list: * iagfree list:
* if the list has free iags, the head of the list is removed * if the list has free iags, the head of the list is removed
* and returned to satisfy the request. * and returned to satisfy the request.
* if the inode map's iag free list is empty, the inode map * if the inode map's iag free list is empty, the inode map
* is extended to hold a new iag. this new iag is initialized * is extended to hold a new iag. this new iag is initialized
* and returned to satisfy the request. * and returned to satisfy the request.
* *
* PARAMETERS: * PARAMETERS:
* imap - pointer to inode map control structure. * imap - pointer to inode map control structure.
* iagnop - pointer to an iag number set with the number of the * iagnop - pointer to an iag number set with the number of the
* newly allocated iag upon successful return. * newly allocated iag upon successful return.
* agno - allocation group number. * agno - allocation group number.
* bpp - Buffer pointer to be filled in with new IAG's buffer * bpp - Buffer pointer to be filled in with new IAG's buffer
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
* -EIO - i/o error. * -EIO - i/o error.
* *
* serialization: * serialization:
* AG lock held on entry/exit; * AG lock held on entry/exit;
* write lock on the map is held inside; * write lock on the map is held inside;
* read lock on the map is held on successful completion; * read lock on the map is held on successful completion;
* *
* note: new iag transaction: * note: new iag transaction:
* . synchronously write iag; * . synchronously write iag;
* . write log of xtree and inode of imap; * . write log of xtree and inode of imap;
* . commit; * . commit;
...@@ -2494,7 +2494,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) ...@@ -2494,7 +2494,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
/* acquire the free iag lock */ /* acquire the free iag lock */
IAGFREE_LOCK(imap); IAGFREE_LOCK(imap);
/* if there are any iags on the inode map free iag list, /* if there are any iags on the inode map free iag list,
* allocate the iag from the head of the list. * allocate the iag from the head of the list.
*/ */
if (imap->im_freeiag >= 0) { if (imap->im_freeiag >= 0) {
...@@ -2618,8 +2618,8 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) ...@@ -2618,8 +2618,8 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
flush_metapage(mp); flush_metapage(mp);
/* /*
* txCommit(COMMIT_FORCE) will synchronously write address * txCommit(COMMIT_FORCE) will synchronously write address
* index pages and inode after commit in careful update order * index pages and inode after commit in careful update order
* of address index pages (right to left, bottom up); * of address index pages (right to left, bottom up);
*/ */
iplist[0] = ipimap; iplist[0] = ipimap;
...@@ -2678,11 +2678,11 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) ...@@ -2678,11 +2678,11 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
* *
* FUNCTION: get the buffer for the specified iag within a fileset * FUNCTION: get the buffer for the specified iag within a fileset
* or aggregate inode map. * or aggregate inode map.
* *
* PARAMETERS: * PARAMETERS:
* imap - pointer to inode map control structure. * imap - pointer to inode map control structure.
* iagno - iag number. * iagno - iag number.
* bpp - point to buffer pointer to be filled in on successful * bpp - point to buffer pointer to be filled in on successful
* exit. * exit.
* *
* SERIALIZATION: * SERIALIZATION:
...@@ -2692,7 +2692,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) ...@@ -2692,7 +2692,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success. * 0 - success.
* -EIO - i/o error. * -EIO - i/o error.
*/ */
static int diIAGRead(struct inomap * imap, int iagno, struct metapage ** mpp) static int diIAGRead(struct inomap * imap, int iagno, struct metapage ** mpp)
{ {
...@@ -2718,8 +2718,8 @@ static int diIAGRead(struct inomap * imap, int iagno, struct metapage ** mpp) ...@@ -2718,8 +2718,8 @@ static int diIAGRead(struct inomap * imap, int iagno, struct metapage ** mpp)
* the specified bit position. * the specified bit position.
* *
* PARAMETERS: * PARAMETERS:
* word - word to be examined. * word - word to be examined.
* start - starting bit position. * start - starting bit position.
* *
* RETURN VALUES: * RETURN VALUES:
* bit position of first free bit in the word or 32 if * bit position of first free bit in the word or 32 if
...@@ -2740,10 +2740,10 @@ static int diFindFree(u32 word, int start) ...@@ -2740,10 +2740,10 @@ static int diFindFree(u32 word, int start)
/* /*
* NAME: diUpdatePMap() * NAME: diUpdatePMap()
* *
* FUNCTION: Update the persistent map in an IAG for the allocation or * FUNCTION: Update the persistent map in an IAG for the allocation or
* freeing of the specified inode. * freeing of the specified inode.
* *
* PRE CONDITIONS: Working map has already been updated for allocate. * PRE CONDITIONS: Working map has already been updated for allocate.
* *
* PARAMETERS: * PARAMETERS:
...@@ -2752,7 +2752,7 @@ static int diFindFree(u32 word, int start) ...@@ -2752,7 +2752,7 @@ static int diFindFree(u32 word, int start)
* is_free - If 'true' indicates inode should be marked freed, otherwise * is_free - If 'true' indicates inode should be marked freed, otherwise
* indicates inode should be marked allocated. * indicates inode should be marked allocated.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 for success * 0 for success
*/ */
int int
...@@ -2793,7 +2793,7 @@ diUpdatePMap(struct inode *ipimap, ...@@ -2793,7 +2793,7 @@ diUpdatePMap(struct inode *ipimap,
extno = ino >> L2INOSPEREXT; extno = ino >> L2INOSPEREXT;
bitno = ino & (INOSPEREXT - 1); bitno = ino & (INOSPEREXT - 1);
mask = HIGHORDER >> bitno; mask = HIGHORDER >> bitno;
/* /*
* mark the inode free in persistent map: * mark the inode free in persistent map:
*/ */
if (is_free) { if (is_free) {
...@@ -2803,7 +2803,7 @@ diUpdatePMap(struct inode *ipimap, ...@@ -2803,7 +2803,7 @@ diUpdatePMap(struct inode *ipimap,
* of last reference release; * of last reference release;
*/ */
if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) {
jfs_error(ipimap->i_sb, jfs_error(ipimap->i_sb,
"diUpdatePMap: inode %ld not marked as " "diUpdatePMap: inode %ld not marked as "
"allocated in wmap!", inum); "allocated in wmap!", inum);
} }
...@@ -2877,8 +2877,8 @@ diUpdatePMap(struct inode *ipimap, ...@@ -2877,8 +2877,8 @@ diUpdatePMap(struct inode *ipimap,
* diExtendFS() * diExtendFS()
* *
* function: update imap for extendfs(); * function: update imap for extendfs();
* *
* note: AG size has been increased s.t. each k old contiguous AGs are * note: AG size has been increased s.t. each k old contiguous AGs are
* coalesced into a new AG; * coalesced into a new AG;
*/ */
int diExtendFS(struct inode *ipimap, struct inode *ipbmap) int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
...@@ -2897,7 +2897,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap) ...@@ -2897,7 +2897,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
atomic_read(&imap->im_numfree)); atomic_read(&imap->im_numfree));
/* /*
* reconstruct imap * reconstruct imap
* *
* coalesce contiguous k (newAGSize/oldAGSize) AGs; * coalesce contiguous k (newAGSize/oldAGSize) AGs;
* i.e., (AGi, ..., AGj) where i = k*n and j = k*(n+1) - 1 to AGn; * i.e., (AGi, ..., AGj) where i = k*n and j = k*(n+1) - 1 to AGn;
...@@ -2931,7 +2931,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap) ...@@ -2931,7 +2931,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
} }
/* leave free iag in the free iag list */ /* leave free iag in the free iag list */
if (iagp->nfreeexts == cpu_to_le32(EXTSPERIAG)) { if (iagp->nfreeexts == cpu_to_le32(EXTSPERIAG)) {
release_metapage(bp); release_metapage(bp);
continue; continue;
} }
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_IMAP #ifndef _H_JFS_IMAP
...@@ -45,13 +45,13 @@ ...@@ -45,13 +45,13 @@
/* get the starting block number of the 4K page of an inode extent /* get the starting block number of the 4K page of an inode extent
* that contains ino. * that contains ino.
*/ */
#define INOPBLK(pxd,ino,l2nbperpg) (addressPXD((pxd)) + \ #define INOPBLK(pxd,ino,l2nbperpg) (addressPXD((pxd)) + \
((((ino) & (INOSPEREXT-1)) >> L2INOSPERPAGE) << (l2nbperpg))) ((((ino) & (INOSPEREXT-1)) >> L2INOSPERPAGE) << (l2nbperpg)))
/* /*
* inode allocation map: * inode allocation map:
* *
* inode allocation map consists of * inode allocation map consists of
* . the inode map control page and * . the inode map control page and
* . inode allocation group pages (per 4096 inodes) * . inode allocation group pages (per 4096 inodes)
* which are addressed by standard JFS xtree. * which are addressed by standard JFS xtree.
......
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_INCORE #ifndef _H_JFS_INCORE
#define _H_JFS_INCORE #define _H_JFS_INCORE
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -61,7 +61,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) ...@@ -61,7 +61,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
inode = new_inode(sb); inode = new_inode(sb);
if (!inode) { if (!inode) {
jfs_warn("ialloc: new_inode returned NULL!"); jfs_warn("ialloc: new_inode returned NULL!");
return inode; return ERR_PTR(-ENOMEM);
} }
jfs_inode = JFS_IP(inode); jfs_inode = JFS_IP(inode);
...@@ -69,9 +69,10 @@ struct inode *ialloc(struct inode *parent, umode_t mode) ...@@ -69,9 +69,10 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
rc = diAlloc(parent, S_ISDIR(mode), inode); rc = diAlloc(parent, S_ISDIR(mode), inode);
if (rc) { if (rc) {
jfs_warn("ialloc: diAlloc returned %d!", rc); jfs_warn("ialloc: diAlloc returned %d!", rc);
make_bad_inode(inode); if (rc == -EIO)
make_bad_inode(inode);
iput(inode); iput(inode);
return NULL; return ERR_PTR(rc);
} }
inode->i_uid = current->fsuid; inode->i_uid = current->fsuid;
...@@ -97,7 +98,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) ...@@ -97,7 +98,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
inode->i_flags |= S_NOQUOTA; inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0; inode->i_nlink = 0;
iput(inode); iput(inode);
return NULL; return ERR_PTR(-EDQUOT);
} }
inode->i_mode = mode; inode->i_mode = mode;
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_INODE #ifndef _H_JFS_INODE
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2001 * Copyright (C) International Business Machines Corp., 2000-2001
* Portions Copyright (c) Christoph Hellwig, 2001-2002 * Portions Copyright (C) Christoph Hellwig, 2001-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_LOCK #ifndef _H_JFS_LOCK
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -337,7 +337,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -337,7 +337,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
* PARAMETER: cd - commit descriptor * PARAMETER: cd - commit descriptor
* *
* RETURN: end-of-log address * RETURN: end-of-log address
* *
* serialization: LOG_LOCK() held on entry/exit * serialization: LOG_LOCK() held on entry/exit
*/ */
static int static int
...@@ -554,7 +554,7 @@ lmWriteRecord(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -554,7 +554,7 @@ lmWriteRecord(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
* PARAMETER: log * PARAMETER: log
* *
* RETURN: 0 * RETURN: 0
* *
* serialization: LOG_LOCK() held on entry/exit * serialization: LOG_LOCK() held on entry/exit
*/ */
static int lmNextPage(struct jfs_log * log) static int lmNextPage(struct jfs_log * log)
...@@ -656,7 +656,7 @@ static int lmNextPage(struct jfs_log * log) ...@@ -656,7 +656,7 @@ static int lmNextPage(struct jfs_log * log)
* page number - redrive pageout of the page at the head of * page number - redrive pageout of the page at the head of
* pageout queue until full page has been written. * pageout queue until full page has been written.
* *
* RETURN: * RETURN:
* *
* NOTE: * NOTE:
* LOGGC_LOCK serializes log group commit queue, and * LOGGC_LOCK serializes log group commit queue, and
...@@ -920,10 +920,10 @@ static void lmPostGC(struct lbuf * bp) ...@@ -920,10 +920,10 @@ static void lmPostGC(struct lbuf * bp)
* this code is called again. * this code is called again.
* *
* PARAMETERS: log - log structure * PARAMETERS: log - log structure
* hard_sync - 1 to force all metadata to be written * hard_sync - 1 to force all metadata to be written
* *
* RETURN: 0 * RETURN: 0
* *
* serialization: LOG_LOCK() held on entry/exit * serialization: LOG_LOCK() held on entry/exit
*/ */
static int lmLogSync(struct jfs_log * log, int hard_sync) static int lmLogSync(struct jfs_log * log, int hard_sync)
...@@ -1052,7 +1052,7 @@ static int lmLogSync(struct jfs_log * log, int hard_sync) ...@@ -1052,7 +1052,7 @@ static int lmLogSync(struct jfs_log * log, int hard_sync)
* FUNCTION: write log SYNCPT record for specified log * FUNCTION: write log SYNCPT record for specified log
* *
* PARAMETERS: log - log structure * PARAMETERS: log - log structure
* hard_sync - set to 1 to force metadata to be written * hard_sync - set to 1 to force metadata to be written
*/ */
void jfs_syncpt(struct jfs_log *log, int hard_sync) void jfs_syncpt(struct jfs_log *log, int hard_sync)
{ LOG_LOCK(log); { LOG_LOCK(log);
...@@ -1067,7 +1067,7 @@ void jfs_syncpt(struct jfs_log *log, int hard_sync) ...@@ -1067,7 +1067,7 @@ void jfs_syncpt(struct jfs_log *log, int hard_sync)
* insert filesystem in the active list of the log. * insert filesystem in the active list of the log.
* *
* PARAMETER: ipmnt - file system mount inode * PARAMETER: ipmnt - file system mount inode
* iplog - log inode (out) * iplog - log inode (out)
* *
* RETURN: * RETURN:
* *
...@@ -1082,7 +1082,7 @@ int lmLogOpen(struct super_block *sb) ...@@ -1082,7 +1082,7 @@ int lmLogOpen(struct super_block *sb)
if (sbi->flag & JFS_NOINTEGRITY) if (sbi->flag & JFS_NOINTEGRITY)
return open_dummy_log(sb); return open_dummy_log(sb);
if (sbi->mntflag & JFS_INLINELOG) if (sbi->mntflag & JFS_INLINELOG)
return open_inline_log(sb); return open_inline_log(sb);
...@@ -1131,7 +1131,7 @@ int lmLogOpen(struct super_block *sb) ...@@ -1131,7 +1131,7 @@ int lmLogOpen(struct super_block *sb)
log->bdev = bdev; log->bdev = bdev;
memcpy(log->uuid, sbi->loguuid, sizeof(log->uuid)); memcpy(log->uuid, sbi->loguuid, sizeof(log->uuid));
/* /*
* initialize log: * initialize log:
*/ */
...@@ -1253,13 +1253,13 @@ static int open_dummy_log(struct super_block *sb) ...@@ -1253,13 +1253,13 @@ static int open_dummy_log(struct super_block *sb)
* initialize the log from log superblock. * initialize the log from log superblock.
* set the log state in the superblock to LOGMOUNT and * set the log state in the superblock to LOGMOUNT and
* write SYNCPT log record. * write SYNCPT log record.
* *
* PARAMETER: log - log structure * PARAMETER: log - log structure
* *
* RETURN: 0 - if ok * RETURN: 0 - if ok
* -EINVAL - bad log magic number or superblock dirty * -EINVAL - bad log magic number or superblock dirty
* error returned from logwait() * error returned from logwait()
* *
* serialization: single first open thread * serialization: single first open thread
*/ */
int lmLogInit(struct jfs_log * log) int lmLogInit(struct jfs_log * log)
...@@ -1297,7 +1297,7 @@ int lmLogInit(struct jfs_log * log) ...@@ -1297,7 +1297,7 @@ int lmLogInit(struct jfs_log * log)
if (!test_bit(log_INLINELOG, &log->flag)) if (!test_bit(log_INLINELOG, &log->flag))
log->l2bsize = L2LOGPSIZE; log->l2bsize = L2LOGPSIZE;
/* check for disabled journaling to disk */ /* check for disabled journaling to disk */
if (log->no_integrity) { if (log->no_integrity) {
/* /*
...@@ -1651,7 +1651,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait) ...@@ -1651,7 +1651,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
* PARAMETER: log - log inode * PARAMETER: log - log inode
* *
* RETURN: 0 - success * RETURN: 0 - success
* *
* serialization: single last close thread * serialization: single last close thread
*/ */
int lmLogShutdown(struct jfs_log * log) int lmLogShutdown(struct jfs_log * log)
...@@ -1677,7 +1677,7 @@ int lmLogShutdown(struct jfs_log * log) ...@@ -1677,7 +1677,7 @@ int lmLogShutdown(struct jfs_log * log)
lrd.type = cpu_to_le16(LOG_SYNCPT); lrd.type = cpu_to_le16(LOG_SYNCPT);
lrd.length = 0; lrd.length = 0;
lrd.log.syncpt.sync = 0; lrd.log.syncpt.sync = 0;
lsn = lmWriteRecord(log, NULL, &lrd, NULL); lsn = lmWriteRecord(log, NULL, &lrd, NULL);
bp = log->bp; bp = log->bp;
lp = (struct logpage *) bp->l_ldata; lp = (struct logpage *) bp->l_ldata;
...@@ -1703,7 +1703,7 @@ int lmLogShutdown(struct jfs_log * log) ...@@ -1703,7 +1703,7 @@ int lmLogShutdown(struct jfs_log * log)
jfs_info("lmLogShutdown: lsn:0x%x page:%d eor:%d", jfs_info("lmLogShutdown: lsn:0x%x page:%d eor:%d",
lsn, log->page, log->eor); lsn, log->page, log->eor);
out: out:
/* /*
* shutdown per log i/o * shutdown per log i/o
*/ */
...@@ -1769,7 +1769,7 @@ static int lmLogFileSystem(struct jfs_log * log, struct jfs_sb_info *sbi, ...@@ -1769,7 +1769,7 @@ static int lmLogFileSystem(struct jfs_log * log, struct jfs_sb_info *sbi,
lbmFree(bpsuper); lbmFree(bpsuper);
return -EIO; return -EIO;
} }
} }
/* /*
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_LOGMGR #ifndef _H_JFS_LOGMGR
...@@ -35,19 +35,19 @@ ...@@ -35,19 +35,19 @@
/* /*
* log logical volume * log logical volume
* *
* a log is used to make the commit operation on journalled * a log is used to make the commit operation on journalled
* files within the same logical volume group atomic. * files within the same logical volume group atomic.
* a log is implemented with a logical volume. * a log is implemented with a logical volume.
* there is one log per logical volume group. * there is one log per logical volume group.
* *
* block 0 of the log logical volume is not used (ipl etc). * block 0 of the log logical volume is not used (ipl etc).
* block 1 contains a log "superblock" and is used by logFormat(), * block 1 contains a log "superblock" and is used by logFormat(),
* lmLogInit(), lmLogShutdown(), and logRedo() to record status * lmLogInit(), lmLogShutdown(), and logRedo() to record status
* of the log but is not otherwise used during normal processing. * of the log but is not otherwise used during normal processing.
* blocks 2 - (N-1) are used to contain log records. * blocks 2 - (N-1) are used to contain log records.
* *
* when a volume group is varied-on-line, logRedo() must have * when a volume group is varied-on-line, logRedo() must have
* been executed before the file systems (logical volumes) in * been executed before the file systems (logical volumes) in
* the volume group can be mounted. * the volume group can be mounted.
*/ */
/* /*
...@@ -97,26 +97,26 @@ struct logsuper { ...@@ -97,26 +97,26 @@ struct logsuper {
* log logical page * log logical page
* *
* (this comment should be rewritten !) * (this comment should be rewritten !)
* the header and trailer structures (h,t) will normally have * the header and trailer structures (h,t) will normally have
* the same page and eor value. * the same page and eor value.
* An exception to this occurs when a complete page write is not * An exception to this occurs when a complete page write is not
* accomplished on a power failure. Since the hardware may "split write" * accomplished on a power failure. Since the hardware may "split write"
* sectors in the page, any out of order sequence may occur during powerfail * sectors in the page, any out of order sequence may occur during powerfail
* and needs to be recognized during log replay. The xor value is * and needs to be recognized during log replay. The xor value is
* an "exclusive or" of all log words in the page up to eor. This * an "exclusive or" of all log words in the page up to eor. This
* 32 bit eor is stored with the top 16 bits in the header and the * 32 bit eor is stored with the top 16 bits in the header and the
* bottom 16 bits in the trailer. logredo can easily recognize pages * bottom 16 bits in the trailer. logredo can easily recognize pages
* that were not completed by reconstructing this eor and checking * that were not completed by reconstructing this eor and checking
* the log page. * the log page.
* *
* Previous versions of the operating system did not allow split * Previous versions of the operating system did not allow split
* writes and detected partially written records in logredo by * writes and detected partially written records in logredo by
* ordering the updates to the header, trailer, and the move of data * ordering the updates to the header, trailer, and the move of data
* into the logdata area. The order: (1) data is moved (2) header * into the logdata area. The order: (1) data is moved (2) header
* is updated (3) trailer is updated. In logredo, when the header * is updated (3) trailer is updated. In logredo, when the header
* differed from the trailer, the header and trailer were reconciled * differed from the trailer, the header and trailer were reconciled
* as follows: if h.page != t.page they were set to the smaller of * as follows: if h.page != t.page they were set to the smaller of
* the two and h.eor and t.eor set to 8 (i.e. empty page). if (only) * the two and h.eor and t.eor set to 8 (i.e. empty page). if (only)
* h.eor != t.eor they were set to the smaller of their two values. * h.eor != t.eor they were set to the smaller of their two values.
*/ */
struct logpage { struct logpage {
...@@ -147,20 +147,20 @@ struct logpage { ...@@ -147,20 +147,20 @@ struct logpage {
* in a page, pages are written to temporary paging space if * in a page, pages are written to temporary paging space if
* if they must be written to disk before commit, and i/o is * if they must be written to disk before commit, and i/o is
* scheduled for modified pages to their home location after * scheduled for modified pages to their home location after
* the log records containing the after values and the commit * the log records containing the after values and the commit
* record is written to the log on disk, undo discards the copy * record is written to the log on disk, undo discards the copy
* in main-memory.) * in main-memory.)
* *
* a log record consists of a data area of variable length followed by * a log record consists of a data area of variable length followed by
* a descriptor of fixed size LOGRDSIZE bytes. * a descriptor of fixed size LOGRDSIZE bytes.
* the data area is rounded up to an integral number of 4-bytes and * the data area is rounded up to an integral number of 4-bytes and
* must be no longer than LOGPSIZE. * must be no longer than LOGPSIZE.
* the descriptor is of size of multiple of 4-bytes and aligned on a * the descriptor is of size of multiple of 4-bytes and aligned on a
* 4-byte boundary. * 4-byte boundary.
* records are packed one after the other in the data area of log pages. * records are packed one after the other in the data area of log pages.
* (sometimes a DUMMY record is inserted so that at least one record ends * (sometimes a DUMMY record is inserted so that at least one record ends
* on every page or the longest record is placed on at most two pages). * on every page or the longest record is placed on at most two pages).
* the field eor in page header/trailer points to the byte following * the field eor in page header/trailer points to the byte following
* the last record on a page. * the last record on a page.
*/ */
...@@ -270,11 +270,11 @@ struct lrd { ...@@ -270,11 +270,11 @@ struct lrd {
/* /*
* NOREDOINOEXT: the inode extent is freed * NOREDOINOEXT: the inode extent is freed
* *
* do not apply after-image records which precede this * do not apply after-image records which precede this
* record in the log with the any of the 4 page block * record in the log with the any of the 4 page block
* numbers in this inode extent. * numbers in this inode extent.
* *
* NOTE: The fileset and pxd fields MUST remain in * NOTE: The fileset and pxd fields MUST remain in
* the same fields in the REDOPAGE record format. * the same fields in the REDOPAGE record format.
* *
*/ */
...@@ -319,12 +319,10 @@ struct lrd { ...@@ -319,12 +319,10 @@ struct lrd {
* do not apply records which precede this record in the log * do not apply records which precede this record in the log
* with the same inode number. * with the same inode number.
* *
* NOREDILE must be the first to be written at commit * NOREDOFILE must be the first to be written at commit
* (last to be read in logredo()) - it prevents * (last to be read in logredo()) - it prevents
* replay of preceding updates of all preceding generations * replay of preceding updates of all preceding generations
* of the inumber esp. the on-disk inode itself, * of the inumber esp. the on-disk inode itself.
* but does NOT prevent
* replay of the
*/ */
struct { struct {
__le32 fileset; /* 4: fileset number */ __le32 fileset; /* 4: fileset number */
...@@ -332,7 +330,7 @@ struct lrd { ...@@ -332,7 +330,7 @@ struct lrd {
} noredofile; } noredofile;
/* /*
* ? NEWPAGE: * ? NEWPAGE:
* *
* metadata type dependent * metadata type dependent
*/ */
...@@ -464,7 +462,7 @@ struct lbuf { ...@@ -464,7 +462,7 @@ struct lbuf {
s64 l_blkno; /* 8: log page block number */ s64 l_blkno; /* 8: log page block number */
caddr_t l_ldata; /* 4: data page */ caddr_t l_ldata; /* 4: data page */
struct page *l_page; /* The page itself */ struct page *l_page; /* The page itself */
uint l_offset; /* Offset of l_ldata within the page */ uint l_offset; /* Offset of l_ldata within the page */
wait_queue_head_t l_ioevent; /* 4: i/o done event */ wait_queue_head_t l_ioevent; /* 4: i/o done event */
}; };
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -461,7 +461,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) ...@@ -461,7 +461,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
goto add_failed; goto add_failed;
if (!bio->bi_size) if (!bio->bi_size)
goto dump_bio; goto dump_bio;
submit_bio(WRITE, bio); submit_bio(WRITE, bio);
} }
if (redirty) if (redirty)
...@@ -648,7 +648,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, ...@@ -648,7 +648,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
jfs_err("logical_size = %d, size = %d", jfs_err("logical_size = %d, size = %d",
mp->logical_size, size); mp->logical_size, size);
dump_stack(); dump_stack();
goto unlock; goto unlock;
} }
mp->count++; mp->count++;
lock_metapage(mp); lock_metapage(mp);
...@@ -658,7 +658,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, ...@@ -658,7 +658,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
"__get_metapage: using a " "__get_metapage: using a "
"discarded metapage"); "discarded metapage");
discard_metapage(mp); discard_metapage(mp);
goto unlock; goto unlock;
} }
clear_bit(META_discard, &mp->flag); clear_bit(META_discard, &mp->flag);
} }
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_METAPAGE #ifndef _H_JFS_METAPAGE
...@@ -33,7 +33,7 @@ struct metapage { ...@@ -33,7 +33,7 @@ struct metapage {
unsigned long flag; /* See Below */ unsigned long flag; /* See Below */
unsigned long count; /* Reference count */ unsigned long count; /* Reference count */
void *data; /* Data pointer */ void *data; /* Data pointer */
sector_t index; /* block address of page */ sector_t index; /* block address of page */
wait_queue_head_t wait; wait_queue_head_t wait;
/* implementation */ /* implementation */
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -21,18 +21,18 @@ ...@@ -21,18 +21,18 @@
* *
* note: file system in transition to aggregate/fileset: * note: file system in transition to aggregate/fileset:
* *
* file system mount is interpreted as the mount of aggregate, * file system mount is interpreted as the mount of aggregate,
* if not already mounted, and mount of the single/only fileset in * if not already mounted, and mount of the single/only fileset in
* the aggregate; * the aggregate;
* *
* a file system/aggregate is represented by an internal inode * a file system/aggregate is represented by an internal inode
* (aka mount inode) initialized with aggregate superblock; * (aka mount inode) initialized with aggregate superblock;
* each vfs represents a fileset, and points to its "fileset inode * each vfs represents a fileset, and points to its "fileset inode
* allocation map inode" (aka fileset inode): * allocation map inode" (aka fileset inode):
* (an aggregate itself is structured recursively as a filset: * (an aggregate itself is structured recursively as a filset:
* an internal vfs is constructed and points to its "fileset inode * an internal vfs is constructed and points to its "fileset inode
* allocation map inode" (aka aggregate inode) where each inode * allocation map inode" (aka aggregate inode) where each inode
* represents a fileset inode) so that inode number is mapped to * represents a fileset inode) so that inode number is mapped to
* on-disk inode in uniform way at both aggregate and fileset level; * on-disk inode in uniform way at both aggregate and fileset level;
* *
* each vnode/inode of a fileset is linked to its vfs (to facilitate * each vnode/inode of a fileset is linked to its vfs (to facilitate
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
* per aggregate information, e.g., block size, etc.) as well as * per aggregate information, e.g., block size, etc.) as well as
* its file set inode. * its file set inode.
* *
* aggregate * aggregate
* ipmnt * ipmnt
* mntvfs -> fileset ipimap+ -> aggregate ipbmap -> aggregate ipaimap; * mntvfs -> fileset ipimap+ -> aggregate ipbmap -> aggregate ipaimap;
* fileset vfs -> vp(1) <-> ... <-> vp(n) <->vproot; * fileset vfs -> vp(1) <-> ... <-> vp(n) <->vproot;
...@@ -88,7 +88,7 @@ int jfs_mount(struct super_block *sb) ...@@ -88,7 +88,7 @@ int jfs_mount(struct super_block *sb)
struct inode *ipbmap = NULL; struct inode *ipbmap = NULL;
/* /*
* read/validate superblock * read/validate superblock
* (initialize mount inode from the superblock) * (initialize mount inode from the superblock)
*/ */
if ((rc = chkSuper(sb))) { if ((rc = chkSuper(sb))) {
...@@ -238,7 +238,7 @@ int jfs_mount(struct super_block *sb) ...@@ -238,7 +238,7 @@ int jfs_mount(struct super_block *sb)
*/ */
int jfs_mount_rw(struct super_block *sb, int remount) int jfs_mount_rw(struct super_block *sb, int remount)
{ {
struct jfs_sb_info *sbi = JFS_SBI(sb); struct jfs_sb_info *sbi = JFS_SBI(sb);
int rc; int rc;
/* /*
...@@ -291,7 +291,7 @@ int jfs_mount_rw(struct super_block *sb, int remount) ...@@ -291,7 +291,7 @@ int jfs_mount_rw(struct super_block *sb, int remount)
/* /*
* chkSuper() * chkSuper()
* *
* validate the superblock of the file system to be mounted and * validate the superblock of the file system to be mounted and
* get the file system parameters. * get the file system parameters.
* *
* returns * returns
...@@ -426,7 +426,7 @@ int updateSuper(struct super_block *sb, uint state) ...@@ -426,7 +426,7 @@ int updateSuper(struct super_block *sb, uint state)
jfs_err("updateSuper: bad state"); jfs_err("updateSuper: bad state");
} else if (sbi->state == FM_DIRTY) } else if (sbi->state == FM_DIRTY)
return 0; return 0;
if ((rc = readSuper(sb, &bh))) if ((rc = readSuper(sb, &bh)))
return rc; return rc;
...@@ -486,9 +486,9 @@ int readSuper(struct super_block *sb, struct buffer_head **bpp) ...@@ -486,9 +486,9 @@ int readSuper(struct super_block *sb, struct buffer_head **bpp)
* for this file system past this point in log. * for this file system past this point in log.
* it is harmless if mount fails. * it is harmless if mount fails.
* *
* note: MOUNT record is at aggregate level, not at fileset level, * note: MOUNT record is at aggregate level, not at fileset level,
* since log records of previous mounts of a fileset * since log records of previous mounts of a fileset
* (e.g., AFTER record of extent allocation) have to be processed * (e.g., AFTER record of extent allocation) have to be processed
* to update block allocation map at aggregate level. * to update block allocation map at aggregate level.
*/ */
static int logMOUNT(struct super_block *sb) static int logMOUNT(struct super_block *sb)
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_SUPERBLOCK #ifndef _H_JFS_SUPERBLOCK
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
/* /*
* make the magic number something a human could read * make the magic number something a human could read
*/ */
#define JFS_MAGIC "JFS1" /* Magic word */ #define JFS_MAGIC "JFS1" /* Magic word */
#define JFS_VERSION 2 /* Version number: Version 2 */ #define JFS_VERSION 2 /* Version number: Version 2 */
#define LV_NAME_SIZE 11 /* MUST BE 11 for OS/2 boot sector */ #define LV_NAME_SIZE 11 /* MUST BE 11 for OS/2 boot sector */
/* /*
* aggregate superblock * aggregate superblock
* *
* The name superblock is too close to super_block, so the name has been * The name superblock is too close to super_block, so the name has been
* changed to jfs_superblock. The utilities are still using the old name. * changed to jfs_superblock. The utilities are still using the old name.
...@@ -40,7 +40,7 @@ struct jfs_superblock { ...@@ -40,7 +40,7 @@ struct jfs_superblock {
__le64 s_size; /* 8: aggregate size in hardware/LVM blocks; __le64 s_size; /* 8: aggregate size in hardware/LVM blocks;
* VFS: number of blocks * VFS: number of blocks
*/ */
__le32 s_bsize; /* 4: aggregate block size in bytes; __le32 s_bsize; /* 4: aggregate block size in bytes;
* VFS: fragment size * VFS: fragment size
*/ */
__le16 s_l2bsize; /* 2: log2 of s_bsize */ __le16 s_l2bsize; /* 2: log2 of s_bsize */
...@@ -54,7 +54,7 @@ struct jfs_superblock { ...@@ -54,7 +54,7 @@ struct jfs_superblock {
__le32 s_flag; /* 4: aggregate attributes: __le32 s_flag; /* 4: aggregate attributes:
* see jfs_filsys.h * see jfs_filsys.h
*/ */
__le32 s_state; /* 4: mount/unmount/recovery state: __le32 s_state; /* 4: mount/unmount/recovery state:
* see jfs_filsys.h * see jfs_filsys.h
*/ */
__le32 s_compress; /* 4: > 0 if data compression */ __le32 s_compress; /* 4: > 0 if data compression */
...@@ -75,11 +75,11 @@ struct jfs_superblock { ...@@ -75,11 +75,11 @@ struct jfs_superblock {
struct timestruc_t s_time; /* 8: time last updated */ struct timestruc_t s_time; /* 8: time last updated */
__le32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for __le32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for
* the fsck service log. * the fsck service log.
* N.B. These blocks are divided among the * N.B. These blocks are divided among the
* versions kept. This is not a per * versions kept. This is not a per
* version size. * version size.
* N.B. These blocks are included in the * N.B. These blocks are included in the
* length field of s_fsckpxd. * length field of s_fsckpxd.
*/ */
s8 s_fscklog; /* 1: which fsck service log is most recent s8 s_fscklog; /* 1: which fsck service log is most recent
...@@ -87,7 +87,7 @@ struct jfs_superblock { ...@@ -87,7 +87,7 @@ struct jfs_superblock {
* 1 => the first one * 1 => the first one
* 2 => the 2nd one * 2 => the 2nd one
*/ */
char s_fpack[11]; /* 11: file system volume name char s_fpack[11]; /* 11: file system volume name
* N.B. This must be 11 bytes to * N.B. This must be 11 bytes to
* conform with the OS/2 BootSector * conform with the OS/2 BootSector
* requirements * requirements
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -2026,8 +2026,6 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -2026,8 +2026,6 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
* truncate entry XAD[twm == next - 1]: * truncate entry XAD[twm == next - 1]:
*/ */
if (twm == next - 1) { if (twm == next - 1) {
struct pxd_lock *pxdlock;
/* format a maplock for txUpdateMap() to update bmap /* format a maplock for txUpdateMap() to update bmap
* to free truncated delta extent of the truncated * to free truncated delta extent of the truncated
* entry XAD[next - 1]; * entry XAD[next - 1];
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_TXNMGR #ifndef _H_JFS_TXNMGR
...@@ -179,7 +179,7 @@ struct linelock { ...@@ -179,7 +179,7 @@ struct linelock {
/* (8) */ /* (8) */
struct lv lv[20]; /* 40: */ struct lv lv[20]; /* 40: */
}; /* (48) */ }; /* (48) */
#define dt_lock linelock #define dt_lock linelock
...@@ -211,8 +211,8 @@ struct xtlock { ...@@ -211,8 +211,8 @@ struct xtlock {
* at tlock.lock/linelock: watch for alignment; * at tlock.lock/linelock: watch for alignment;
* N.B. next field may be set by linelock, and should not * N.B. next field may be set by linelock, and should not
* be modified by maplock; * be modified by maplock;
* N.B. index of the first pxdlock specifies index of next * N.B. index of the first pxdlock specifies index of next
* free maplock (i.e., number of maplock) in the tlock; * free maplock (i.e., number of maplock) in the tlock;
*/ */
struct maplock { struct maplock {
lid_t next; /* 2: */ lid_t next; /* 2: */
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
* note: file system in transition to aggregate/fileset: * note: file system in transition to aggregate/fileset:
* (ref. jfs_mount.c) * (ref. jfs_mount.c)
* *
* file system unmount is interpreted as mount of the single/only * file system unmount is interpreted as mount of the single/only
* fileset in the aggregate and, if unmount of the last fileset, * fileset in the aggregate and, if unmount of the last fileset,
* as unmount of the aggerate; * as unmount of the aggerate;
*/ */
...@@ -60,13 +60,13 @@ int jfs_umount(struct super_block *sb) ...@@ -60,13 +60,13 @@ int jfs_umount(struct super_block *sb)
jfs_info("UnMount JFS: sb:0x%p", sb); jfs_info("UnMount JFS: sb:0x%p", sb);
/* /*
* update superblock and close log * update superblock and close log
* *
* if mounted read-write and log based recovery was enabled * if mounted read-write and log based recovery was enabled
*/ */
if ((log = sbi->log)) if ((log = sbi->log))
/* /*
* Wait for outstanding transactions to be written to log: * Wait for outstanding transactions to be written to log:
*/ */
jfs_flush_journal(log, 2); jfs_flush_journal(log, 2);
...@@ -112,17 +112,17 @@ int jfs_umount(struct super_block *sb) ...@@ -112,17 +112,17 @@ int jfs_umount(struct super_block *sb)
/* /*
* ensure all file system file pages are propagated to their * ensure all file system file pages are propagated to their
* home blocks on disk (and their in-memory buffer pages are * home blocks on disk (and their in-memory buffer pages are
* invalidated) BEFORE updating file system superblock state * invalidated) BEFORE updating file system superblock state
* (to signify file system is unmounted cleanly, and thus in * (to signify file system is unmounted cleanly, and thus in
* consistent state) and log superblock active file system * consistent state) and log superblock active file system
* list (to signify skip logredo()). * list (to signify skip logredo()).
*/ */
if (log) { /* log = NULL if read-only mount */ if (log) { /* log = NULL if read-only mount */
updateSuper(sb, FM_CLEAN); updateSuper(sb, FM_CLEAN);
/* /*
* close log: * close log:
* *
* remove file system from log active file system list. * remove file system from log active file system list.
*/ */
...@@ -142,7 +142,7 @@ int jfs_umount_rw(struct super_block *sb) ...@@ -142,7 +142,7 @@ int jfs_umount_rw(struct super_block *sb)
return 0; return 0;
/* /*
* close log: * close log:
* *
* remove file system from log active file system list. * remove file system from log active file system list.
*/ */
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -57,8 +57,8 @@ int jfs_strfromUCS_le(char *to, const __le16 * from, ...@@ -57,8 +57,8 @@ int jfs_strfromUCS_le(char *to, const __le16 * from,
warn--; warn--;
warn_again--; warn_again--;
printk(KERN_ERR printk(KERN_ERR
"non-latin1 character 0x%x found in JFS file name\n", "non-latin1 character 0x%x found in JFS file name\n",
le16_to_cpu(from[i])); le16_to_cpu(from[i]));
printk(KERN_ERR printk(KERN_ERR
"mount with iocharset=utf8 to access\n"); "mount with iocharset=utf8 to access\n");
} }
...@@ -124,7 +124,7 @@ int get_UCSname(struct component_name * uniName, struct dentry *dentry) ...@@ -124,7 +124,7 @@ int get_UCSname(struct component_name * uniName, struct dentry *dentry)
kmalloc((length + 1) * sizeof(wchar_t), GFP_NOFS); kmalloc((length + 1) * sizeof(wchar_t), GFP_NOFS);
if (uniName->name == NULL) if (uniName->name == NULL)
return -ENOSPC; return -ENOMEM;
uniName->namlen = jfs_strtoUCS(uniName->name, dentry->d_name.name, uniName->namlen = jfs_strtoUCS(uniName->name, dentry->d_name.name,
length, nls_tab); length, nls_tab);
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* Portions Copyright (c) Christoph Hellwig, 2001-2002 * Portions Copyright (C) Christoph Hellwig, 2001-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_UNICODE #ifndef _H_JFS_UNICODE
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* /*
...@@ -2428,7 +2428,7 @@ printf("xtUpdate.updateLeft.split p:0x%p\n", p); ...@@ -2428,7 +2428,7 @@ printf("xtUpdate.updateLeft.split p:0x%p\n", p);
* return: * return:
*/ */
int xtAppend(tid_t tid, /* transaction id */ int xtAppend(tid_t tid, /* transaction id */
struct inode *ip, int xflag, s64 xoff, s32 maxblocks, struct inode *ip, int xflag, s64 xoff, s32 maxblocks,
s32 * xlenp, /* (in/out) */ s32 * xlenp, /* (in/out) */
s64 * xaddrp, /* (in/out) */ s64 * xaddrp, /* (in/out) */
int flag) int flag)
...@@ -2499,7 +2499,7 @@ int xtAppend(tid_t tid, /* transaction id */ ...@@ -2499,7 +2499,7 @@ int xtAppend(tid_t tid, /* transaction id */
pxdlist.maxnpxd = pxdlist.npxd = 0; pxdlist.maxnpxd = pxdlist.npxd = 0;
pxd = &pxdlist.pxd[0]; pxd = &pxdlist.pxd[0];
nblocks = JFS_SBI(ip->i_sb)->nbperpage; nblocks = JFS_SBI(ip->i_sb)->nbperpage;
for (; nsplit > 0; nsplit--, pxd++, xaddr += nblocks, maxblocks -= nblocks) { for (; nsplit > 0; nsplit--, pxd++, xaddr += nblocks, maxblocks -= nblocks) {
if ((rc = dbAllocBottomUp(ip, xaddr, (s64) nblocks)) == 0) { if ((rc = dbAllocBottomUp(ip, xaddr, (s64) nblocks)) == 0) {
PXDaddress(pxd, xaddr); PXDaddress(pxd, xaddr);
PXDlength(pxd, nblocks); PXDlength(pxd, nblocks);
...@@ -2514,7 +2514,7 @@ int xtAppend(tid_t tid, /* transaction id */ ...@@ -2514,7 +2514,7 @@ int xtAppend(tid_t tid, /* transaction id */
goto out; goto out;
} }
xlen = min(xlen, maxblocks); xlen = min(xlen, maxblocks);
/* /*
* allocate data extent requested * allocate data extent requested
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _H_JFS_XTREE #ifndef _H_JFS_XTREE
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -41,7 +41,7 @@ static s64 commitZeroLink(tid_t, struct inode *); ...@@ -41,7 +41,7 @@ static s64 commitZeroLink(tid_t, struct inode *);
/* /*
* NAME: free_ea_wmap(inode) * NAME: free_ea_wmap(inode)
* *
* FUNCTION: free uncommitted extended attributes from working map * FUNCTION: free uncommitted extended attributes from working map
* *
*/ */
static inline void free_ea_wmap(struct inode *inode) static inline void free_ea_wmap(struct inode *inode)
...@@ -62,7 +62,7 @@ static inline void free_ea_wmap(struct inode *inode) ...@@ -62,7 +62,7 @@ static inline void free_ea_wmap(struct inode *inode)
* FUNCTION: create a regular file in the parent directory <dip> * FUNCTION: create a regular file in the parent directory <dip>
* with name = <from dentry> and mode = <mode> * with name = <from dentry> and mode = <mode>
* *
* PARAMETER: dip - parent directory vnode * PARAMETER: dip - parent directory vnode
* dentry - dentry of new file * dentry - dentry of new file
* mode - create mode (rwxrwxrwx). * mode - create mode (rwxrwxrwx).
* nd- nd struct * nd- nd struct
...@@ -97,8 +97,8 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode, ...@@ -97,8 +97,8 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
* begin the transaction before we search the directory. * begin the transaction before we search the directory.
*/ */
ip = ialloc(dip, mode); ip = ialloc(dip, mode);
if (ip == NULL) { if (IS_ERR(ip)) {
rc = -ENOSPC; rc = PTR_ERR(ip);
goto out2; goto out2;
} }
...@@ -190,7 +190,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode, ...@@ -190,7 +190,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
* FUNCTION: create a child directory in the parent directory <dip> * FUNCTION: create a child directory in the parent directory <dip>
* with name = <from dentry> and mode = <mode> * with name = <from dentry> and mode = <mode>
* *
* PARAMETER: dip - parent directory vnode * PARAMETER: dip - parent directory vnode
* dentry - dentry of child directory * dentry - dentry of child directory
* mode - create mode (rwxrwxrwx). * mode - create mode (rwxrwxrwx).
* *
...@@ -231,8 +231,8 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) ...@@ -231,8 +231,8 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
* begin the transaction before we search the directory. * begin the transaction before we search the directory.
*/ */
ip = ialloc(dip, S_IFDIR | mode); ip = ialloc(dip, S_IFDIR | mode);
if (ip == NULL) { if (IS_ERR(ip)) {
rc = -ENOSPC; rc = PTR_ERR(ip);
goto out2; goto out2;
} }
...@@ -324,7 +324,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) ...@@ -324,7 +324,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
* *
* FUNCTION: remove a link to child directory * FUNCTION: remove a link to child directory
* *
* PARAMETER: dip - parent inode * PARAMETER: dip - parent inode
* dentry - child directory dentry * dentry - child directory dentry
* *
* RETURN: -EINVAL - if name is . or .. * RETURN: -EINVAL - if name is . or ..
...@@ -332,10 +332,10 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) ...@@ -332,10 +332,10 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
* errors from subroutines * errors from subroutines
* *
* note: * note:
* if other threads have the directory open when the last link * if other threads have the directory open when the last link
* is removed, the "." and ".." entries, if present, are removed before * is removed, the "." and ".." entries, if present, are removed before
* rmdir() returns and no new entries may be created in the directory, * rmdir() returns and no new entries may be created in the directory,
* but the directory is not removed until the last reference to * but the directory is not removed until the last reference to
* the directory is released (cf.unlink() of regular file). * the directory is released (cf.unlink() of regular file).
*/ */
static int jfs_rmdir(struct inode *dip, struct dentry *dentry) static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
...@@ -446,11 +446,11 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) ...@@ -446,11 +446,11 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
/* /*
* NAME: jfs_unlink(dip, dentry) * NAME: jfs_unlink(dip, dentry)
* *
* FUNCTION: remove a link to object <vp> named by <name> * FUNCTION: remove a link to object <vp> named by <name>
* from parent directory <dvp> * from parent directory <dvp>
* *
* PARAMETER: dip - inode of parent directory * PARAMETER: dip - inode of parent directory
* dentry - dentry of object to be removed * dentry - dentry of object to be removed
* *
* RETURN: errors from subroutines * RETURN: errors from subroutines
* *
...@@ -598,7 +598,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) ...@@ -598,7 +598,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
* *
* FUNCTION: for non-directory, called by jfs_remove(), * FUNCTION: for non-directory, called by jfs_remove(),
* truncate a regular file, directory or symbolic * truncate a regular file, directory or symbolic
* link to zero length. return 0 if type is not * link to zero length. return 0 if type is not
* one of these. * one of these.
* *
* if the file is currently associated with a VM segment * if the file is currently associated with a VM segment
...@@ -608,7 +608,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) ...@@ -608,7 +608,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
* map by ctrunc1. * map by ctrunc1.
* if there is no VM segment on entry, the resources are * if there is no VM segment on entry, the resources are
* freed in both work and permanent map. * freed in both work and permanent map.
* (? for temporary file - memory object is cached even * (? for temporary file - memory object is cached even
* after no reference: * after no reference:
* reference count > 0 - ) * reference count > 0 - )
* *
...@@ -662,7 +662,7 @@ static s64 commitZeroLink(tid_t tid, struct inode *ip) ...@@ -662,7 +662,7 @@ static s64 commitZeroLink(tid_t tid, struct inode *ip)
/* /*
* free xtree/data (truncate to zero length): * free xtree/data (truncate to zero length):
* free xtree/data pages from cache if COMMIT_PWMAP, * free xtree/data pages from cache if COMMIT_PWMAP,
* free xtree/data blocks from persistent block map, and * free xtree/data blocks from persistent block map, and
* free xtree/data blocks from working block map if COMMIT_PWMAP; * free xtree/data blocks from working block map if COMMIT_PWMAP;
*/ */
...@@ -677,7 +677,7 @@ static s64 commitZeroLink(tid_t tid, struct inode *ip) ...@@ -677,7 +677,7 @@ static s64 commitZeroLink(tid_t tid, struct inode *ip)
* NAME: jfs_free_zero_link() * NAME: jfs_free_zero_link()
* *
* FUNCTION: for non-directory, called by iClose(), * FUNCTION: for non-directory, called by iClose(),
* free resources of a file from cache and WORKING map * free resources of a file from cache and WORKING map
* for a file previously committed with zero link count * for a file previously committed with zero link count
* while associated with a pager object, * while associated with a pager object,
* *
...@@ -762,7 +762,7 @@ void jfs_free_zero_link(struct inode *ip) ...@@ -762,7 +762,7 @@ void jfs_free_zero_link(struct inode *ip)
* FUNCTION: create a link to <vp> by the name = <name> * FUNCTION: create a link to <vp> by the name = <name>
* in the parent directory <dvp> * in the parent directory <dvp>
* *
* PARAMETER: vp - target object * PARAMETER: vp - target object
* dvp - parent directory of new link * dvp - parent directory of new link
* name - name of new link to target object * name - name of new link to target object
* crp - credential * crp - credential
...@@ -858,8 +858,8 @@ static int jfs_link(struct dentry *old_dentry, ...@@ -858,8 +858,8 @@ static int jfs_link(struct dentry *old_dentry,
* in directory <dip> * in directory <dip>
* *
* PARAMETER: dip - parent directory vnode * PARAMETER: dip - parent directory vnode
* dentry - dentry of symbolic link * dentry - dentry of symbolic link
* name - the path name of the existing object * name - the path name of the existing object
* that will be the source of the link * that will be the source of the link
* *
* RETURN: errors from subroutines * RETURN: errors from subroutines
...@@ -906,8 +906,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -906,8 +906,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
* (iAlloc() returns new, locked inode) * (iAlloc() returns new, locked inode)
*/ */
ip = ialloc(dip, S_IFLNK | 0777); ip = ialloc(dip, S_IFLNK | 0777);
if (ip == NULL) { if (IS_ERR(ip)) {
rc = -ENOSPC; rc = PTR_ERR(ip);
goto out2; goto out2;
} }
...@@ -926,7 +926,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -926,7 +926,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
tblk->u.ixpxd = JFS_IP(ip)->ixpxd; tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
/* fix symlink access permission /* fix symlink access permission
* (dir_create() ANDs in the u.u_cmask, * (dir_create() ANDs in the u.u_cmask,
* but symlinks really need to be 777 access) * but symlinks really need to be 777 access)
*/ */
ip->i_mode |= 0777; ip->i_mode |= 0777;
...@@ -967,7 +967,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -967,7 +967,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
ip->i_mapping->a_ops = &jfs_aops; ip->i_mapping->a_ops = &jfs_aops;
/* /*
* even though the data of symlink object (source * even though the data of symlink object (source
* path name) is treated as non-journaled user data, * path name) is treated as non-journaled user data,
* it is read/written thru buffer cache for performance. * it is read/written thru buffer cache for performance.
*/ */
...@@ -978,7 +978,6 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -978,7 +978,6 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
xlen = xsize >> JFS_SBI(sb)->l2bsize; xlen = xsize >> JFS_SBI(sb)->l2bsize;
if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0))) { if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0))) {
txAbort(tid, 0); txAbort(tid, 0);
rc = -ENOSPC;
goto out3; goto out3;
} }
extent = xaddr; extent = xaddr;
...@@ -1176,7 +1175,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1176,7 +1175,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
/* free block resources */ /* free block resources */
if ((new_size = commitZeroLink(tid, new_ip)) < 0) { if ((new_size = commitZeroLink(tid, new_ip)) < 0) {
txAbort(tid, 1); /* Marks FS Dirty */ txAbort(tid, 1); /* Marks FS Dirty */
rc = new_size; rc = new_size;
goto out4; goto out4;
} }
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
...@@ -1292,7 +1291,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1292,7 +1291,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
new_size = xtTruncate_pmap(tid, new_ip, new_size); new_size = xtTruncate_pmap(tid, new_ip, new_size);
if (new_size < 0) { if (new_size < 0) {
txAbort(tid, 1); txAbort(tid, 1);
rc = new_size; rc = new_size;
} else } else
rc = txCommit(tid, 1, &new_ip, COMMIT_SYNC); rc = txCommit(tid, 1, &new_ip, COMMIT_SYNC);
txEnd(tid); txEnd(tid);
...@@ -1350,8 +1349,8 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry, ...@@ -1350,8 +1349,8 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
goto out; goto out;
ip = ialloc(dir, mode); ip = ialloc(dir, mode);
if (ip == NULL) { if (IS_ERR(ip)) {
rc = -ENOSPC; rc = PTR_ERR(ip);
goto out1; goto out1;
} }
jfs_ip = JFS_IP(ip); jfs_ip = JFS_IP(ip);
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -82,7 +82,7 @@ static void jfs_handle_error(struct super_block *sb) ...@@ -82,7 +82,7 @@ static void jfs_handle_error(struct super_block *sb)
"as read-only\n", "as read-only\n",
sb->s_id); sb->s_id);
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} }
/* nothing is done for continue beyond marking the superblock dirty */ /* nothing is done for continue beyond marking the superblock dirty */
} }
...@@ -422,7 +422,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -422,7 +422,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL); sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL);
if (!sbi) if (!sbi)
return -ENOSPC; return -ENOMEM;
sb->s_fs_info = sbi; sb->s_fs_info = sbi;
sbi->sb = sb; sbi->sb = sb;
sbi->uid = sbi->gid = sbi->umask = -1; sbi->uid = sbi->gid = sbi->umask = -1;
...@@ -775,7 +775,7 @@ static int __init init_jfs_fs(void) ...@@ -775,7 +775,7 @@ static int __init init_jfs_fs(void)
int rc; int rc;
jfs_inode_cachep = jfs_inode_cachep =
kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0, kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0,
SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
init_once, NULL); init_once, NULL);
if (jfs_inode_cachep == NULL) if (jfs_inode_cachep == NULL)
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details. * the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
* *
* 0 4 4 + EA_SIZE(ea1) * 0 4 4 + EA_SIZE(ea1)
* +------------+-------------------+--------------------+----- * +------------+-------------------+--------------------+-----
* | Overall EA | First FEA Element | Second FEA Element | ..... * | Overall EA | First FEA Element | Second FEA Element | .....
* | List Size | | | * | List Size | | |
* +------------+-------------------+--------------------+----- * +------------+-------------------+--------------------+-----
* *
...@@ -155,9 +155,9 @@ static void ea_release(struct inode *inode, struct ea_buffer *ea_buf); ...@@ -155,9 +155,9 @@ static void ea_release(struct inode *inode, struct ea_buffer *ea_buf);
/* /*
* NAME: ea_write_inline * NAME: ea_write_inline
* *
* FUNCTION: Attempt to write an EA inline if area is available * FUNCTION: Attempt to write an EA inline if area is available
* *
* PRE CONDITIONS: * PRE CONDITIONS:
* Already verified that the specified EA is small enough to fit inline * Already verified that the specified EA is small enough to fit inline
* *
...@@ -216,10 +216,10 @@ static int ea_write_inline(struct inode *ip, struct jfs_ea_list *ealist, ...@@ -216,10 +216,10 @@ static int ea_write_inline(struct inode *ip, struct jfs_ea_list *ealist,
/* /*
* NAME: ea_write * NAME: ea_write
* *
* FUNCTION: Write an EA for an inode * FUNCTION: Write an EA for an inode
* *
* PRE CONDITIONS: EA has been verified * PRE CONDITIONS: EA has been verified
* *
* PARAMETERS: * PARAMETERS:
* ip - Inode pointer * ip - Inode pointer
...@@ -340,9 +340,9 @@ static int ea_write(struct inode *ip, struct jfs_ea_list *ealist, int size, ...@@ -340,9 +340,9 @@ static int ea_write(struct inode *ip, struct jfs_ea_list *ealist, int size,
/* /*
* NAME: ea_read_inline * NAME: ea_read_inline
* *
* FUNCTION: Read an inlined EA into user's buffer * FUNCTION: Read an inlined EA into user's buffer
* *
* PARAMETERS: * PARAMETERS:
* ip - Inode pointer * ip - Inode pointer
* ealist - Pointer to buffer to fill in with EA * ealist - Pointer to buffer to fill in with EA
...@@ -372,9 +372,9 @@ static int ea_read_inline(struct inode *ip, struct jfs_ea_list *ealist) ...@@ -372,9 +372,9 @@ static int ea_read_inline(struct inode *ip, struct jfs_ea_list *ealist)
/* /*
* NAME: ea_read * NAME: ea_read
* *
* FUNCTION: copy EA data into user's buffer * FUNCTION: copy EA data into user's buffer
* *
* PARAMETERS: * PARAMETERS:
* ip - Inode pointer * ip - Inode pointer
* ealist - Pointer to buffer to fill in with EA * ealist - Pointer to buffer to fill in with EA
...@@ -406,7 +406,7 @@ static int ea_read(struct inode *ip, struct jfs_ea_list *ealist) ...@@ -406,7 +406,7 @@ static int ea_read(struct inode *ip, struct jfs_ea_list *ealist)
return -EIO; return -EIO;
} }
/* /*
* Figure out how many blocks were allocated when this EA list was * Figure out how many blocks were allocated when this EA list was
* originally written to disk. * originally written to disk.
*/ */
...@@ -443,14 +443,14 @@ static int ea_read(struct inode *ip, struct jfs_ea_list *ealist) ...@@ -443,14 +443,14 @@ static int ea_read(struct inode *ip, struct jfs_ea_list *ealist)
/* /*
* NAME: ea_get * NAME: ea_get
* *
* FUNCTION: Returns buffer containing existing extended attributes. * FUNCTION: Returns buffer containing existing extended attributes.
* The size of the buffer will be the larger of the existing * The size of the buffer will be the larger of the existing
* attributes size, or min_size. * attributes size, or min_size.
* *
* The buffer, which may be inlined in the inode or in the * The buffer, which may be inlined in the inode or in the
* page cache must be release by calling ea_release or ea_put * page cache must be release by calling ea_release or ea_put
* *
* PARAMETERS: * PARAMETERS:
* inode - Inode pointer * inode - Inode pointer
* ea_buf - Structure to be populated with ealist and its metadata * ea_buf - Structure to be populated with ealist and its metadata
...@@ -1054,7 +1054,7 @@ ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size) ...@@ -1054,7 +1054,7 @@ ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size)
/* compute required size of list */ /* compute required size of list */
for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) { for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) {
if (can_list(ea)) if (can_list(ea))
size += name_size(ea) + 1; size += name_size(ea) + 1;
} }
...@@ -1069,7 +1069,7 @@ ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size) ...@@ -1069,7 +1069,7 @@ ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size)
/* Copy attribute names to buffer */ /* Copy attribute names to buffer */
buffer = data; buffer = data;
for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) { for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) {
if (can_list(ea)) { if (can_list(ea)) {
int namelen = copy_name(buffer, ea); int namelen = copy_name(buffer, ea);
buffer += namelen + 1; buffer += namelen + 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment