git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
fs
/
jfs
/
jfs_extent.c
diff --git
a/fs/jfs/jfs_extent.c
b/fs/jfs/jfs_extent.c
index
2b411bc
..
1953acb
100644
(file)
--- a/
fs/jfs/jfs_extent.c
+++ b/
fs/jfs/jfs_extent.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) International Business Machines Corp., 2000-200
3
+ * Copyright (C) International Business Machines Corp., 2000-200
4
*
* 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
*
* 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
@@
-17,6
+17,7
@@
*/
#include <linux/fs.h>
*/
#include <linux/fs.h>
+#include <linux/quotaops.h>
#include "jfs_incore.h"
#include "jfs_superblock.h"
#include "jfs_dmap.h"
#include "jfs_incore.h"
#include "jfs_superblock.h"
#include "jfs_dmap.h"
@@
-144,6
+145,13
@@
extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr)
return (rc);
}
return (rc);
}
+ /* Allocate blocks to quota. */
+ if (DQUOT_ALLOC_BLOCK(ip, nxlen)) {
+ dbFree(ip, nxaddr, (s64) nxlen);
+ up(&JFS_IP(ip)->commit_sem);
+ return -EDQUOT;
+ }
+
/* determine the value of the extent flag */
xflag = (abnr == TRUE) ? XAD_NOTRECORDED : 0;
/* determine the value of the extent flag */
xflag = (abnr == TRUE) ? XAD_NOTRECORDED : 0;
@@
-161,13
+169,11
@@
extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr)
*/
if (rc) {
dbFree(ip, nxaddr, nxlen);
*/
if (rc) {
dbFree(ip, nxaddr, nxlen);
+ DQUOT_FREE_BLOCK(ip, nxlen);
up(&JFS_IP(ip)->commit_sem);
return (rc);
}
up(&JFS_IP(ip)->commit_sem);
return (rc);
}
- /* update the number of blocks allocated to the file */
- ip->i_blocks += LBLK2PBLK(ip->i_sb, nxlen);
-
/* set the results of the extent allocation */
XADaddress(xp, nxaddr);
XADlength(xp, nxlen);
/* set the results of the extent allocation */
XADaddress(xp, nxaddr);
XADlength(xp, nxlen);
@@
-254,6
+260,13
@@
int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, boolean_t abnr)
if ((rc = extBrealloc(ip, xaddr, xlen, &nxlen, &nxaddr)))
goto exit;
if ((rc = extBrealloc(ip, xaddr, xlen, &nxlen, &nxaddr)))
goto exit;
+ /* Allocat blocks to quota. */
+ if (DQUOT_ALLOC_BLOCK(ip, nxlen)) {
+ dbFree(ip, nxaddr, (s64) nxlen);
+ up(&JFS_IP(ip)->commit_sem);
+ return -EDQUOT;
+ }
+
delta = nxlen - xlen;
/* check if the extend page is not abnr but the request is abnr
delta = nxlen - xlen;
/* check if the extend page is not abnr but the request is abnr
@@
-289,6
+302,7
@@
int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, boolean_t abnr)
/* extend the extent */
if ((rc = xtExtend(0, ip, xoff + xlen, (int) nextend, 0))) {
dbFree(ip, xaddr + xlen, delta);
/* extend the extent */
if ((rc = xtExtend(0, ip, xoff + xlen, (int) nextend, 0))) {
dbFree(ip, xaddr + xlen, delta);
+ DQUOT_FREE_BLOCK(ip, nxlen);
goto exit;
}
} else {
goto exit;
}
} else {
@@
-299,6
+313,7
@@
int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, boolean_t abnr)
*/
if ((rc = xtTailgate(0, ip, xoff, (int) ntail, nxaddr, 0))) {
dbFree(ip, nxaddr, nxlen);
*/
if ((rc = xtTailgate(0, ip, xoff, (int) ntail, nxaddr, 0))) {
dbFree(ip, nxaddr, nxlen);
+ DQUOT_FREE_BLOCK(ip, nxlen);
goto exit;
}
}
goto exit;
}
}
@@
-320,9
+335,6
@@
int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, boolean_t abnr)
}
}
}
}
- /* update the inode with the number of blocks allocated */
- ip->i_blocks += LBLK2PBLK(sb, delta);
-
/* set the return results */
XADaddress(xp, nxaddr);
XADlength(xp, nxlen);
/* set the return results */
XADaddress(xp, nxaddr);
XADlength(xp, nxlen);