Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 335833
b: refs/heads/master
c: 8c8a4b6
h: refs/heads/master
i:
  335831: 5176f2d
v: v3
  • Loading branch information
Avi Kivity committed Nov 20, 2012
1 parent d3f3c86 commit d2412ac
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 67 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c60b689631d73be046ecbe9fc3248252ba18b41f
refs/heads/master: 8c8a4b610b537b64326f4eea261984f12f8da073
5 changes: 5 additions & 0 deletions trunk/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,11 @@ S: Kattreinstr 38
S: D-64295
S: Germany

N: Avi Kivity
E: avi.kivity@gmail.com
D: Kernel-based Virtual Machine (KVM)
S: Ra'annana, Israel

N: Andi Kleen
E: andi@firstfloor.org
U: http://www.halobates.de
Expand Down
5 changes: 2 additions & 3 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,10 @@ F: drivers/video/geode/
F: arch/x86/include/asm/geode.h

AMD IOMMU (AMD-VI)
M: Joerg Roedel <joro@8bytes.org>
M: Joerg Roedel <joerg.roedel@amd.com>
L: iommu@lists.linux-foundation.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
S: Maintained
S: Supported
F: drivers/iommu/amd_iommu*.[ch]
F: include/linux/amd-iommu.h

Expand Down Expand Up @@ -4280,7 +4280,6 @@ F: include/linux/lockd/
F: include/linux/sunrpc/

KERNEL VIRTUAL MACHINE (KVM)
M: Avi Kivity <avi@redhat.com>
M: Marcelo Tosatti <mtosatti@redhat.com>
L: kvm@vger.kernel.org
W: http://kvm.qumranet.com
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4108,7 +4108,7 @@ static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to)
static int intel_iommu_add_device(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct pci_dev *bridge, *dma_pdev = NULL;
struct pci_dev *bridge, *dma_pdev;
struct iommu_group *group;
int ret;

Expand All @@ -4122,7 +4122,7 @@ static int intel_iommu_add_device(struct device *dev)
dma_pdev = pci_get_domain_bus_and_slot(
pci_domain_nr(pdev->bus),
bridge->subordinate->number, 0);
if (!dma_pdev)
else
dma_pdev = pci_dev_get(bridge);
} else
dma_pdev = pci_dev_get(pdev);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/iommu/tegra-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,6 @@ static int smmu_debugfs_stats_show(struct seq_file *s, void *v)
stats[i], val, offs);
}
seq_printf(s, "\n");
dput(dent);

return 0;
}
Expand Down
5 changes: 2 additions & 3 deletions trunk/fs/ext3/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,9 +2101,8 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)
end = start + (range->len >> sb->s_blocksize_bits) - 1;
minlen = range->minlen >> sb->s_blocksize_bits;

if (minlen > EXT3_BLOCKS_PER_GROUP(sb) ||
start >= max_blks ||
range->len < sb->s_blocksize)
if (unlikely(minlen > EXT3_BLOCKS_PER_GROUP(sb)) ||
unlikely(start >= max_blks))
return -EINVAL;
if (end >= max_blks)
end = max_blks - 1;
Expand Down
10 changes: 3 additions & 7 deletions trunk/fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1782,9 +1782,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,

BUG_ON(!th->t_trans_id);

reiserfs_write_unlock(inode->i_sb);
dquot_initialize(inode);
err = dquot_alloc_inode(inode);
reiserfs_write_lock(inode->i_sb);
if (err)
goto out_end_trans;
if (!dir->i_nlink) {
Expand Down Expand Up @@ -1980,10 +1979,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,

out_end_trans:
journal_end(th, th->t_super, th->t_blocks_allocated);
reiserfs_write_unlock(inode->i_sb);
/* Drop can be outside and it needs more credits so it's better to have it outside */
dquot_drop(inode);
reiserfs_write_lock(inode->i_sb);
inode->i_flags |= S_NOQUOTA;
make_bad_inode(inode);

Expand Down Expand Up @@ -3106,9 +3103,10 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
/* must be turned off for recursive notify_change calls */
ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID);

depth = reiserfs_write_lock_once(inode->i_sb);
if (is_quota_modification(inode, attr))
dquot_initialize(inode);
depth = reiserfs_write_lock_once(inode->i_sb);

