-%patch
-Index: linux-2.6.5-7.276/include/linux/ext3_jbd.h
+Index: linux-2.6.5-7.283/include/linux/ext3_jbd.h
===================================================================
---- linux-2.6.5-7.276.orig/include/linux/ext3_jbd.h 2006-09-15 17:44:48.000000000 +0800
-+++ linux-2.6.5-7.276/include/linux/ext3_jbd.h 2006-10-26 16:47:10.000000000 +0800
-@@ -72,6 +72,19 @@
+--- linux-2.6.5-7.283.orig/include/linux/ext3_jbd.h
++++ linux-2.6.5-7.283/include/linux/ext3_jbd.h
+@@ -72,6 +72,19 @@ extern int ext3_writepage_trans_blocks(s
#define EXT3_INDEX_EXTRA_TRANS_BLOCKS 8
int
ext3_mark_iloc_dirty(handle_t *handle,
struct inode *inode,
-@@ -97,6 +110,8 @@
+@@ -97,6 +110,8 @@ int ext3_mark_inode_dirty(handle_t *hand
void ext3_journal_abort_handle(const char *caller, const char *err_fn,
struct buffer_head *bh, handle_t *handle, int err);
static inline int
__ext3_journal_get_undo_access(const char *where, handle_t *handle,
struct buffer_head *bh, int *credits)
-Index: linux-2.6.5-7.276/include/linux/fs.h
+Index: linux-2.6.5-7.283/include/linux/fs.h
===================================================================
---- linux-2.6.5-7.276.orig/include/linux/fs.h 2006-10-26 16:47:09.000000000 +0800
-+++ linux-2.6.5-7.276/include/linux/fs.h 2006-10-26 16:47:10.000000000 +0800
-@@ -967,6 +967,9 @@
+--- linux-2.6.5-7.283.orig/include/linux/fs.h
++++ linux-2.6.5-7.283/include/linux/fs.h
+@@ -967,6 +967,9 @@ struct super_operations {
void (*umount_begin) (struct super_block *);
int (*show_options)(struct seq_file *, struct vfsmount *);
};
/* Inode state bits. Protected by inode_lock. */
-Index: linux-2.6.5-7.276/include/linux/quota.h
+Index: linux-2.6.5-7.283/include/linux/quota.h
===================================================================
---- linux-2.6.5-7.276.orig/include/linux/quota.h 2006-09-15 17:44:47.000000000 +0800
-+++ linux-2.6.5-7.276/include/linux/quota.h 2006-10-26 16:47:10.000000000 +0800
-@@ -138,6 +138,10 @@
+--- linux-2.6.5-7.283.orig/include/linux/quota.h
++++ linux-2.6.5-7.283/include/linux/quota.h
+@@ -138,6 +138,10 @@ struct if_dqinfo {
#include <linux/dqblk_v1.h>
#include <linux/dqblk_v2.h>
/*
* Data for one user/group kept in memory
*/
-@@ -168,22 +172,21 @@
+@@ -168,22 +172,21 @@ struct mem_dqinfo {
} u;
};
struct dqstats {
int lookups;
-@@ -204,6 +207,9 @@
+@@ -204,6 +207,9 @@ extern struct dqstats dqstats;
#define DQ_BLKS_B 1
#define DQ_INODES_B 2
#define DQ_FAKE_B 3
#define DQ_MOD (1 << DQ_MOD_B) /* dquot modified since read */
#define DQ_BLKS (1 << DQ_BLKS_B) /* uid/gid has been warned about blk limit */
-@@ -239,18 +245,22 @@
+@@ -239,18 +245,22 @@ struct quota_format_ops {
int (*free_file_info)(struct super_block *sb, int type); /* Called on quotaoff() */
int (*read_dqblk)(struct dquot *dquot); /* Read structure for one user */
int (*commit_dqblk)(struct dquot *dquot); /* Write (or delete) structure for one user */
};
/* Operations handling requests from userspace */
-@@ -283,7 +293,8 @@
+@@ -283,7 +293,8 @@ struct quota_info {
struct semaphore dqio_sem; /* lock device while I/O in progress */
struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */
struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */
struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
};
-Index: linux-2.6.5-7.276/include/linux/quotaops.h
+Index: linux-2.6.5-7.283/include/linux/quotaops.h
===================================================================
---- linux-2.6.5-7.276.orig/include/linux/quotaops.h 2006-09-30 11:24:23.000000000 +0800
-+++ linux-2.6.5-7.276/include/linux/quotaops.h 2006-10-30 10:39:46.000000000 +0800
+--- linux-2.6.5-7.283.orig/include/linux/quotaops.h
++++ linux-2.6.5-7.283/include/linux/quotaops.h
@@ -22,17 +22,22 @@
*/
extern void sync_dquots(struct super_block *sb, int type);
/*
* Operations supported for diskquotas.
*/
-@@ -143,7 +148,7 @@
+@@ -143,7 +148,7 @@ static __inline__ int DQUOT_OFF(struct s
{
int ret = -ENOSYS;
ret = sb->s_qcop->quota_off(sb, -1);
return ret;
}
-Index: linux-2.6.5-7.276/include/linux/security.h
+Index: linux-2.6.5-7.283/include/linux/security.h
===================================================================
---- linux-2.6.5-7.276.orig/include/linux/security.h 2006-09-15 17:44:47.000000000 +0800
-+++ linux-2.6.5-7.276/include/linux/security.h 2006-10-26 16:47:10.000000000 +0800
-@@ -1020,7 +1020,7 @@
+--- linux-2.6.5-7.283.orig/include/linux/security.h
++++ linux-2.6.5-7.283/include/linux/security.h
+@@ -1020,7 +1020,7 @@ struct security_operations {
int (*sysctl) (ctl_table * table, int op);
int (*capable) (struct task_struct * tsk, int cap);
int (*quotactl) (int cmds, int type, int id, struct super_block * sb);
int (*syslog) (int type);
int (*vm_enough_memory) (long pages);
-@@ -1292,9 +1292,9 @@
+@@ -1292,9 +1292,9 @@ static inline int security_quotactl (int
0);
}
0);
}
-Index: linux-2.6.5-7.276/security/dummy.c
+Index: linux-2.6.5-7.283/security/dummy.c
===================================================================
---- linux-2.6.5-7.276.orig/security/dummy.c 2006-09-15 17:44:47.000000000 +0800
-+++ linux-2.6.5-7.276/security/dummy.c 2006-10-26 16:47:10.000000000 +0800
-@@ -90,7 +90,7 @@
+--- linux-2.6.5-7.283.orig/security/dummy.c
++++ linux-2.6.5-7.283/security/dummy.c
+@@ -90,7 +90,7 @@ static int dummy_quotactl (int cmds, int
return 0;
}
{
return 0;
}
-Index: linux-2.6.5-7.276/security/selinux/hooks.c
+Index: linux-2.6.5-7.283/security/selinux/hooks.c
===================================================================
---- linux-2.6.5-7.276.orig/security/selinux/hooks.c 2006-09-15 17:44:47.000000000 +0800
-+++ linux-2.6.5-7.276/security/selinux/hooks.c 2006-10-26 16:47:10.000000000 +0800
-@@ -1454,9 +1454,9 @@
+--- linux-2.6.5-7.283.orig/security/selinux/hooks.c
++++ linux-2.6.5-7.283/security/selinux/hooks.c
+@@ -1454,9 +1454,9 @@ static int selinux_quotactl(int cmds, in
return rc;
}
}
static int selinux_syslog(int type)
-Index: linux-2.6.5-7.276/fs/dquot.c
+Index: linux-2.6.5-7.283/fs/dquot.c
===================================================================
---- linux-2.6.5-7.276.orig/fs/dquot.c 2006-09-15 17:44:47.000000000 +0800
-+++ linux-2.6.5-7.276/fs/dquot.c 2006-10-26 16:47:10.000000000 +0800
+--- linux-2.6.5-7.283.orig/fs/dquot.c
++++ linux-2.6.5-7.283/fs/dquot.c
@@ -52,6 +52,9 @@
* New SMP locking.
* Jan Kara, <jack@suse.cz>, 10/2002
* dqonoff_sem > journal_lock > dqptr_sem > dquot->dq_lock > dqio_sem
*/
spinlock_t dq_list_lock = SPIN_LOCK_UNLOCKED;
-@@ -175,8 +179,7 @@
+@@ -175,8 +179,7 @@ static void put_quota_format(struct quot
* on all three lists, depending on its current state.
*
* All dquots are placed to the end of inuse_list when first created, and this
*
* Unused dquots (dq_count == 0) are added to the free_dquots list when freed,
* and this list is searched whenever we need an available dquot. Dquots are
-@@ -264,30 +267,105 @@
+@@ -264,30 +267,105 @@ static void wait_on_dquot(struct dquot *
up(&dquot->dq_lock);
}
/* Invalidate all dquots on the list. Note that this function is called after
* quota is disabled so no new quota might be created. Because we hold
* dqonoff_sem and pointers were already removed from inodes we actually know
-@@ -343,6 +421,11 @@
+@@ -343,6 +421,11 @@ restart:
continue;
if (!dquot_dirty(dquot))
continue;
atomic_inc(&dquot->dq_count);
dqstats.lookups++;
spin_unlock(&dq_list_lock);
-@@ -353,11 +436,9 @@
+@@ -353,11 +436,9 @@ restart:
spin_unlock(&dq_list_lock);
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
spin_lock(&dq_list_lock);
dqstats.syncs++;
spin_unlock(&dq_list_lock);
-@@ -432,11 +513,19 @@
+@@ -432,11 +513,19 @@ we_slept:
spin_unlock(&dq_list_lock);
return;
}
atomic_dec(&dquot->dq_count);
#ifdef __DQUOT_PARANOIA
/* sanity check */
-@@ -495,7 +584,6 @@
+@@ -495,7 +584,6 @@ we_slept:
insert_dquot_hash(dquot);
dqstats.lookups++;
spin_unlock(&dq_list_lock);
} else {
if (!atomic_read(&dquot->dq_count))
remove_free_dquot(dquot);
-@@ -503,10 +591,15 @@
+@@ -503,10 +591,15 @@ we_slept:
dqstats.cache_hits++;
dqstats.lookups++;
spin_unlock(&dq_list_lock);
#ifdef __DQUOT_PARANOIA
if (!dquot->dq_sb) /* Has somebody invalidated entry under us? */
-@@ -819,19 +912,19 @@
+@@ -819,19 +912,19 @@ static int check_bdq(struct dquot *dquot
*
* Note: this is a blocking operation.
*/
}
/* Build list of quotas to initialize... */
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
-@@ -852,13 +945,14 @@
+@@ -852,13 +945,14 @@ void dquot_initialize(struct inode *inod
}
}
up_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
{
int cnt;
-@@ -871,6 +965,7 @@
+@@ -871,6 +965,7 @@ void dquot_drop(struct inode *inode)
}
}
up_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
}
/*
-@@ -958,14 +1053,14 @@
+@@ -958,14 +1053,14 @@ warn_put_all:
/*
* This is a non-blocking operation.
*/
}
down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
spin_lock(&dq_data_lock);
-@@ -981,23 +1076,24 @@
+@@ -981,23 +1076,24 @@ sub_bytes:
inode_sub_bytes(inode, number);
spin_unlock(&dq_data_lock);
up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
}
spin_lock(&dq_data_lock);
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
-@@ -1007,6 +1103,7 @@
+@@ -1007,6 +1103,7 @@ void dquot_free_inode(const struct inode
}
spin_unlock(&dq_data_lock);
up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
}
/*
-@@ -1104,6 +1201,20 @@
+@@ -1104,6 +1201,20 @@ warn_put_all:
}
/*
* Definitions of diskquota operations.
*/
struct dquot_operations dquot_operations = {
-@@ -1114,7 +1225,10 @@
+@@ -1114,7 +1225,10 @@ struct dquot_operations dquot_operations
.free_space = dquot_free_space,
.free_inode = dquot_free_inode,
.transfer = dquot_transfer,
};
/* Function used by filesystems for initializing the dquot_operations structure */
-@@ -1154,13 +1268,14 @@
+@@ -1154,13 +1268,14 @@ int vfs_quota_off(struct super_block *sb
{
int cnt;
struct quota_info *dqopt = sb_dqopt(sb);
if (type != -1 && cnt != type)
continue;
if (!sb_has_quota_enabled(sb, cnt))
-@@ -1172,94 +1287,115 @@
+@@ -1172,94 +1287,115 @@ int vfs_quota_off(struct super_block *sb
invalidate_dquots(sb, cnt);
/*
* Now all dquots should be invalidated, all writes done so we should be only
dqopt->ops[type] = fmt->qf_ops;
dqopt->info[type].dqi_format = fmt;
-@@ -1269,6 +1405,7 @@
+@@ -1269,6 +1405,7 @@ int vfs_quota_on(struct super_block *sb,
goto out_file_init;
}
up(&dqopt->dqio_sem);
set_enable_flags(dqopt, type);
add_dquot_ref(sb, type);
-@@ -1277,18 +1414,51 @@
+@@ -1277,18 +1414,51 @@ int vfs_quota_on(struct super_block *sb,
return 0;
out_file_init:
/* Generic routine for getting common part of quota structure */
static void do_get_dqblk(struct dquot *dquot, struct if_dqblk *di)
{
-@@ -1430,8 +1600,10 @@
+@@ -1430,8 +1600,10 @@ int vfs_set_dqinfo(struct super_block *s
mi->dqi_igrace = ii->dqi_igrace;
if (ii->dqi_valid & IIF_FLAGS)
mi->dqi_flags = (mi->dqi_flags & ~DQF_MASK) | (ii->dqi_flags & DQF_MASK);
up(&sb_dqopt(sb)->dqonoff_sem);
return 0;
}
-@@ -1564,3 +1736,15 @@
+@@ -1564,3 +1736,15 @@ EXPORT_SYMBOL(dqstats);
EXPORT_SYMBOL(dq_list_lock);
EXPORT_SYMBOL(dq_data_lock);
EXPORT_SYMBOL(init_dquot_operations);
+EXPORT_SYMBOL(dquot_free_inode);
+EXPORT_SYMBOL(dquot_transfer);
+
-Index: linux-2.6.5-7.276/fs/quota_v2.c
+Index: linux-2.6.5-7.283/fs/quota_v2.c
===================================================================
---- linux-2.6.5-7.276.orig/fs/quota_v2.c 2006-09-15 17:44:47.000000000 +0800
-+++ linux-2.6.5-7.276/fs/quota_v2.c 2006-10-26 16:47:10.000000000 +0800
+--- linux-2.6.5-7.283.orig/fs/quota_v2.c
++++ linux-2.6.5-7.283/fs/quota_v2.c
@@ -13,7 +13,6 @@
#include <linux/slab.h>
MODULE_AUTHOR("Jan Kara");
MODULE_DESCRIPTION("Quota format v2 support");
-@@ -30,19 +29,15 @@
+@@ -30,19 +29,15 @@ typedef char *dqbuf_t;
static int v2_check_quota_file(struct super_block *sb, int type)
{
struct v2_disk_dqheader dqhead;
if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type] ||
le32_to_cpu(dqhead.dqh_version) != quota_versions[type])
return 0;
-@@ -52,20 +47,15 @@
+@@ -52,20 +47,15 @@ static int v2_check_quota_file(struct su
/* Read information header from quota file */
static int v2_read_file_info(struct super_block *sb, int type)
{
return -1;
}
info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace);
-@@ -80,12 +70,9 @@
+@@ -80,12 +70,9 @@ static int v2_read_file_info(struct supe
/* Write information header to quota file */
static int v2_write_file_info(struct super_block *sb, int type)
{
info->dqi_flags &= ~DQF_INFO_DIRTY;
dinfo.dqi_bgrace = cpu_to_le32(info->dqi_bgrace);
-@@ -94,13 +81,13 @@
+@@ -94,13 +81,13 @@ static int v2_write_file_info(struct sup
dinfo.dqi_blocks = cpu_to_le32(info->u.v2_i.dqi_blocks);
dinfo.dqi_free_blk = cpu_to_le32(info->u.v2_i.dqi_free_blk);
dinfo.dqi_free_entry = cpu_to_le32(info->u.v2_i.dqi_free_entry);
return -1;
}
return 0;
-@@ -144,38 +131,24 @@
+@@ -144,38 +131,24 @@ static inline void freedqbuf(dqbuf_t buf
kfree(buf);
}
struct v2_disk_dqdbheader *dh = (struct v2_disk_dqdbheader *)buf;
int ret, blk;
-@@ -183,17 +156,18 @@
+@@ -183,17 +156,18 @@ static int get_free_dqblk(struct file *f
return -ENOMEM;
if (info->u.v2_i.dqi_free_blk) {
blk = info->u.v2_i.dqi_free_blk;
ret = blk;
out_buf:
freedqbuf(buf);
-@@ -201,8 +175,9 @@
+@@ -201,8 +175,9 @@ out_buf:
}
/* Insert empty block to the list */
struct v2_disk_dqdbheader *dh = (struct v2_disk_dqdbheader *)buf;
int err;
-@@ -210,16 +185,18 @@
+@@ -210,16 +185,18 @@ static int put_free_dqblk(struct file *f
dh->dqdh_prev_free = cpu_to_le32(0);
dh->dqdh_entries = cpu_to_le16(0);
info->u.v2_i.dqi_free_blk = blk;
struct v2_disk_dqdbheader *dh = (struct v2_disk_dqdbheader *)buf;
uint nextblk = le32_to_cpu(dh->dqdh_next_free), prevblk = le32_to_cpu(dh->dqdh_prev_free);
int err;
-@@ -227,26 +204,27 @@
+@@ -227,26 +204,27 @@ static int remove_free_dqentry(struct fi
if (!tmpbuf)
return -ENOMEM;
if (nextblk) {
printk(KERN_ERR "VFS: Can't write block (%u) with free entries.\n", blk);
return 0;
out_buf:
-@@ -255,9 +233,10 @@
+@@ -255,9 +233,10 @@ out_buf:
}
/* Insert given block to the beginning of list with free entries */
struct v2_disk_dqdbheader *dh = (struct v2_disk_dqdbheader *)buf;
int err;
-@@ -265,18 +244,18 @@
+@@ -265,18 +244,18 @@ static int insert_free_dqentry(struct fi
return -ENOMEM;
dh->dqdh_next_free = cpu_to_le32(info->u.v2_i.dqi_free_entry);
dh->dqdh_prev_free = cpu_to_le32(0);
return 0;
out_buf:
freedqbuf(tmpbuf);
-@@ -286,8 +265,8 @@
+@@ -286,8 +265,8 @@ out_buf:
/* Find space for dquot */
static uint find_free_dqentry(struct dquot *dquot, int *err)
{
uint blk, i;
struct v2_disk_dqdbheader *dh;
struct v2_disk_dqblk *ddquot;
-@@ -303,22 +282,23 @@
+@@ -303,22 +282,23 @@ static uint find_free_dqentry(struct dqu
ddquot = GETENTRIES(buf);
if (info->u.v2_i.dqi_free_entry) {
blk = info->u.v2_i.dqi_free_entry;
printk(KERN_ERR "VFS: find_free_dqentry(): Can't remove block (%u) from entry free list.\n", blk);
goto out_buf;
}
-@@ -333,7 +313,7 @@
+@@ -333,7 +313,7 @@ static uint find_free_dqentry(struct dqu
goto out_buf;
}
#endif
printk(KERN_ERR "VFS: find_free_dqentry(): Can't write quota data block %u.\n", blk);
goto out_buf;
}
-@@ -348,8 +328,7 @@
+@@ -348,8 +328,7 @@ out_buf:
/* Insert reference to structure into the trie */
static int do_insert_tree(struct dquot *dquot, uint *treeblk, int depth)
{
dqbuf_t buf;
int ret = 0, newson = 0, newact = 0;
u32 *ref;
-@@ -358,7 +337,7 @@
+@@ -358,7 +337,7 @@ static int do_insert_tree(struct dquot *
if (!(buf = getdqbuf()))
return -ENOMEM;
if (!*treeblk) {
if (ret < 0)
goto out_buf;
*treeblk = ret;
-@@ -366,7 +345,7 @@
+@@ -366,7 +345,7 @@ static int do_insert_tree(struct dquot *
newact = 1;
}
else {
printk(KERN_ERR "VFS: Can't read tree quota block %u.\n", *treeblk);
goto out_buf;
}
-@@ -389,10 +368,10 @@
+@@ -389,10 +368,10 @@ static int do_insert_tree(struct dquot *
ret = do_insert_tree(dquot, &newblk, depth+1);
if (newson && ret >= 0) {
ref[GETIDINDEX(dquot->dq_id, depth)] = cpu_to_le32(newblk);
out_buf:
freedqbuf(buf);
return ret;
-@@ -411,19 +390,14 @@
+@@ -411,19 +390,14 @@ static inline int dq_insert_tree(struct
static int v2_write_dquot(struct dquot *dquot)
{
int type = dquot->dq_type;
mem2diskdqb(&ddquot, &dquot->dq_dqb, dquot->dq_id);
/* Argh... We may need to write structure full of zeroes but that would be
* treated as an empty place by the rest of the code. Format change would
-@@ -431,10 +405,10 @@
+@@ -431,10 +405,10 @@ static int v2_write_dquot(struct dquot *
memset(&empty, 0, sizeof(struct v2_disk_dqblk));
if (!memcmp(&empty, &ddquot, sizeof(struct v2_disk_dqblk)))
ddquot.dqb_itime = cpu_to_le64(1);
if (ret != sizeof(struct v2_disk_dqblk)) {
printk(KERN_WARNING "VFS: dquota write failed on dev %s\n", dquot->dq_sb->s_id);
if (ret >= 0)
-@@ -450,8 +424,8 @@
+@@ -450,8 +424,8 @@ static int v2_write_dquot(struct dquot *
/* Free dquot entry in data block */
static int free_dqentry(struct dquot *dquot, uint blk)
{
struct v2_disk_dqdbheader *dh;
dqbuf_t buf = getdqbuf();
int ret = 0;
-@@ -459,34 +433,39 @@
+@@ -459,34 +433,39 @@ static int free_dqentry(struct dquot *dq
if (!buf)
return -ENOMEM;
if (dquot->dq_off >> V2_DQBLKSIZE_BITS != blk) {
goto out_buf;
}
}
-@@ -499,8 +478,8 @@
+@@ -499,8 +478,8 @@ out_buf:
/* Remove reference to dquot from tree */
static int remove_tree(struct dquot *dquot, uint *blk, int depth)
{
dqbuf_t buf = getdqbuf();
int ret = 0;
uint newblk;
-@@ -508,7 +487,7 @@
+@@ -508,7 +487,7 @@ static int remove_tree(struct dquot *dqu
if (!buf)
return -ENOMEM;
printk(KERN_ERR "VFS: Can't read quota data block %u\n", *blk);
goto out_buf;
}
-@@ -524,12 +503,13 @@
+@@ -524,12 +503,13 @@ static int remove_tree(struct dquot *dqu
ref[GETIDINDEX(dquot->dq_id, depth)] = cpu_to_le32(0);
for (i = 0; i < V2_DQBLKSIZE && !buf[i]; i++); /* Block got empty? */
if (i == V2_DQBLKSIZE) {
}
out_buf:
freedqbuf(buf);
-@@ -549,7 +529,6 @@
+@@ -549,7 +529,6 @@ static int v2_delete_dquot(struct dquot
/* Find entry in block */
static loff_t find_block_dqentry(struct dquot *dquot, uint blk)
{
dqbuf_t buf = getdqbuf();
loff_t ret = 0;
int i;
-@@ -557,27 +536,31 @@
+@@ -557,27 +536,31 @@ static loff_t find_block_dqentry(struct
if (!buf)
return -ENOMEM;
out_buf:
freedqbuf(buf);
return ret;
-@@ -586,14 +569,13 @@
+@@ -586,14 +569,13 @@ out_buf:
/* Find entry for given id in the tree */
static loff_t find_tree_dqentry(struct dquot *dquot, uint blk, int depth)
{
printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk);
goto out_buf;
}
-@@ -619,16 +601,13 @@
+@@ -619,16 +601,13 @@ static inline loff_t find_dqentry(struct
static int v2_read_dquot(struct dquot *dquot)
{
int type = dquot->dq_type;
printk(KERN_ERR "VFS: Quota invalidated while reading!\n");
return -EIO;
}
-@@ -636,7 +615,8 @@
+@@ -636,7 +615,8 @@ static int v2_read_dquot(struct dquot *d
offset = find_dqentry(dquot);
if (offset <= 0) { /* Entry not present? */
if (offset < 0)
dquot->dq_off = 0;
dquot->dq_flags |= DQ_FAKE;
memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk));
-@@ -644,12 +624,13 @@
+@@ -644,12 +624,13 @@ static int v2_read_dquot(struct dquot *d
}
else {
dquot->dq_off = offset;
memset(&ddquot, 0, sizeof(struct v2_disk_dqblk));
}
else {
-@@ -660,7 +641,6 @@
+@@ -660,7 +641,6 @@ static int v2_read_dquot(struct dquot *d
if (!memcmp(&empty, &ddquot, sizeof(struct v2_disk_dqblk)))
ddquot.dqb_itime = 0;
}
disk2memdqb(&dquot->dq_dqb, &ddquot);
}
dqstats.reads++;
-@@ -668,15 +648,13 @@
+@@ -668,15 +648,13 @@ static int v2_read_dquot(struct dquot *d
return ret;
}
}
static struct quota_format_ops v2_format_ops = {
-@@ -685,7 +663,8 @@
+@@ -685,7 +663,8 @@ static struct quota_format_ops v2_format
.write_file_info = v2_write_file_info,
.free_file_info = NULL,
.read_dqblk = v2_read_dquot,
};
static struct quota_format_type v2_quota_format = {
-Index: linux-2.6.5-7.276/fs/quota.c
+Index: linux-2.6.5-7.283/fs/quota.c
===================================================================
---- linux-2.6.5-7.276.orig/fs/quota.c 2006-09-15 17:44:47.000000000 +0800
-+++ linux-2.6.5-7.276/fs/quota.c 2006-10-26 16:47:10.000000000 +0800
+--- linux-2.6.5-7.283.orig/fs/quota.c
++++ linux-2.6.5-7.283/fs/quota.c
@@ -14,6 +14,9 @@
#include <linux/smp_lock.h>
#include <linux/security.h>
/* Check validity of quotactl */
static int check_quotactl_valid(struct super_block *sb, int type, int cmd, qid_t id)
-@@ -134,16 +137,54 @@
+@@ -134,16 +137,54 @@ restart:
return NULL;
}
drop_super(sb);
}
}
-Index: linux-2.6.5-7.276/fs/ext3/inode.c
+Index: linux-2.6.5-7.283/fs/ext3/inode.c
===================================================================
---- linux-2.6.5-7.276.orig/fs/ext3/inode.c 2006-09-15 17:44:48.000000000 +0800
-+++ linux-2.6.5-7.276/fs/ext3/inode.c 2006-10-26 16:47:10.000000000 +0800
-@@ -1015,7 +1015,7 @@
+--- linux-2.6.5-7.283.orig/fs/ext3/inode.c
++++ linux-2.6.5-7.283/fs/ext3/inode.c
+@@ -1015,7 +1015,7 @@ out:
return ret;
}
ext3_journal_dirty_data(handle_t *handle, struct buffer_head *bh)
{
int err = journal_dirty_data(handle, bh);
-Index: linux-2.6.5-7.276/fs/ext3/super.c
+Index: linux-2.6.5-7.283/fs/ext3/super.c
===================================================================
---- linux-2.6.5-7.276.orig/fs/ext3/super.c 2006-09-15 17:44:48.000000000 +0800
-+++ linux-2.6.5-7.276/fs/ext3/super.c 2006-10-26 16:47:10.000000000 +0800
+--- linux-2.6.5-7.283.orig/fs/ext3/super.c
++++ linux-2.6.5-7.283/fs/ext3/super.c
@@ -33,6 +33,7 @@
#include <linux/vfs.h>
#include <linux/random.h>
#include "xattr.h"
#include "acl.h"
-@@ -505,7 +506,33 @@
+@@ -505,7 +506,33 @@ static void ext3_clear_inode(struct inod
ext3_discard_reservation(inode);
}
static struct super_operations ext3_sops = {
.alloc_inode = ext3_alloc_inode,
-@@ -522,6 +549,10 @@
+@@ -522,6 +549,10 @@ static struct super_operations ext3_sops
.statfs = ext3_statfs,
.remount_fs = ext3_remount,
.clear_inode = ext3_clear_inode,
+#endif
};
- struct dentry *ext3_get_parent(struct dentry *child);
-@@ -1335,7 +1366,9 @@
+ static struct dentry *ext3_get_dentry(struct super_block *sb, void *vobjp)
+@@ -1377,7 +1408,9 @@ static int ext3_fill_super (struct super
*/
sb->s_op = &ext3_sops;
sb->s_export_op = &ext3_export_ops;
INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
sb->s_root = 0;
-@@ -1998,70 +2031,200 @@
+@@ -2040,70 +2073,200 @@ int ext3_statfs (struct super_block * sb
#ifdef CONFIG_QUOTA
#endif
static struct super_block *ext3_get_sb(struct file_system_type *fs_type,
-@@ -2086,13 +2249,7 @@
+@@ -2128,13 +2291,7 @@ static int __init init_ext3_fs(void)
err = init_inodecache();
if (err)
goto out1;
err = register_filesystem_lifo(&ext3_fs_type);
if (err)
goto out;
-Index: linux-2.6.5-7.276/fs/quota_v1.c
+Index: linux-2.6.5-7.283/fs/quota_v1.c
===================================================================
---- linux-2.6.5-7.276.orig/fs/quota_v1.c 2006-09-15 17:44:47.000000000 +0800
-+++ linux-2.6.5-7.276/fs/quota_v1.c 2006-10-26 16:47:10.000000000 +0800
+--- linux-2.6.5-7.283.orig/fs/quota_v1.c
++++ linux-2.6.5-7.283/fs/quota_v1.c
@@ -7,7 +7,6 @@
#include <linux/init.h>
#include <linux/module.h>
#include <asm/byteorder.h>
MODULE_AUTHOR("Jan Kara");
-@@ -41,23 +40,14 @@
+@@ -41,23 +40,14 @@ static void v1_mem2disk_dqblk(struct v1_
static int v1_read_dqblk(struct dquot *dquot)
{
int type = dquot->dq_type;
v1_disk2mem_dqblk(&dquot->dq_dqb, &dqblk);
if (dquot->dq_dqb.dqb_bhardlimit == 0 && dquot->dq_dqb.dqb_bsoftlimit == 0 &&
-@@ -71,17 +61,9 @@
+@@ -71,17 +61,9 @@ static int v1_read_dqblk(struct dquot *d
static int v1_commit_dqblk(struct dquot *dquot)
{
short type = dquot->dq_type;
/*
* Note: clear the DQ_MOD flag unconditionally,
* so we don't loop forever on failure.
-@@ -93,9 +75,10 @@
+@@ -93,9 +75,10 @@ static int v1_commit_dqblk(struct dquot
dqblk.dqb_itime = sb_dqopt(dquot->dq_sb)->info[type].dqi_igrace;
}
ret = 0;
if (ret != sizeof(struct v1_disk_dqblk)) {
printk(KERN_WARNING "VFS: dquota write failed on dev %s\n",
dquot->dq_sb->s_id);
-@@ -106,7 +89,6 @@
+@@ -106,7 +89,6 @@ static int v1_commit_dqblk(struct dquot
ret = 0;
out:
dqstats.writes++;
return ret;
-@@ -126,14 +108,11 @@
+@@ -126,14 +108,11 @@ struct v2_disk_dqheader {
static int v1_check_quota_file(struct super_block *sb, int type)
{
loff_t isize;
static const uint quota_magics[] = V2_INITQMAGICS;
-@@ -145,10 +124,7 @@
+@@ -145,10 +124,7 @@ static int v1_check_quota_file(struct su
if ((blocks % sizeof(struct v1_disk_dqblk) * BLOCK_SIZE + off) % sizeof(struct v1_disk_dqblk))
return 0;
/* Doublecheck whether we didn't get file with new format - with old quotactl() this could happen */
if (size != sizeof(struct v2_disk_dqheader))
return 1; /* Probably not new format */
if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type])
-@@ -160,16 +136,10 @@
+@@ -160,16 +136,10 @@ static int v1_check_quota_file(struct su
static int v1_read_file_info(struct super_block *sb, int type)
{
struct quota_info *dqopt = sb_dqopt(sb);
if (ret >= 0)
ret = -EIO;
goto out;
-@@ -178,38 +148,31 @@
+@@ -178,38 +148,31 @@ static int v1_read_file_info(struct supe
dqopt->info[type].dqi_igrace = dqblk.dqb_itime ? dqblk.dqb_itime : MAX_IQ_TIME;
dqopt->info[type].dqi_bgrace = dqblk.dqb_btime ? dqblk.dqb_btime : MAX_DQ_TIME;
out:
return ret;
}
-
-%diffstat
- fs/dquot.c | 370 +++++++++++++++++++++++++++++++++++------------
- fs/ext3/inode.c | 2
- fs/ext3/super.c | 271 +++++++++++++++++++++++++++-------
- fs/quota.c | 47 +++++
- fs/quota_v1.c | 63 +-------
- fs/quota_v2.c | 245 ++++++++++++++-----------------
- include/linux/ext3_jbd.h | 15 +
- include/linux/fs.h | 3
- include/linux/quota.h | 31 ++-
- include/linux/quotaops.h | 15 +
- include/linux/security.h | 6
- security/dummy.c | 2
- security/selinux/hooks.c | 4
- 13 files changed, 716 insertions(+), 358 deletions(-)
-
+Index: linux-2.6.5-7.283/fs/reiserfs/super.c
+===================================================================
+--- linux-2.6.5-7.283.orig/fs/reiserfs/super.c
++++ linux-2.6.5-7.283/fs/reiserfs/super.c
+@@ -1677,7 +1677,7 @@ inversion between quota and journal lock
+ #define REISERFS_V0_QFMT_BLOCKS (4*(JOURNAL_PER_BALANCE_CNT+2)+2+1)
+
+ static int (*old_write_dquot)(struct dquot *dquot);
+-static void (*old_drop_dquot)(struct inode *inode);
++static int (*old_drop_dquot)(struct inode *inode);
+
+ static int fmt_to_blocks(int fmt)
+ {
+@@ -1697,10 +1697,8 @@ static int reiserfs_write_dquot(struct d
+ int err;
+ struct reiserfs_transaction_handle handle;
+ struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
+- struct inode *qinode;
+
+ nblocks = fmt_to_blocks(dqopt->info[dquot->dq_type].dqi_format->qf_fmt_id);
+- qinode = dqopt->files[dquot->dq_type]->f_dentry->d_inode;
+ reiserfs_write_lock(dquot->dq_sb);
+ ret = journal_begin(&handle, dquot->dq_sb, nblocks);
+ if (ret)
+@@ -1713,11 +1711,12 @@ static int reiserfs_write_dquot(struct d
+ return ret;
+ }
+
+-static void reiserfs_drop_dquot(struct inode *inode)
++static int reiserfs_drop_dquot(struct inode *inode)
+ {
+ int nblocks, type;
+ struct quota_info *dqopt = sb_dqopt(inode->i_sb);
+ struct reiserfs_transaction_handle handle;
++ int err, ret;
+
+ for (type = 0; type < MAXQUOTAS; type++) {
+ if (sb_has_quota_enabled(inode->i_sb, type))
+@@ -1728,12 +1727,15 @@ static void reiserfs_drop_dquot(struct i
+ else
+ nblocks = 0; /* No quota => no drop */
+ reiserfs_write_lock(inode->i_sb);
+- if (journal_begin(&handle, inode->i_sb, 2*nblocks))
+- return;
+- old_drop_dquot(inode);
+- journal_end(&handle, inode->i_sb, 2*nblocks);
++ err = journal_begin(&handle, inode->i_sb, 2*nblocks);
++ if (err);
++ return err;
++ ret = old_drop_dquot(inode);
++ err = journal_end(&handle, inode->i_sb, 2*nblocks);
++ if (!ret)
++ ret = err;
+ reiserfs_write_unlock(inode->i_sb);
+- return;
++ return ret;
+ }
+ #endif
+