aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/jfs_extent.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/jfs_extent.c')
-rw-r--r--fs/jfs/jfs_extent.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/jfs/jfs_extent.c b/fs/jfs/jfs_extent.c
index 933b7457bfb..a35bdca6a80 100644
--- a/fs/jfs/jfs_extent.c
+++ b/fs/jfs/jfs_extent.c
@@ -3,16 +3,16 @@
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or 6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 * (at your option) any later version.
8 * 8 *
9 * This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12 * the GNU General Public License for more details. 12 * the GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
@@ -125,7 +125,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
125 } 125 }
126 126
127 /* allocate the disk blocks for the extent. initially, extBalloc() 127 /* allocate the disk blocks for the extent. initially, extBalloc()
128 * will try to allocate disk blocks for the requested size (xlen). 128 * will try to allocate disk blocks for the requested size (xlen).
129 * if this fails (xlen contiguous free blocks not avaliable), it'll 129 * if this fails (xlen contiguous free blocks not avaliable), it'll
130 * try to allocate a smaller number of blocks (producing a smaller 130 * try to allocate a smaller number of blocks (producing a smaller
131 * extent), with this smaller number of blocks consisting of the 131 * 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 /* determine the value of the extent flag */ 150 /* determine the value of the extent flag */
151 xflag = abnr ? XAD_NOTRECORDED : 0; 151 xflag = abnr ? XAD_NOTRECORDED : 0;
152 152
153 /* if we can extend the hint extent to cover the current request, 153 /* if we can extend the hint extent to cover the current request,
154 * extend it. otherwise, insert a new extent to 154 * extend it. otherwise, insert a new extent to
155 * cover the current request. 155 * cover the current request.
156 */ 156 */
@@ -159,7 +159,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
159 else 159 else
160 rc = xtInsert(0, ip, xflag, xoff, (int) nxlen, &nxaddr, 0); 160 rc = xtInsert(0, ip, xflag, xoff, (int) nxlen, &nxaddr, 0);
161 161
162 /* if the extend or insert failed, 162 /* if the extend or insert failed,
163 * free the newly allocated blocks and return the error. 163 * free the newly allocated blocks and return the error.
164 */ 164 */
165 if (rc) { 165 if (rc) {
@@ -235,7 +235,7 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr)
235 xoff = offsetXAD(xp); 235 xoff = offsetXAD(xp);
236 236
237 /* if the extend page is abnr and if the request is for 237 /* if the extend page is abnr and if the request is for
238 * the extent to be allocated and recorded, 238 * the extent to be allocated and recorded,
239 * make the page allocated and recorded. 239 * make the page allocated and recorded.
240 */ 240 */
241 if ((xp->flag & XAD_NOTRECORDED) && !abnr) { 241 if ((xp->flag & XAD_NOTRECORDED) && !abnr) {
@@ -397,7 +397,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
397 if ((rc = xtLookupList(ip, &lxdl, &xadl, 0))) 397 if ((rc = xtLookupList(ip, &lxdl, &xadl, 0)))
398 return (rc); 398 return (rc);
399 399
400 /* check if not extent exists for the previous page. 400 /* check if not extent exists for the previous page.
401 * this is possible for sparse files. 401 * this is possible for sparse files.
402 */ 402 */
403 if (xadl.nxad == 0) { 403 if (xadl.nxad == 0) {
@@ -410,7 +410,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
410 */ 410 */
411 xp->flag &= XAD_NOTRECORDED; 411 xp->flag &= XAD_NOTRECORDED;
412 412
413 if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) { 413 if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) {
414 jfs_error(ip->i_sb, "extHint: corrupt xtree"); 414 jfs_error(ip->i_sb, "extHint: corrupt xtree");
415 return -EIO; 415 return -EIO;
416 } 416 }
@@ -492,7 +492,7 @@ int extFill(struct inode *ip, xad_t * xp)
492 * FUNCTION: allocate disk blocks to form an extent. 492 * FUNCTION: allocate disk blocks to form an extent.
493 * 493 *
494 * initially, we will try to allocate disk blocks for the 494 * initially, we will try to allocate disk blocks for the
495 * requested size (nblocks). if this fails (nblocks 495 * requested size (nblocks). if this fails (nblocks
496 * contiguous free blocks not avaliable), we'll try to allocate 496 * contiguous free blocks not avaliable), we'll try to allocate
497 * a smaller number of blocks (producing a smaller extent), with 497 * a smaller number of blocks (producing a smaller extent), with
498 * this smaller number of blocks consisting of the requested 498 * this smaller number of blocks consisting of the requested
@@ -500,7 +500,7 @@ int extFill(struct inode *ip, xad_t * xp)
500 * number (i.e. 16 -> 8). we'll continue to round down and 500 * number (i.e. 16 -> 8). we'll continue to round down and
501 * retry the allocation until the number of blocks to allocate 501 * retry the allocation until the number of blocks to allocate
502 * is smaller than the number of blocks per page. 502 * is smaller than the number of blocks per page.
503 * 503 *
504 * PARAMETERS: 504 * PARAMETERS:
505 * ip - the inode of the file. 505 * ip - the inode of the file.
506 * hint - disk block number to be used as an allocation hint. 506 * hint - disk block number to be used as an allocation hint.
@@ -509,7 +509,7 @@ int extFill(struct inode *ip, xad_t * xp)
509 * exit, this value is set to the number of blocks actually 509 * exit, this value is set to the number of blocks actually
510 * allocated. 510 * allocated.
511 * blkno - pointer to a block address that is filled in on successful 511 * blkno - pointer to a block address that is filled in on successful
512 * return with the starting block number of the newly 512 * return with the starting block number of the newly
513 * allocated block range. 513 * allocated block range.
514 * 514 *
515 * RETURN VALUES: 515 * RETURN VALUES:
@@ -530,7 +530,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
530 /* get the number of blocks to initially attempt to allocate. 530 /* get the number of blocks to initially attempt to allocate.
531 * we'll first try the number of blocks requested unless this 531 * we'll first try the number of blocks requested unless this
532 * number is greater than the maximum number of contiguous free 532 * number is greater than the maximum number of contiguous free
533 * blocks in the map. in that case, we'll start off with the 533 * blocks in the map. in that case, we'll start off with the
534 * maximum free. 534 * maximum free.
535 */ 535 */
536 max = (s64) 1 << bmp->db_maxfreebud; 536 max = (s64) 1 << bmp->db_maxfreebud;
@@ -582,19 +582,19 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
582 * 582 *
583 * FUNCTION: attempt to extend an extent's allocation. 583 * FUNCTION: attempt to extend an extent's allocation.
584 * 584 *
585 * initially, we will try to extend the extent's allocation 585 * Initially, we will try to extend the extent's allocation
586 * in place. if this fails, we'll try to move the extent 586 * in place. If this fails, we'll try to move the extent
587 * to a new set of blocks. if moving the extent, we initially 587 * to a new set of blocks. If moving the extent, we initially
588 * will try to allocate disk blocks for the requested size 588 * will try to allocate disk blocks for the requested size
589 * (nnew). if this fails (new contiguous free blocks not 589 * (newnblks). if this fails (new contiguous free blocks not
590 * avaliable), we'll try to allocate a smaller number of 590 * avaliable), we'll try to allocate a smaller number of
591 * blocks (producing a smaller extent), with this smaller 591 * blocks (producing a smaller extent), with this smaller
592 * number of blocks consisting of the requested number of 592 * number of blocks consisting of the requested number of
593 * blocks rounded down to the next smaller power of 2 593 * blocks rounded down to the next smaller power of 2
594 * number (i.e. 16 -> 8). we'll continue to round down and 594 * number (i.e. 16 -> 8). We'll continue to round down and
595 * retry the allocation until the number of blocks to allocate 595 * retry the allocation until the number of blocks to allocate
596 * is smaller than the number of blocks per page. 596 * is smaller than the number of blocks per page.
597 * 597 *
598 * PARAMETERS: 598 * PARAMETERS:
599 * ip - the inode of the file. 599 * ip - the inode of the file.
600 * blkno - starting block number of the extents current allocation. 600 * blkno - starting block number of the extents current allocation.
@@ -625,7 +625,7 @@ extBrealloc(struct inode *ip,
625 return (rc); 625 return (rc);
626 } 626 }
627 627
628 /* in place extension not possible. 628 /* in place extension not possible.
629 * try to move the extent to a new set of blocks. 629 * try to move the extent to a new set of blocks.
630 */ 630 */
631 return (extBalloc(ip, blkno, newnblks, newblkno)); 631 return (extBalloc(ip, blkno, newnblks, newblkno));