/*
- * Copyright (C) International Business Machines Corp., 2000-2003
+ * Copyright (C) International Business Machines Corp., 2000-2004
*
* 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
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/pagemap.h>
+#include <linux/quotaops.h>
#include <linux/vserver/xid.h>
#include "jfs_incore.h"
ip->i_mapping->a_ops = &jfs_aops;
mapping_set_gfp_mask(ip->i_mapping, GFP_NOFS);
+ /* Allocations to metadata inodes should not affect quotas */
+ ip->i_flags |= S_NOQUOTA;
+
if ((inum == FILESYSTEM_I) && (JFS_IP(ip)->ipimap == sbi->ipaimap)) {
sbi->gengen = le32_to_cpu(dp->di_gengen);
sbi->inostamp = le32_to_cpu(dp->di_inostamp);
iagp->inosmap[i] = ONES;
flush_metapage(mp);
-#ifdef _STILL_TO_PORT
- /* synchronously write the iag page */
- if (bmWrite(bp)) {
- /* Free the blocks allocated for the iag since it was
- * not successfully added to the inode map
- */
- dbFree(ipimap, xaddr, (s64) xlen);
-
- /* release the inode map lock */
- IWRITE_UNLOCK(ipimap);
-
- rc = -EIO;
- goto out;
- }
-
- /* Now the iag is on disk */
/*
* start tyransaction of update of the inode map
* addressing structure pointing to the new iag page;
*/
-#endif /* _STILL_TO_PORT */
tid = txBegin(sb, COMMIT_FORCE);
down(&JFS_IP(ipimap)->commit_sem);
/* update the inode map's inode to reflect the extension */
ipimap->i_size += PSIZE;
- ipimap->i_blocks += LBLK2PBLK(sb, xlen);
+ inode_add_bytes(ipimap, PSIZE);
/*
* txCommit(COMMIT_FORCE) will synchronously write address
}
/* update the inode map's inode to reflect the extension */
ip->i_size += PSIZE;
- ip->i_blocks += LBLK2PBLK(sb, xlen);
+ inode_add_bytes(ip, PSIZE);
txCommit(tid, 1, &ip, COMMIT_FORCE);
cleanup:
txEnd(tid);
ip->i_uid = INOXID_UID(XID_TAG(ip), uid, gid);
ip->i_gid = INOXID_GID(XID_TAG(ip), uid, gid);
ip->i_xid = INOXID_XID(XID_TAG(ip), uid, gid, 0);
-
+
ip->i_size = le64_to_cpu(dip->di_size);
ip->i_atime.tv_sec = le32_to_cpu(dip->di_atime.tv_sec);
ip->i_atime.tv_nsec = le32_to_cpu(dip->di_atime.tv_nsec);