vserver 1.9.3
[linux-2.6.git] / fs / jfs / inode.c
index 2b70f81..d94abcc 100644 (file)
@@ -1,6 +1,6 @@
 /*
- *   Copyright (c) International Business Machines Corp., 2000-2002
- *   Portions Copyright (c) Christoph Hellwig, 2001-2002
+ *   Copyright (C) International Business Machines Corp., 2000-2004
+ *   Portions Copyright (C) Christoph Hellwig, 2001-2002
  *
  *   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
@@ -21,6 +21,7 @@
 #include <linux/mpage.h>
 #include <linux/buffer_head.h>
 #include <linux/pagemap.h>
+#include <linux/quotaops.h>
 #include "jfs_incore.h"
 #include "jfs_filsys.h"
 #include "jfs_imap.h"
@@ -105,10 +106,10 @@ int jfs_commit_inode(struct inode *inode, int wait)
        return rc;
 }
 
-void jfs_write_inode(struct inode *inode, int wait)
+int jfs_write_inode(struct inode *inode, int wait)
 {
        if (test_cflag(COMMIT_Nolink, inode))
-               return;
+               return 0;
        /*
         * If COMMIT_DIRTY is not set, the inode isn't really dirty.
         * It has been committed since the last change, but was still
@@ -117,12 +118,14 @@ void jfs_write_inode(struct inode *inode, int wait)
         if (!test_cflag(COMMIT_Dirty, inode)) {
                /* Make sure committed changes hit the disk */
                jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait);
-               return;
+               return 0;
         }
 
        if (jfs_commit_inode(inode, wait)) {
                jfs_err("jfs_write_inode: jfs_commit_inode failed!");
-       }
+               return -EIO;
+       } else
+               return 0;
 }
 
 void jfs_delete_inode(struct inode *inode)
@@ -134,6 +137,13 @@ void jfs_delete_inode(struct inode *inode)
 
        diFree(inode);
 
+       /*
+        * Free the inode from the quota allocation.
+        */
+       DQUOT_INIT(inode);
+       DQUOT_FREE_INODE(inode);
+       DQUOT_DROP(inode);
+
        clear_inode(inode);
 }