Whamcloud - gitweb
b=2914
[fs/lustre-release.git] / lustre / lvfs / fsfilt_ext3.c
index 5de8a9b..91513f8 100644 (file)
@@ -74,6 +74,7 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private)
 {
         /* For updates to the last recieved file */
         int nblocks = EXT3_DATA_TRANS_BLOCKS;
+        int blocksize, block_count = 0;
         void *handle;
 
         if (current->journal_info) {
@@ -119,6 +120,13 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private)
                 /* Setattr on inode */
                 nblocks += 1;
                 break;
+        case FSFILT_OP_CANCEL_UNLINK_LOG:
+                blocksize = 1 << inode->i_blkbits;
+                block_count = (blocksize - 1) + LLOG_CHUNK_SIZE;
+                block_count = (block_count + blocksize - 1) >> inode->i_blkbits;
+                block_count = block_count * EXT3_DATA_TRANS_BLOCKS + 2;
+                nblocks = 2 * 2 * block_count;
+                break;
         default: CERROR("unknown transaction start op %d\n", op);
                  LBUG();
         }
@@ -656,7 +664,11 @@ static int fsfilt_ext3_add_journal_cb(struct obd_device *obd, __u64 last_rcvd,
 static int fsfilt_ext3_statfs(struct super_block *sb, struct obd_statfs *osfs)
 {
         struct kstatfs sfs;
-        int rc = vfs_statfs(sb, &sfs);
+        int rc;
+
+        memset(&sfs, 0, sizeof(sfs));
+
+        rc = sb->s_op->statfs(sb, &sfs);
 
         if (!rc && sfs.f_bfree < sfs.f_ffree) {
                 sfs.f_files = (sfs.f_files - sfs.f_ffree) + sfs.f_bfree;