if (attr->ia_valid & ATTR_SIZE) {
/* version 2 items will be caught by the s_maxbytes check
** done for us in vmtruncate
Expand Down Expand Up @@ -3172,9 +3170,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
error = journal_begin(&th, inode->i_sb, jbegin_count);
if (error)
goto out;
reiserfs_write_unlock_once(inode->i_sb, depth);
error = dquot_transfer(inode, attr);
depth = reiserfs_write_lock_once(inode->i_sb);
if (error) {
journal_end(&th, inode->i_sb, jbegin_count);
goto out;
Expand Down
4 changes: 0 additions & 4 deletions trunk/fs/reiserfs/stree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,9 +1968,7 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
key2type(&(key->on_disk_key)));
#endif

reiserfs_write_unlock(inode->i_sb);
retval = dquot_alloc_space_nodirty(inode, pasted_size);
reiserfs_write_lock(inode->i_sb);
if (retval) {
pathrelse(search_path);
return retval;
Expand Down Expand Up @@ -2063,11 +2061,9 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
"reiserquota insert_item(): allocating %u id=%u type=%c",
quota_bytes, inode->i_uid, head2type(ih));
#endif
reiserfs_write_unlock(inode->i_sb);
/* We can't dirty inode here. It would be immediately written but
* appropriate stat item isn't inserted yet... */
retval = dquot_alloc_space_nodirty(inode, quota_bytes);
reiserfs_write_lock(inode->i_sb);
if (retval) {
pathrelse(path);
return retval;
Expand Down
60 changes: 14 additions & 46 deletions trunk/fs/reiserfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ static int finish_unfinished(struct super_block *s)
retval = remove_save_link_only(s, &save_link_key, 0);
continue;
}
reiserfs_write_unlock(s);
dquot_initialize(inode);
reiserfs_write_lock(s);

if (truncate && S_ISDIR(inode->i_mode)) {
/* We got a truncate request for a dir which is impossible.
Expand Down Expand Up @@ -1337,7 +1335,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
kfree(qf_names[i]);
#endif
err = -EINVAL;
goto out_unlock;
goto out_err;
}
#ifdef CONFIG_QUOTA
handle_quota_files(s, qf_names, &qfmt);
Expand Down Expand Up @@ -1381,7 +1379,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
if (blocks) {
err = reiserfs_resize(s, blocks);
if (err != 0)
goto out_unlock;
goto out_err;
}

if (*mount_flags & MS_RDONLY) {
Expand All @@ -1391,15 +1389,9 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
/* it is read-only already */
goto out_ok;

/*
* Drop write lock. Quota will retake it when needed and lock
* ordering requires calling dquot_suspend() without it.
*/
reiserfs_write_unlock(s);
err = dquot_suspend(s, -1);
if (err < 0)
goto out_err;
reiserfs_write_lock(s);

/* try to remount file system with read-only permissions */
if (sb_umount_state(rs) == REISERFS_VALID_FS
Expand All @@ -1409,7 +1401,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)

err = journal_begin(&th, s, 10);
if (err)
goto out_unlock;
goto out_err;

/* Mounting a rw partition read-only. */
reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1);
Expand All @@ -1424,7 +1416,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)

if (reiserfs_is_journal_aborted(journal)) {
err = journal->j_errno;
goto out_unlock;
goto out_err;
}

handle_data_mode(s, mount_options);
Expand All @@ -1433,7 +1425,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
s->s_flags &= ~MS_RDONLY; /* now it is safe to call journal_begin */
err = journal_begin(&th, s, 10);
if (err)
goto out_unlock;
goto out_err;

/* Mount a partition which is read-only, read-write */
reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1);
Expand All @@ -1450,16 +1442,10 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
SB_JOURNAL(s)->j_must_wait = 1;
err = journal_end(&th, s, 10);
if (err)
goto out_unlock;
goto out_err;

if (!(*mount_flags & MS_RDONLY)) {
/*
* Drop write lock. Quota will retake it when needed and lock
* ordering requires calling dquot_resume() without it.
*/
reiserfs_write_unlock(s);
dquot_resume(s, -1);
reiserfs_write_lock(s);
finish_unfinished(s);
reiserfs_xattr_init(s, *mount_flags);
}
Expand All @@ -1469,10 +1455,9 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
reiserfs_write_unlock(s);
return 0;

