[ARM] pxa/raumfeld: fix button name
[safe/jmp/linux-2.6] / fs / ufs / balloc.c
index 841ac25..5cfa4d8 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <linux/fs.h>
-#include <linux/ufs_fs.h>
 #include <linux/stat.h>
 #include <linux/time.h>
 #include <linux/string.h>
@@ -19,6 +18,8 @@
 #include <linux/bitops.h>
 #include <asm/byteorder.h>
 
+#include "ufs_fs.h"
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
@@ -84,7 +85,7 @@ void ufs_free_fragments(struct inode *inode, u64 fragment, unsigned count)
                                   "bit already cleared for fragment %u", i);
        }
        
-       DQUOT_FREE_BLOCK (inode, count);
+       dquot_free_block(inode, count);
 
        
        fs32_add(sb, &ucg->cg_cs.cs_nffree, count);
@@ -194,7 +195,7 @@ do_more:
                ubh_setblock(UCPI_UBH(ucpi), ucpi->c_freeoff, blkno);
                if ((UFS_SB(sb)->s_flags & UFS_CG_MASK) == UFS_CG_44BSD)
                        ufs_clusteracct (sb, ucpi, blkno, 1);
-               DQUOT_FREE_BLOCK(inode, uspi->s_fpb);
+               dquot_free_block(inode, uspi->s_fpb);
 
                fs32_add(sb, &ucg->cg_cs.cs_nbfree, 1);
                uspi->cs_total.cs_nbfree++;
@@ -276,7 +277,7 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg,
                        if (!page)/* it was truncated */
                                continue;
                        if (IS_ERR(page)) {/* or EIO */
-                               ufs_error(inode->i_sb, __FUNCTION__,
+                               ufs_error(inode->i_sb, __func__,
                                          "read of page %llu failed\n",
                                          (unsigned long long)index);
                                continue;
@@ -307,15 +308,15 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg,
                                ll_rw_block(READ, 1, &bh);
                                wait_on_buffer(bh);
                                if (!buffer_uptodate(bh)) {
-                                       ufs_error(inode->i_sb, __FUNCTION__,
+                                       ufs_error(inode->i_sb, __func__,
                                                  "read of block failed\n");
                                        break;
                                }
                        }
 
                        UFSD(" change from %llu to %llu, pos %u\n",
-                            (unsigned long long)pos + oldb,
-                            (unsigned long long)pos + newb, pos);
+                            (unsigned long long)(pos + oldb),
+                            (unsigned long long)(pos + newb), pos);
 
                        bh->b_blocknr = newb + pos;
                        unmap_underlying_metadata(bh->b_bdev,
@@ -510,6 +511,7 @@ static u64 ufs_add_fragments(struct inode *inode, u64 fragment,
        struct ufs_cg_private_info * ucpi;
        struct ufs_cylinder_group * ucg;
        unsigned cgno, fragno, fragoff, count, fragsize, i;
+       int ret;
        
        UFSD("ENTER, fragment %llu, oldcount %u, newcount %u\n",
             (unsigned long long)fragment, oldcount, newcount);
@@ -555,8 +557,9 @@ static u64 ufs_add_fragments(struct inode *inode, u64 fragment,
                fs32_add(sb, &ucg->cg_frsum[fragsize - count], 1);
        for (i = oldcount; i < newcount; i++)
                ubh_clrbit (UCPI_UBH(ucpi), ucpi->c_freeoff, fragno + i);
-       if(DQUOT_ALLOC_BLOCK(inode, count)) {
-               *err = -EDQUOT;
+       ret = dquot_alloc_block(inode, count);
+       if (ret) {
+               *err = ret;
                return 0;
        }
 
@@ -595,6 +598,7 @@ static u64 ufs_alloc_fragments(struct inode *inode, unsigned cgno,
        struct ufs_cylinder_group * ucg;
        unsigned oldcg, i, j, k, allocsize;
        u64 result;
+       int ret;
        
        UFSD("ENTER, ino %lu, cgno %u, goal %llu, count %u\n",
             inode->i_ino, cgno, (unsigned long long)goal, count);
@@ -663,7 +667,7 @@ cg_found:
                for (i = count; i < uspi->s_fpb; i++)
                        ubh_setbit (UCPI_UBH(ucpi), ucpi->c_freeoff, goal + i);
                i = uspi->s_fpb - count;
-               DQUOT_FREE_BLOCK(inode, i);
+               dquot_free_block(inode, i);
 
                fs32_add(sb, &ucg->cg_cs.cs_nffree, i);
                uspi->cs_total.cs_nffree += i;
@@ -675,8 +679,9 @@ cg_found:
        result = ufs_bitmap_search (sb, ucpi, goal, allocsize);
        if (result == INVBLOCK)
                return 0;
-       if(DQUOT_ALLOC_BLOCK(inode, count)) {
-               *err = -EDQUOT;
+       ret = dquot_alloc_block(inode, count);
+       if (ret) {
+               *err = ret;
                return 0;
        }
        for (i = 0; i < count; i++)
@@ -713,6 +718,7 @@ static u64 ufs_alloccg_block(struct inode *inode,
        struct ufs_super_block_first * usb1;
        struct ufs_cylinder_group * ucg;
        u64 result, blkno;
+       int ret;
 
        UFSD("ENTER, goal %llu\n", (unsigned long long)goal);
 
@@ -746,8 +752,9 @@ gotit:
        ubh_clrblock (UCPI_UBH(ucpi), ucpi->c_freeoff, blkno);
        if ((UFS_SB(sb)->s_flags & UFS_CG_MASK) == UFS_CG_44BSD)
                ufs_clusteracct (sb, ucpi, blkno, -1);
-       if(DQUOT_ALLOC_BLOCK(inode, uspi->s_fpb)) {
-               *err = -EDQUOT;
+       ret = dquot_alloc_block(inode, uspi->s_fpb);
+       if (ret) {
+               *err = ret;
                return INVBLOCK;
        }