X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fquota_v2.c;h=234ada90363343ad668eff8213dd0927af7aa6f2;hb=bf9127c36341573dc47a9c2fc003dcf13bbbf246;hp=b4199ec3ece460bd9818c419b7b9ed1a10fab06f;hpb=89a2fa5f2139be35e214bcf86a8291d6a1da75f2;p=pandora-kernel.git diff --git a/fs/quota_v2.c b/fs/quota_v2.c index b4199ec3ece4..234ada903633 100644 --- a/fs/quota_v2.c +++ b/fs/quota_v2.c @@ -59,6 +59,9 @@ static int v2_read_file_info(struct super_block *sb, int type) sb->s_id); return -1; } + /* limits are stored as unsigned 32-bit data */ + info->dqi_maxblimit = 0xffffffff; + info->dqi_maxilimit = 0xffffffff; info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace); info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace); info->dqi_flags = le32_to_cpu(dinfo.dqi_flags); @@ -303,7 +306,7 @@ static uint find_free_dqentry(struct dquot *dquot, int *err) printk(KERN_ERR "VFS: find_free_dqentry(): Can't remove block (%u) from entry free list.\n", blk); goto out_buf; } - dh->dqdh_entries = cpu_to_le16(le16_to_cpu(dh->dqdh_entries)+1); + le16_add_cpu(&dh->dqdh_entries, 1); memset(&fakedquot, 0, sizeof(struct v2_disk_dqblk)); /* Find free structure in block */ for (i = 0; i < V2_DQSTRINBLK && memcmp(&fakedquot, ddquot+i, sizeof(struct v2_disk_dqblk)); i++); @@ -394,7 +397,7 @@ static int v2_write_dquot(struct dquot *dquot) ssize_t ret; struct v2_disk_dqblk ddquot, empty; - /* dq_off is guarded by dqio_sem */ + /* dq_off is guarded by dqio_mutex */ if (!dquot->dq_off) if ((ret = dq_insert_tree(dquot)) < 0) { printk(KERN_ERR "VFS: Error %zd occurred while creating quota.\n", ret); @@ -445,7 +448,7 @@ static int free_dqentry(struct dquot *dquot, uint blk) goto out_buf; } dh = (struct v2_disk_dqdbheader *)buf; - dh->dqdh_entries = cpu_to_le16(le16_to_cpu(dh->dqdh_entries)-1); + le16_add_cpu(&dh->dqdh_entries, -1); if (!le16_to_cpu(dh->dqdh_entries)) { /* Block got free? */ if ((ret = remove_free_dqentry(sb, type, buf, blk)) < 0 || (ret = put_free_dqblk(sb, type, buf, blk)) < 0) {