Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / ufs / balloc.c
index 997640c..3ada9dc 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/string.h>
 #include <linux/quotaops.h>
 #include <linux/buffer_head.h>
+#include <linux/capability.h>
 #include <linux/sched.h>
 #include <linux/bitops.h>
 #include <asm/byteorder.h>
@@ -48,7 +49,7 @@ void ufs_free_fragments (struct inode * inode, unsigned fragment, unsigned count
        
        sb = inode->i_sb;
        uspi = UFS_SB(sb)->s_uspi;
-       usb1 = ubh_get_usb_first(USPI_UBH);
+       usb1 = ubh_get_usb_first(uspi);
        
        UFSD(("ENTER, fragment %u, count %u\n", fragment, count))
        
@@ -80,8 +81,9 @@ void ufs_free_fragments (struct inode * inode, unsigned fragment, unsigned count
        for (i = bit; i < end_bit; i++) {
                if (ubh_isclr (UCPI_UBH, ucpi->c_freeoff, i))
                        ubh_setbit (UCPI_UBH, ucpi->c_freeoff, i);
-               else ufs_error (sb, "ufs_free_fragments",
-                       "bit already cleared for fragment %u", i);
+               else 
+                       ufs_error (sb, "ufs_free_fragments",
+                                  "bit already cleared for fragment %u", i);
        }
        
        DQUOT_FREE_BLOCK (inode, count);
@@ -114,8 +116,7 @@ void ufs_free_fragments (struct inode * inode, unsigned fragment, unsigned count
        ubh_mark_buffer_dirty (USPI_UBH);
        ubh_mark_buffer_dirty (UCPI_UBH);
        if (sb->s_flags & MS_SYNCHRONOUS) {
-               ubh_wait_on_buffer (UCPI_UBH);
-               ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **)&ucpi);
+               ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **)&ucpi);
                ubh_wait_on_buffer (UCPI_UBH);
        }
        sb->s_dirt = 1;
@@ -143,7 +144,7 @@ void ufs_free_blocks (struct inode * inode, unsigned fragment, unsigned count) {
        
        sb = inode->i_sb;
        uspi = UFS_SB(sb)->s_uspi;
-       usb1 = ubh_get_usb_first(USPI_UBH);
+       usb1 = ubh_get_usb_first(uspi);
 
        UFSD(("ENTER, fragment %u, count %u\n", fragment, count))
        
@@ -200,8 +201,7 @@ do_more:
        ubh_mark_buffer_dirty (USPI_UBH);
        ubh_mark_buffer_dirty (UCPI_UBH);
        if (sb->s_flags & MS_SYNCHRONOUS) {
-               ubh_wait_on_buffer (UCPI_UBH);
-               ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **)&ucpi);
+               ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **)&ucpi);
                ubh_wait_on_buffer (UCPI_UBH);
        }
 
@@ -248,7 +248,7 @@ unsigned ufs_new_fragments (struct inode * inode, __fs32 * p, unsigned fragment,
        
        sb = inode->i_sb;
        uspi = UFS_SB(sb)->s_uspi;
-       usb1 = ubh_get_usb_first(USPI_UBH);
+       usb1 = ubh_get_usb_first(uspi);
        *err = -ENOSPC;
 
        lock_super (sb);
@@ -408,7 +408,7 @@ ufs_add_fragments (struct inode * inode, unsigned fragment,
        
        sb = inode->i_sb;
        uspi = UFS_SB(sb)->s_uspi;
-       usb1 = ubh_get_usb_first (USPI_UBH);
+       usb1 = ubh_get_usb_first (uspi);
        count = newcount - oldcount;
        
        cgno = ufs_dtog(fragment);
@@ -459,8 +459,7 @@ ufs_add_fragments (struct inode * inode, unsigned fragment,
        ubh_mark_buffer_dirty (USPI_UBH);
        ubh_mark_buffer_dirty (UCPI_UBH);
        if (sb->s_flags & MS_SYNCHRONOUS) {
-               ubh_wait_on_buffer (UCPI_UBH);
-               ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **)&ucpi);
+               ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **)&ucpi);
                ubh_wait_on_buffer (UCPI_UBH);
        }
        sb->s_dirt = 1;
@@ -492,7 +491,7 @@ static unsigned ufs_alloc_fragments (struct inode * inode, unsigned cgno,
 
        sb = inode->i_sb;
        uspi = UFS_SB(sb)->s_uspi;
-       usb1 = ubh_get_usb_first(USPI_UBH);
+       usb1 = ubh_get_usb_first(uspi);
        oldcg = cgno;
        
        /*
@@ -585,8 +584,7 @@ succed:
        ubh_mark_buffer_dirty (USPI_UBH);
        ubh_mark_buffer_dirty (UCPI_UBH);
        if (sb->s_flags & MS_SYNCHRONOUS) {
-               ubh_wait_on_buffer (UCPI_UBH);
-               ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **)&ucpi);
+               ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **)&ucpi);
                ubh_wait_on_buffer (UCPI_UBH);
        }
        sb->s_dirt = 1;
@@ -609,7 +607,7 @@ static unsigned ufs_alloccg_block (struct inode * inode,
 
        sb = inode->i_sb;
        uspi = UFS_SB(sb)->s_uspi;
-       usb1 = ubh_get_usb_first(USPI_UBH);
+       usb1 = ubh_get_usb_first(uspi);
        ucg = ubh_get_ucg(UCPI_UBH);
 
        if (goal == 0) {
@@ -666,7 +664,7 @@ static unsigned ufs_bitmap_search (struct super_block * sb,
        UFSD(("ENTER, cg %u, goal %u, count %u\n", ucpi->c_cgx, goal, count))
 
        uspi = UFS_SB(sb)->s_uspi;
-       usb1 = ubh_get_usb_first (USPI_UBH);
+       usb1 = ubh_get_usb_first (uspi);
        ucg = ubh_get_ucg(UCPI_UBH);
 
        if (goal)