Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277006
b: refs/heads/master
c: e30e2fd
h: refs/heads/master
v: v3
  • Loading branch information
Srivatsa S. Bhat authored and Al Viro committed Dec 22, 2011
1 parent 870b60d commit 4a44058
Show file tree
Hide file tree
Showing 29 changed files with 97 additions and 81 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: 6d451c578c7222c7e9305c2e776a654dc6ec06c3
refs/heads/master: e30e2fdfe56288576ee9e04dbb06b4bd5f282203
4 changes: 2 additions & 2 deletions trunk/arch/sparc/kernel/pci_sun4v.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,10 +849,10 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm,
if (!irq)
return -ENOMEM;

if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID))
return -EINVAL;
if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE))
return -EINVAL;
if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID))
return -EINVAL;

return irq;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ata/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ config PATA_PLATFORM

config PATA_OF_PLATFORM
tristate "OpenFirmware platform device PATA support"
depends on PATA_PLATFORM && OF && OF_IRQ
depends on PATA_PLATFORM && OF
help
This option enables support for generic directly connected ATA
devices commonly found on embedded systems with OpenFirmware
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,9 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
atomic_read(&bitmap->behind_writes),
bitmap->mddev->bitmap_info.max_write_behind);
}
if (bitmap->mddev->degraded)
/* Never clear bits or update events_cleared when degraded */
success = 0;

while (sectors) {
sector_t blocks;
Expand All @@ -1406,7 +1409,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
return;
}

if (success && !bitmap->mddev->degraded &&
if (success &&
bitmap->events_cleared < bitmap->mddev->events) {
bitmap->events_cleared = bitmap->mddev->events;
bitmap->need_sync = 1;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
return -EINVAL;

rdev->raid_disk = rdev->saved_raid_disk;
rdev->saved_raid_disk = -1;

newconf = linear_conf(mddev,mddev->raid_disks+1);

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -7360,7 +7360,8 @@ static int remove_and_add_spares(struct mddev *mddev)
spares++;
md_new_event(mddev);
set_bit(MD_CHANGE_DEVS, &mddev->flags);
}
} else
break;
}
}
}
Expand Down
14 changes: 4 additions & 10 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -3065,17 +3065,11 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
}
} else if (test_bit(In_sync, &rdev->flags))
set_bit(R5_Insync, &dev->flags);
else if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
else {
/* in sync if before recovery_offset */
set_bit(R5_Insync, &dev->flags);
else if (test_bit(R5_UPTODATE, &dev->flags) &&
test_bit(R5_Expanded, &dev->flags))
/* If we've reshaped into here, we assume it is Insync.
* We will shortly update recovery_offset to make
* it official.
*/
set_bit(R5_Insync, &dev->flags);

if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
set_bit(R5_Insync, &dev->flags);
}
if (rdev && test_bit(R5_WriteError, &dev->flags)) {
clear_bit(R5_Insync, &dev->flags);
if (!test_bit(Faulty, &rdev->flags)) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/omap3isp/ispccdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)
{
struct isp_pipeline *pipe =
to_isp_pipeline(&ccdc->video_out.video.entity);
struct video_device *vdev = ccdc->subdev.devnode;
struct video_device *vdev = &ccdc->subdev.devnode;
struct v4l2_event event;

memset(&event, 0, sizeof(event));
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/omap3isp/ispstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ static int isp_stat_bufs_alloc(struct ispstat *stat, u32 size)

static void isp_stat_queue_event(struct ispstat *stat, int err)
{
struct video_device *vdev = stat->subdev.devnode;
struct video_device *vdev = &stat->subdev.devnode;
struct v4l2_event event;
struct omap3isp_stat_event_status *status = (void *)event.u.data;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static int __devinit dwc3_core_init(struct dwc3 *dwc)
ret = -ENODEV;
goto err0;
}
dwc->revision = reg;
dwc->revision = reg & DWC3_GSNPSREV_MASK;

dwc3_core_soft_reset(dwc);

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/usb/gadget/epautoconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ ep_matches (
num_req_streams = ep_comp->bmAttributes & 0x1f;
if (num_req_streams > ep->max_streams)
return 0;
/* Update the ep_comp descriptor if needed */
if (num_req_streams != ep->max_streams)
ep_comp->bmAttributes = ep->max_streams;
}

}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/usb/host/isp1760-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "isp1760-hcd.h"

#if defined(CONFIG_OF) && defined(CONFIG_OF_IRQ)
#ifdef CONFIG_OF
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_platform.h>
Expand All @@ -31,7 +31,7 @@
#include <linux/pci.h>
#endif