out_unlock:
reiserfs_write_unlock(s);
out_err:
kfree(new_opts);
reiserfs_write_unlock(s);
return err;
}

Expand Down Expand Up @@ -2110,15 +2095,13 @@ static int reiserfs_write_dquot(struct dquot *dquot)
REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
if (ret)
goto out;
reiserfs_write_unlock(dquot->dq_sb);
ret = dquot_commit(dquot);
reiserfs_write_lock(dquot->dq_sb);
err =
journal_end(&th, dquot->dq_sb,
REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
if (!ret && err)
ret = err;
out:
out:
reiserfs_write_unlock(dquot->dq_sb);
return ret;
}
Expand All @@ -2134,15 +2117,13 @@ static int reiserfs_acquire_dquot(struct dquot *dquot)
REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb));
if (ret)
goto out;
reiserfs_write_unlock(dquot->dq_sb);
ret = dquot_acquire(dquot);
reiserfs_write_lock(dquot->dq_sb);
err =
journal_end(&th, dquot->dq_sb,
REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb));
if (!ret && err)
ret = err;
out:
out:
reiserfs_write_unlock(dquot->dq_sb);
return ret;
}
Expand All @@ -2156,21 +2137,19 @@ static int reiserfs_release_dquot(struct dquot *dquot)
ret =
journal_begin(&th, dquot->dq_sb,
REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb));
reiserfs_write_unlock(dquot->dq_sb);
if (ret) {
/* Release dquot anyway to avoid endless cycle in dqput() */
dquot_release(dquot);
goto out;
}
ret = dquot_release(dquot);
reiserfs_write_lock(dquot->dq_sb);
err =
journal_end(&th, dquot->dq_sb,
REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb));
if (!ret && err)
ret = err;
out:
reiserfs_write_unlock(dquot->dq_sb);
out:
return ret;
}

Expand All @@ -2195,13 +2174,11 @@ static int reiserfs_write_info(struct super_block *sb, int type)
ret = journal_begin(&th, sb, 2);
if (ret)
goto out;
reiserfs_write_unlock(sb);
ret = dquot_commit_info(sb, type);
reiserfs_write_lock(sb);
err = journal_end(&th, sb, 2);
if (!ret && err)
ret = err;
out:
out:
reiserfs_write_unlock(sb);
return ret;
}
Expand All @@ -2226,11 +2203,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
struct reiserfs_transaction_handle th;
int opt = type == USRQUOTA ? REISERFS_USRQUOTA : REISERFS_GRPQUOTA;

reiserfs_write_lock(sb);
if (!(REISERFS_SB(sb)->s_mount_opt & (1 << opt))) {
err = -EINVAL;
goto out;
}
if (!(REISERFS_SB(sb)->s_mount_opt & (1 << opt)))
return -EINVAL;

/* Quotafile not on the same filesystem? */
if (path->dentry->d_sb != sb) {
Expand Down Expand Up @@ -2272,10 +2246,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
if (err)
goto out;
}
reiserfs_write_unlock(sb);
return dquot_quota_on(sb, type, format_id, path);
err = dquot_quota_on(sb, type, format_id, path);
out:
reiserfs_write_unlock(sb);
return err;
}

Expand Down Expand Up @@ -2348,9 +2320,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
tocopy = sb->s_blocksize - offset < towrite ?
sb->s_blocksize - offset : towrite;
tmp_bh.b_state = 0;
reiserfs_write_lock(sb);
err = reiserfs_get_block(inode, blk, &tmp_bh, GET_BLOCK_CREATE);
reiserfs_write_unlock(sb);
if (err)
goto out;
if (offset || tocopy != sb->s_blocksize)
Expand All @@ -2366,12 +2336,10 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
flush_dcache_page(bh->b_page);
set_buffer_uptodate(bh);
unlock_buffer(bh);
reiserfs_write_lock(sb);
reiserfs_prepare_for_journal(sb, bh, 1);
journal_mark_dirty(current->journal_info, sb, bh);
if (!journal_quota)
reiserfs_add_ordered_list(inode, bh);
reiserfs_write_unlock(sb);
brelse(bh);
offset = 0;
towrite -= tocopy;
Expand Down

0 comments on commit d2412ac

Please sign in to comment.