#if defined(CONFIG_OF) && defined(CONFIG_OF_IRQ)
#ifdef CONFIG_OF
struct isp1760 {
struct usb_hcd *hcd;
int rst_gpio;
Expand Down Expand Up @@ -437,7 +437,7 @@ static int __init isp1760_init(void)
ret = platform_driver_register(&isp1760_plat_driver);
if (!ret)
any_ret = 0;
#if defined(CONFIG_OF) && defined(CONFIG_OF_IRQ)
#ifdef CONFIG_OF
ret = platform_driver_register(&isp1760_of_driver);
if (!ret)
any_ret = 0;
Expand All @@ -457,7 +457,7 @@ module_init(isp1760_init);
static void __exit isp1760_exit(void)
{
platform_driver_unregister(&isp1760_plat_driver);
#if defined(CONFIG_OF) && defined(CONFIG_OF_IRQ)
#ifdef CONFIG_OF
platform_driver_unregister(&isp1760_of_driver);
#endif
#ifdef CONFIG_PCI
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/usb/musb/musb_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,6 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
if (musb->double_buffer_not_ok)
musb_writew(epio, MUSB_TXMAXP,
hw_ep->max_packet_sz_tx);
else if (can_bulk_split(musb, qh->type))
musb_writew(epio, MUSB_TXMAXP, packet_sz
| ((hw_ep->max_packet_sz_tx /
packet_sz) - 1) << 11);
else
musb_writew(epio, MUSB_TXMAXP,
qh->maxpacket |
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/btrfs/async-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ static struct btrfs_worker_thread *find_worker(struct btrfs_workers *workers)
struct list_head *fallback;
int ret;

spin_lock_irqsave(&workers->lock, flags);
again:
spin_lock_irqsave(&workers->lock, flags);
worker = next_worker(workers);

if (!worker) {
Expand All @@ -579,7 +579,6 @@ static struct btrfs_worker_thread *find_worker(struct btrfs_workers *workers)
spin_unlock_irqrestore(&workers->lock, flags);
/* we're below the limit, start another worker */
ret = __btrfs_start_workers(workers);
spin_lock_irqsave(&workers->lock, flags);
if (ret)
goto fallback;
goto again;
Expand Down
9 changes: 4 additions & 5 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4590,6 +4590,10 @@ static int btrfs_add_nondir(struct btrfs_trans_handle *trans,
int err = btrfs_add_link(trans, dir, inode,
dentry->d_name.name, dentry->d_name.len,
backref, index);
if (!err) {
d_instantiate(dentry, inode);
return 0;
}
if (err > 0)
err = -EEXIST;
return err;
Expand Down Expand Up @@ -4651,7 +4655,6 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
else {
init_special_inode(inode, inode->i_mode, rdev);
btrfs_update_inode(trans, root, inode);
d_instantiate(dentry, inode);
}
out_unlock:
nr = trans->blocks_used;
Expand Down Expand Up @@ -4719,7 +4722,6 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
inode->i_mapping->a_ops = &btrfs_aops;
inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops;
d_instantiate(dentry, inode);
}
out_unlock:
nr = trans->blocks_used;
Expand Down Expand Up @@ -4777,7 +4779,6 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
struct dentry *parent = dentry->d_parent;
err = btrfs_update_inode(trans, root, inode);
BUG_ON(err);
d_instantiate(dentry, inode);
btrfs_log_new_name(trans, inode, NULL, parent);
}

Expand Down Expand Up @@ -7244,8 +7245,6 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
drop_inode = 1;

out_unlock:
if (!err)
d_instantiate(dentry, inode);
nr = trans->blocks_used;
btrfs_end_transaction_throttle(trans, root);
if (drop_inode) {
Expand Down
11 changes: 11 additions & 0 deletions trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ struct wb_writeback_work {
struct completion *done; /* set if the caller waits */
};

const char *wb_reason_name[] = {
[WB_REASON_BACKGROUND] = "background",
[WB_REASON_TRY_TO_FREE_PAGES] = "try_to_free_pages",
[WB_REASON_SYNC] = "sync",
[WB_REASON_PERIODIC] = "periodic",
[WB_REASON_LAPTOP_TIMER] = "laptop_timer",
[WB_REASON_FREE_MORE_MEM] = "free_more_memory",
[WB_REASON_FS_FREE_SPACE] = "fs_free_space",
[WB_REASON_FORKER_THREAD] = "forker_thread"
};

/*
* Include the creation of the trace points after defining the
* wb_writeback_work structure so that the definition remains local to this
Expand Down
36 changes: 32 additions & 4 deletions trunk/include/linux/lglock.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/spinlock.h>
#include <linux/lockdep.h>
#include <linux/percpu.h>
#include <linux/cpu.h>

/* can make br locks by using local lock for read side, global lock for write */
#define br_lock_init(name) name##_lock_init()
Expand Down Expand Up @@ -72,9 +73,31 @@

#define DEFINE_LGLOCK(name) \
\
DEFINE_SPINLOCK(name##_cpu_lock); \
cpumask_t name##_cpus __read_mostly; \
DEFINE_PER_CPU(arch_spinlock_t, name##_lock); \
DEFINE_LGLOCK_LOCKDEP(name); \
\
static int \
name##_lg_cpu_callback(struct notifier_block *nb, \
unsigned long action, void *hcpu) \
{ \
switch (action & ~CPU_TASKS_FROZEN) { \
case CPU_UP_PREPARE: \
spin_lock(&name##_cpu_lock); \
cpu_set((unsigned long)hcpu, name##_cpus); \
spin_unlock(&name##_cpu_lock); \
break; \
case CPU_UP_CANCELED: case CPU_DEAD: \
spin_lock(&name##_cpu_lock); \
cpu_clear((unsigned long)hcpu, name##_cpus); \
spin_unlock(&name##_cpu_lock); \
} \
return NOTIFY_OK; \
} \
static struct notifier_block name##_lg_cpu_notifier = { \
.notifier_call = name##_lg_cpu_callback, \
}; \
void name##_lock_init(void) { \
int i; \
LOCKDEP_INIT_MAP(&name##_lock_dep_map, #name, &name##_lock_key, 0); \
Expand All @@ -83,6 +106,11 @@
lock = &per_cpu(name##_lock, i); \
*lock = (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; \
} \
register_hotcpu_notifier(&name##_lg_cpu_notifier); \
get_online_cpus(); \
for_each_online_cpu(i) \
cpu_set(i, name##_cpus); \
put_online_cpus(); \
} \
EXPORT_SYMBOL(name##_lock_init); \
\
Expand Down Expand Up @@ -124,9 +152,9 @@
\
void name##_global_lock_online(void) { \
int i; \
preempt_disable(); \
spin_lock(&name##_cpu_lock); \
rwlock_acquire(&name##_lock_dep_map, 0, 0, _RET_IP_); \
for_each_online_cpu(i) { \
for_each_cpu(i, &name##_cpus) { \
arch_spinlock_t *lock; \
lock = &per_cpu(name##_lock, i); \
arch_spin_lock(lock); \
Expand All @@ -137,12 +165,12 @@
void name##_global_unlock_online(void) { \
int i; \
rwlock_release(&name##_lock_dep_map, 1, _RET_IP_); \
for_each_online_cpu(i) { \
for_each_cpu(i, &name##_cpus) { \
arch_spinlock_t *lock; \
lock = &per_cpu(name##_lock, i); \
arch_spin_unlock(lock); \
} \
preempt_enable(); \
spin_unlock(&name##_cpu_lock); \
} \
EXPORT_SYMBOL(name##_global_unlock_online); \
\
Expand Down
1 change: 0 additions & 1 deletion trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct dst_entry {
#define DST_NOHASH 0x0008
#define DST_NOCACHE 0x0010
#define DST_NOCOUNT 0x0020
#define DST_NOPEER 0x0040

short error;
short obsolete;
Expand Down
4 changes: 1 addition & 3 deletions trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -637,14 +637,12 @@ static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)

/*
* Take into account size of receive queue and backlog queue
* Do not take into account this skb truesize,
* to allow even a single big packet to come.
*/
static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff *skb)
{
unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc);

return qsize > sk->sk_rcvbuf;
return qsize + skb->truesize > sk->sk_rcvbuf;
}

/* The per-socket spinlock must be held here. */
Expand Down
15 changes: 2 additions & 13 deletions trunk/include/trace/events/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@
{I_REFERENCED, "I_REFERENCED"} \
)

#define WB_WORK_REASON \
{WB_REASON_BACKGROUND, "background"}, \
{WB_REASON_TRY_TO_FREE_PAGES, "try_to_free_pages"}, \
{WB_REASON_SYNC, "sync"}, \
{WB_REASON_PERIODIC, "periodic"}, \
{WB_REASON_LAPTOP_TIMER, "laptop_timer"}, \
{WB_REASON_FREE_MORE_MEM, "free_more_memory"}, \
{WB_REASON_FS_FREE_SPACE, "fs_free_space"}, \
{WB_REASON_FORKER_THREAD, "forker_thread"}

struct wb_writeback_work;

DECLARE_EVENT_CLASS(writeback_work_class,
Expand Down Expand Up @@ -65,7 +55,7 @@ DECLARE_EVENT_CLASS(writeback_work_class,
__entry->for_kupdate,
__entry->range_cyclic,
__entry->for_background,
__print_symbolic(__entry->reason, WB_WORK_REASON)
wb_reason_name[__entry->reason]
)
);
#define DEFINE_WRITEBACK_WORK_EVENT(name) \
Expand Down Expand Up @@ -194,8 +184,7 @@ TRACE_EVENT(writeback_queue_io,
__entry->older, /* older_than_this in jiffies */
__entry->age, /* older_than_this in relative milliseconds */
__entry->moved,
__print_symbolic(__entry->reason, WB_WORK_REASON)
)
wb_reason_name[__entry->reason])
);

TRACE_EVENT(global_dirty_state,
Expand Down
Loading

0 comments on commit 4a44058

Please sign in to comment.