diff --git a/[refs] b/[refs] index 1f6a34a4ea7d..cc053a7c40d8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 93b49d45eb97574057ee03dfdd590c209f5132f8 +refs/heads/master: d86c1302c58e4d4ebd99d459c2daff13613ac7f4 diff --git a/trunk/arch/arm/mach-ixp4xx/ixp4xx_npe.c b/trunk/arch/arm/mach-ixp4xx/ixp4xx_npe.c index 7bb8e778e4b6..252310234903 100644 --- a/trunk/arch/arm/mach-ixp4xx/ixp4xx_npe.c +++ b/trunk/arch/arm/mach-ixp4xx/ixp4xx_npe.c @@ -714,7 +714,7 @@ static int __init npe_init_module(void) } if (!found) - return -ENODEV; + return -ENOSYS; return 0; } diff --git a/trunk/drivers/base/platform.c b/trunk/drivers/base/platform.c index b5b6c973a2e0..ec5400c32021 100644 --- a/trunk/drivers/base/platform.c +++ b/trunk/drivers/base/platform.c @@ -1028,7 +1028,7 @@ static __initdata LIST_HEAD(early_platform_device_list); /** * early_platform_driver_register - * @edrv: early_platform driver structure + * @epdrv: early_platform driver structure * @buf: string passed from early_param() */ int __init early_platform_driver_register(struct early_platform_driver *epdrv, @@ -1112,7 +1112,7 @@ void __init early_platform_driver_register_all(char *class_str) /** * early_platform_match - * @edrv: early platform driver structure + * @epdrv: early platform driver structure * @id: id to match against */ static __init struct platform_device * @@ -1130,7 +1130,7 @@ early_platform_match(struct early_platform_driver *epdrv, int id) /** * early_platform_left - * @edrv: early platform driver structure + * @epdrv: early platform driver structure * @id: return true if id or above exists */ static __init int early_platform_left(struct early_platform_driver *epdrv, diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_fs.c b/trunk/drivers/infiniband/hw/ipath/ipath_fs.c index b3684060465e..8dc2bb781605 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_fs.c @@ -347,7 +347,7 @@ static int ipathfs_fill_super(struct super_block *sb, void *data, spin_unlock_irqrestore(&ipath_devs_lock, flags); ret = create_device_files(sb, dd); if (ret) { - deactivate_locked_super(sb); + deactivate_super(sb); goto bail; } spin_lock_irqsave(&ipath_devs_lock, flags); diff --git a/trunk/drivers/isdn/capi/capifs.c b/trunk/drivers/isdn/capi/capifs.c index bff72d81f263..b129409925af 100644 --- a/trunk/drivers/isdn/capi/capifs.c +++ b/trunk/drivers/isdn/capi/capifs.c @@ -75,17 +75,15 @@ static int capifs_remount(struct super_block *s, int *flags, char *data) } } - mutex_lock(&s->s_root->d_inode->i_mutex); + kfree(s->s_options); + s->s_options = new_opt; - replace_mount_options(s, new_opt); config.setuid = setuid; config.setgid = setgid; config.uid = uid; config.gid = gid; config.mode = mode; - mutex_unlock(&s->s_root->d_inode->i_mutex); - return 0; } @@ -156,16 +154,13 @@ void capifs_new_ncci(unsigned int number, dev_t device) if (!inode) return; inode->i_ino = number+2; - - dentry = get_node(number); - - /* config contents is protected by root's i_mutex */ inode->i_uid = config.setuid ? config.uid : current_fsuid(); inode->i_gid = config.setgid ? config.gid : current_fsgid(); inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; init_special_inode(inode, S_IFCHR|config.mode, device); //inode->i_op = &capifs_file_inode_operations; + dentry = get_node(number); if (!IS_ERR(dentry) && !dentry->d_inode) d_instantiate(dentry, inode); mutex_unlock(&capifs_root->d_inode->i_mutex); diff --git a/trunk/drivers/media/radio/radio-sf16fmi.c b/trunk/drivers/media/radio/radio-sf16fmi.c index 5cf6c45b91fe..1dba8f0832a0 100644 --- a/trunk/drivers/media/radio/radio-sf16fmi.c +++ b/trunk/drivers/media/radio/radio-sf16fmi.c @@ -153,7 +153,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, mult = (fmi->flags & V4L2_TUNER_CAP_LOW) ? 1 : 1000; v->rangelow = RSF16_MINFREQ / mult; v->rangehigh = RSF16_MAXFREQ / mult; - v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; + v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_MODE_STEREO; v->capability = fmi->flags & V4L2_TUNER_CAP_LOW; v->audmode = V4L2_TUNER_MODE_STEREO; v->signal = fmi_getsigstr(fmi); diff --git a/trunk/drivers/media/radio/radio-sf16fmr2.c b/trunk/drivers/media/radio/radio-sf16fmr2.c index 935ff9bcdfcc..c09ca8600ea1 100644 --- a/trunk/drivers/media/radio/radio-sf16fmr2.c +++ b/trunk/drivers/media/radio/radio-sf16fmr2.c @@ -233,7 +233,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, mult = (fmr2->flags & V4L2_TUNER_CAP_LOW) ? 1 : 1000; v->rangelow = RSF16_MINFREQ / mult; v->rangehigh = RSF16_MAXFREQ / mult; - v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; + v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_MODE_STEREO; v->capability = fmr2->flags&V4L2_TUNER_CAP_LOW; v->audmode = fmr2->stereo ? V4L2_TUNER_MODE_STEREO: V4L2_TUNER_MODE_MONO; diff --git a/trunk/drivers/media/video/cafe_ccic.c b/trunk/drivers/media/video/cafe_ccic.c index c4d181dde1ca..5f582726985d 100644 --- a/trunk/drivers/media/video/cafe_ccic.c +++ b/trunk/drivers/media/video/cafe_ccic.c @@ -774,7 +774,6 @@ static int cafe_cam_init(struct cafe_camera *cam) ret = __cafe_cam_reset(cam); if (ret) goto out; - chip.ident = V4L2_IDENT_NONE; chip.match.type = V4L2_CHIP_MATCH_I2C_ADDR; chip.match.addr = cam->sensor_addr; ret = sensor_call(cam, core, g_chip_ident, &chip); diff --git a/trunk/drivers/media/video/cx23885/cx23885-dvb.c b/trunk/drivers/media/video/cx23885/cx23885-dvb.c index 1dc070da8652..0c49a98213c4 100644 --- a/trunk/drivers/media/video/cx23885/cx23885-dvb.c +++ b/trunk/drivers/media/video/cx23885/cx23885-dvb.c @@ -472,7 +472,7 @@ static int dvb_register(struct cx23885_tsport *port) static struct xc2028_ctrl ctl = { .fname = XC2028_DEFAULT_FIRMWARE, .max_len = 64, - .demod = XC3028_FE_OREN538, + .scode_table = XC3028_FE_OREN538, }; fe = dvb_attach(xc2028_attach, diff --git a/trunk/drivers/media/video/ivtv/ivtv-driver.c b/trunk/drivers/media/video/ivtv/ivtv-driver.c index db2ac9a99acd..b0195e8ee4d1 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-driver.c +++ b/trunk/drivers/media/video/ivtv/ivtv-driver.c @@ -305,17 +305,14 @@ int ivtv_waitq(wait_queue_head_t *waitq) /* Generic utility functions */ int ivtv_msleep_timeout(unsigned int msecs, int intr) { + int ret; int timeout = msecs_to_jiffies(msecs); do { set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); timeout = schedule_timeout(timeout); - if (intr) { - int ret = signal_pending(current); - - if (ret) - return ret; - } + if (intr && (ret = signal_pending(current))) + return ret; } while (timeout); return 0; } diff --git a/trunk/drivers/media/video/ivtv/ivtv-gpio.c b/trunk/drivers/media/video/ivtv/ivtv-gpio.c index 85ac707228e7..ceb05bdcaf62 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-gpio.c +++ b/trunk/drivers/media/video/ivtv/ivtv-gpio.c @@ -190,8 +190,8 @@ static int subdev_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) mask = itv->card->gpio_audio_detect.mask; if (mask == 0 || (read_reg(IVTV_REG_GPIO_IN) & mask)) - vt->rxsubchans = V4L2_TUNER_SUB_STEREO | - V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; + vt->rxsubchans = V4L2_TUNER_MODE_STEREO | + V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; else vt->rxsubchans = V4L2_TUNER_SUB_MONO; return 0; diff --git a/trunk/drivers/media/video/ivtv/ivtv-ioctl.c b/trunk/drivers/media/video/ivtv/ivtv-ioctl.c index c342a9fe983e..4a2d464f055e 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/trunk/drivers/media/video/ivtv/ivtv-ioctl.c @@ -180,7 +180,7 @@ int ivtv_set_speed(struct ivtv *itv, int speed) /* Wait for any DMA to finish */ prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); - while (test_bit(IVTV_F_I_DMA, &itv->i_flags)) { + while (itv->i_flags & IVTV_F_I_DMA) { got_sig = signal_pending(current); if (got_sig) break; @@ -1710,8 +1710,7 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg) we are waiting unlock first and later lock again. */ mutex_unlock(&itv->serialize_lock); prepare_to_wait(&itv->event_waitq, &wait, TASK_INTERRUPTIBLE); - if (!test_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags) && - !test_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags)) + if ((itv->i_flags & (IVTV_F_I_EV_DEC_STOPPED|IVTV_F_I_EV_VSYNC)) == 0) schedule(); finish_wait(&itv->event_waitq, &wait); mutex_lock(&itv->serialize_lock); diff --git a/trunk/drivers/media/video/ivtv/ivtv-irq.c b/trunk/drivers/media/video/ivtv/ivtv-irq.c index cd9db0bf33bf..01c14d2b381a 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-irq.c +++ b/trunk/drivers/media/video/ivtv/ivtv-irq.c @@ -196,7 +196,7 @@ static int stream_enc_dma_append(struct ivtv_stream *s, u32 data[CX2341X_MBOX_MA bytes_needed, s->name); return -1; } - if (rc && !s->buffers_stolen && test_bit(IVTV_F_S_APPL_IO, &s->s_flags)) { + if (rc && !s->buffers_stolen && (s->s_flags & IVTV_F_S_APPL_IO)) { IVTV_WARN("All %s stream buffers are full. Dropping data.\n", s->name); IVTV_WARN("Cause: the application is not reading fast enough.\n"); } diff --git a/trunk/drivers/media/video/ivtv/ivtv-yuv.c b/trunk/drivers/media/video/ivtv/ivtv-yuv.c index c0875378acc2..7912ed6b72ee 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-yuv.c +++ b/trunk/drivers/media/video/ivtv/ivtv-yuv.c @@ -1063,8 +1063,7 @@ static int ivtv_yuv_udma_frame(struct ivtv *itv, struct ivtv_dma_frame *args) prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); /* if no UDMA is pending and no UDMA is in progress, then the DMA is finished */ - while (test_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags) || - test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { + while (itv->i_flags & (IVTV_F_I_UDMA_PENDING | IVTV_F_I_UDMA)) { /* don't interrupt if the DMA is in progress but break off a still pending DMA. */ got_sig = signal_pending(current); diff --git a/trunk/drivers/media/video/ivtv/ivtvfb.c b/trunk/drivers/media/video/ivtv/ivtvfb.c index fa6bb85cb4b0..66e6eb513076 100644 --- a/trunk/drivers/media/video/ivtv/ivtvfb.c +++ b/trunk/drivers/media/video/ivtv/ivtvfb.c @@ -298,8 +298,7 @@ static int ivtvfb_prep_dec_dma_to_device(struct ivtv *itv, prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); /* if no UDMA is pending and no UDMA is in progress, then the DMA is finished */ - while (test_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags) || - test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { + while (itv->i_flags & (IVTV_F_I_UDMA_PENDING | IVTV_F_I_UDMA)) { /* don't interrupt if the DMA is in progress but break off a still pending DMA. */ got_sig = signal_pending(current); diff --git a/trunk/drivers/media/video/uvc/uvc_driver.c b/trunk/drivers/media/video/uvc/uvc_driver.c index 507dc85646b2..399412d7f020 100644 --- a/trunk/drivers/media/video/uvc/uvc_driver.c +++ b/trunk/drivers/media/video/uvc/uvc_driver.c @@ -1726,17 +1726,14 @@ static int uvc_suspend(struct usb_interface *intf, pm_message_t message) static int __uvc_resume(struct usb_interface *intf, int reset) { struct uvc_device *dev = usb_get_intfdata(intf); + int ret; uvc_trace(UVC_TRACE_SUSPEND, "Resuming interface %u\n", intf->cur_altsetting->desc.bInterfaceNumber); if (intf->cur_altsetting->desc.bInterfaceSubClass == SC_VIDEOCONTROL) { - if (reset) { - int ret = uvc_ctrl_resume_device(dev); - - if (ret < 0) - return ret; - } + if (reset && (ret = uvc_ctrl_resume_device(dev)) < 0) + return ret; return uvc_status_resume(dev); } diff --git a/trunk/drivers/media/video/uvc/uvc_video.c b/trunk/drivers/media/video/uvc/uvc_video.c index 6ce974d7362f..a95e17329c5b 100644 --- a/trunk/drivers/media/video/uvc/uvc_video.c +++ b/trunk/drivers/media/video/uvc/uvc_video.c @@ -742,7 +742,7 @@ static int uvc_alloc_urb_buffers(struct uvc_video_device *video, /* Buffers are already allocated, bail out. */ if (video->urb_size) - return video->urb_size / psize; + return 0; /* Compute the number of packets. Bulk endpoints might transfer UVC * payloads accross multiple URBs. diff --git a/trunk/drivers/media/video/v4l2-ioctl.c b/trunk/drivers/media/video/v4l2-ioctl.c index be64a502ea27..88f10d6cbc92 100644 --- a/trunk/drivers/media/video/v4l2-ioctl.c +++ b/trunk/drivers/media/video/v4l2-ioctl.c @@ -42,12 +42,6 @@ printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\ } while (0) -/* Zero out the end of the struct pointed to by p. Everthing after, but - * not including, the specified field is cleared. */ -#define CLEAR_AFTER_FIELD(p, field) \ - memset((u8 *)(p) + offsetof(typeof(*(p)), field) + sizeof((p)->field), \ - 0, sizeof(*(p)) - offsetof(typeof(*(p)), field) - sizeof((p)->field)) - struct std_descr { v4l2_std_id std; const char *descr; @@ -550,39 +544,39 @@ static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type) switch (type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: - if (ops->vidioc_g_fmt_vid_cap) + if (ops->vidioc_try_fmt_vid_cap) return 0; break; case V4L2_BUF_TYPE_VIDEO_OVERLAY: - if (ops->vidioc_g_fmt_vid_overlay) + if (ops->vidioc_try_fmt_vid_overlay) return 0; break; case V4L2_BUF_TYPE_VIDEO_OUTPUT: - if (ops->vidioc_g_fmt_vid_out) + if (ops->vidioc_try_fmt_vid_out) return 0; break; case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: - if (ops->vidioc_g_fmt_vid_out_overlay) + if (ops->vidioc_try_fmt_vid_out_overlay) return 0; break; case V4L2_BUF_TYPE_VBI_CAPTURE: - if (ops->vidioc_g_fmt_vbi_cap) + if (ops->vidioc_try_fmt_vbi_cap) return 0; break; case V4L2_BUF_TYPE_VBI_OUTPUT: - if (ops->vidioc_g_fmt_vbi_out) + if (ops->vidioc_try_fmt_vbi_out) return 0; break; case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - if (ops->vidioc_g_fmt_sliced_vbi_cap) + if (ops->vidioc_try_fmt_sliced_vbi_cap) return 0; break; case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: - if (ops->vidioc_g_fmt_sliced_vbi_out) + if (ops->vidioc_try_fmt_sliced_vbi_out) return 0; break; case V4L2_BUF_TYPE_PRIVATE: - if (ops->vidioc_g_fmt_type_private) + if (ops->vidioc_try_fmt_type_private) return 0; break; } @@ -788,53 +782,44 @@ static long __video_do_ioctl(struct file *file, switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: - CLEAR_AFTER_FIELD(f, fmt.pix); v4l_print_pix_fmt(vfd, &f->fmt.pix); if (ops->vidioc_s_fmt_vid_cap) ret = ops->vidioc_s_fmt_vid_cap(file, fh, f); break; case V4L2_BUF_TYPE_VIDEO_OVERLAY: - CLEAR_AFTER_FIELD(f, fmt.win); if (ops->vidioc_s_fmt_vid_overlay) ret = ops->vidioc_s_fmt_vid_overlay(file, fh, f); break; case V4L2_BUF_TYPE_VIDEO_OUTPUT: - CLEAR_AFTER_FIELD(f, fmt.pix); v4l_print_pix_fmt(vfd, &f->fmt.pix); if (ops->vidioc_s_fmt_vid_out) ret = ops->vidioc_s_fmt_vid_out(file, fh, f); break; case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: - CLEAR_AFTER_FIELD(f, fmt.win); if (ops->vidioc_s_fmt_vid_out_overlay) ret = ops->vidioc_s_fmt_vid_out_overlay(file, fh, f); break; case V4L2_BUF_TYPE_VBI_CAPTURE: - CLEAR_AFTER_FIELD(f, fmt.vbi); if (ops->vidioc_s_fmt_vbi_cap) ret = ops->vidioc_s_fmt_vbi_cap(file, fh, f); break; case V4L2_BUF_TYPE_VBI_OUTPUT: - CLEAR_AFTER_FIELD(f, fmt.vbi); if (ops->vidioc_s_fmt_vbi_out) ret = ops->vidioc_s_fmt_vbi_out(file, fh, f); break; case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - CLEAR_AFTER_FIELD(f, fmt.sliced); if (ops->vidioc_s_fmt_sliced_vbi_cap) ret = ops->vidioc_s_fmt_sliced_vbi_cap(file, fh, f); break; case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: - CLEAR_AFTER_FIELD(f, fmt.sliced); if (ops->vidioc_s_fmt_sliced_vbi_out) ret = ops->vidioc_s_fmt_sliced_vbi_out(file, fh, f); break; case V4L2_BUF_TYPE_PRIVATE: - /* CLEAR_AFTER_FIELD(f, fmt.raw_data); <- does nothing */ if (ops->vidioc_s_fmt_type_private) ret = ops->vidioc_s_fmt_type_private(file, fh, f); @@ -851,55 +836,46 @@ static long __video_do_ioctl(struct file *file, v4l2_type_names)); switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: - CLEAR_AFTER_FIELD(f, fmt.pix); if (ops->vidioc_try_fmt_vid_cap) ret = ops->vidioc_try_fmt_vid_cap(file, fh, f); if (!ret) v4l_print_pix_fmt(vfd, &f->fmt.pix); break; case V4L2_BUF_TYPE_VIDEO_OVERLAY: - CLEAR_AFTER_FIELD(f, fmt.win); if (ops->vidioc_try_fmt_vid_overlay) ret = ops->vidioc_try_fmt_vid_overlay(file, fh, f); break; case V4L2_BUF_TYPE_VIDEO_OUTPUT: - CLEAR_AFTER_FIELD(f, fmt.pix); if (ops->vidioc_try_fmt_vid_out) ret = ops->vidioc_try_fmt_vid_out(file, fh, f); if (!ret) v4l_print_pix_fmt(vfd, &f->fmt.pix); break; case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: - CLEAR_AFTER_FIELD(f, fmt.win); if (ops->vidioc_try_fmt_vid_out_overlay) ret = ops->vidioc_try_fmt_vid_out_overlay(file, fh, f); break; case V4L2_BUF_TYPE_VBI_CAPTURE: - CLEAR_AFTER_FIELD(f, fmt.vbi); if (ops->vidioc_try_fmt_vbi_cap) ret = ops->vidioc_try_fmt_vbi_cap(file, fh, f); break; case V4L2_BUF_TYPE_VBI_OUTPUT: - CLEAR_AFTER_FIELD(f, fmt.vbi); if (ops->vidioc_try_fmt_vbi_out) ret = ops->vidioc_try_fmt_vbi_out(file, fh, f); break; case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - CLEAR_AFTER_FIELD(f, fmt.sliced); if (ops->vidioc_try_fmt_sliced_vbi_cap) ret = ops->vidioc_try_fmt_sliced_vbi_cap(file, fh, f); break; case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: - CLEAR_AFTER_FIELD(f, fmt.sliced); if (ops->vidioc_try_fmt_sliced_vbi_out) ret = ops->vidioc_try_fmt_sliced_vbi_out(file, fh, f); break; case V4L2_BUF_TYPE_PRIVATE: - /* CLEAR_AFTER_FIELD(f, fmt.raw_data); <- does nothing */ if (ops->vidioc_try_fmt_type_private) ret = ops->vidioc_try_fmt_type_private(file, fh, f); @@ -922,9 +898,6 @@ static long __video_do_ioctl(struct file *file, if (ret) break; - if (p->type < V4L2_BUF_TYPE_PRIVATE) - CLEAR_AFTER_FIELD(p, memory); - ret = ops->vidioc_reqbufs(file, fh, p); dbgarg(cmd, "count=%d, type=%s, memory=%s\n", p->count, diff --git a/trunk/drivers/media/video/zoran/zoran_driver.c b/trunk/drivers/media/video/zoran/zoran_driver.c index 643cccaa1aab..092333b1c34f 100644 --- a/trunk/drivers/media/video/zoran/zoran_driver.c +++ b/trunk/drivers/media/video/zoran/zoran_driver.c @@ -1863,20 +1863,22 @@ static int zoran_querycap(struct file *file, void *__fh, struct v4l2_capability static int zoran_enum_fmt(struct zoran *zr, struct v4l2_fmtdesc *fmt, int flag) { - unsigned int num, i; - - for (num = i = 0; i < NUM_FORMATS; i++) { - if (zoran_formats[i].flags & flag && num++ == fmt->index) { - strncpy(fmt->description, zoran_formats[i].name, - sizeof(fmt->description) - 1); - /* fmt struct pre-zeroed, so adding '\0' not neeed */ - fmt->pixelformat = zoran_formats[i].fourcc; - if (zoran_formats[i].flags & ZORAN_FORMAT_COMPRESSED) - fmt->flags |= V4L2_FMT_FLAG_COMPRESSED; - return 0; - } + int num = -1, i; + + for (i = 0; i < NUM_FORMATS; i++) { + if (zoran_formats[i].flags & flag) + num++; + if (num == fmt->index) + break; } - return -EINVAL; + if (fmt->index < 0 /* late, but not too late */ || i == NUM_FORMATS) + return -EINVAL; + + strncpy(fmt->description, zoran_formats[i].name, sizeof(fmt->description)-1); + fmt->pixelformat = zoran_formats[i].fourcc; + if (zoran_formats[i].flags & ZORAN_FORMAT_COMPRESSED) + fmt->flags |= V4L2_FMT_FLAG_COMPRESSED; + return 0; } static int zoran_enum_fmt_vid_cap(struct file *file, void *__fh, diff --git a/trunk/drivers/mtd/mtdsuper.c b/trunk/drivers/mtd/mtdsuper.c index af8b42e0a55b..92285d0089c2 100644 --- a/trunk/drivers/mtd/mtdsuper.c +++ b/trunk/drivers/mtd/mtdsuper.c @@ -74,7 +74,8 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags, ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0); if (ret < 0) { - deactivate_locked_super(sb); + up_write(&sb->s_umount); + deactivate_super(sb); return ret; } diff --git a/trunk/drivers/net/arm/ixp4xx_eth.c b/trunk/drivers/net/arm/ixp4xx_eth.c index a740053d3af3..448487e22fa3 100644 --- a/trunk/drivers/net/arm/ixp4xx_eth.c +++ b/trunk/drivers/net/arm/ixp4xx_eth.c @@ -338,12 +338,12 @@ static int ixp4xx_mdio_register(void) if (cpu_is_ixp43x()) { /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */ if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEC_ETH)) - return -ENODEV; + return -ENOSYS; mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT; } else { /* All MII PHY accesses use NPE-B Ethernet registers */ if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0)) - return -ENODEV; + return -ENOSYS; mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT; } @@ -1174,7 +1174,7 @@ static int __devinit eth_init_one(struct platform_device *pdev) regs_phys = IXP4XX_EthC_BASE_PHYS; break; default: - err = -ENODEV; + err = -ENOSYS; goto err_free; } @@ -1189,10 +1189,15 @@ static int __devinit eth_init_one(struct platform_device *pdev) goto err_free; } + if (register_netdev(dev)) { + err = -EIO; + goto err_npe_rel; + } + port->mem_res = request_mem_region(regs_phys, REGS_SIZE, dev->name); if (!port->mem_res) { err = -EBUSY; - goto err_npe_rel; + goto err_unreg; } port->plat = plat; @@ -1210,25 +1215,20 @@ static int __devinit eth_init_one(struct platform_device *pdev) snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, PHY_INTERFACE_MODE_MII); - if ((err = IS_ERR(port->phydev))) - goto err_free_mem; + if (IS_ERR(port->phydev)) { + printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); + return PTR_ERR(port->phydev); + } port->phydev->irq = PHY_POLL; - if ((err = register_netdev(dev))) - goto err_phy_dis; - printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, npe_name(port->npe)); return 0; -err_phy_dis: - phy_disconnect(port->phydev); -err_free_mem: - npe_port_tab[NPE_ID(port->id)] = NULL; - platform_set_drvdata(pdev, NULL); - release_resource(port->mem_res); +err_unreg: + unregister_netdev(dev); err_npe_rel: npe_release(port->npe); err_free: @@ -1242,7 +1242,6 @@ static int __devexit eth_remove_one(struct platform_device *pdev) struct port *port = netdev_priv(dev); unregister_netdev(dev); - phy_disconnect(port->phydev); npe_port_tab[NPE_ID(port->id)] = NULL; platform_set_drvdata(pdev, NULL); npe_release(port->npe); diff --git a/trunk/drivers/net/bnx2.c b/trunk/drivers/net/bnx2.c index b0cb29d4cc01..d47839184a06 100644 --- a/trunk/drivers/net/bnx2.c +++ b/trunk/drivers/net/bnx2.c @@ -54,8 +54,8 @@ #define DRV_MODULE_NAME "bnx2" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "2.0.1" -#define DRV_MODULE_RELDATE "May 6, 2009" +#define DRV_MODULE_VERSION "2.0.0" +#define DRV_MODULE_RELDATE "April 2, 2009" #define FW_MIPS_FILE_06 "bnx2/bnx2-mips-06-4.6.16.fw" #define FW_RV2P_FILE_06 "bnx2/bnx2-rv2p-06-4.6.16.fw" #define FW_MIPS_FILE_09 "bnx2/bnx2-mips-09-4.6.17.fw" @@ -2600,7 +2600,6 @@ bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi) /* Tell compiler that status block fields can change. */ barrier(); cons = *bnapi->hw_tx_cons_ptr; - barrier(); if (unlikely((cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT)) cons++; return cons; @@ -2880,7 +2879,6 @@ bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi) /* Tell compiler that status block fields can change. */ barrier(); cons = *bnapi->hw_rx_cons_ptr; - barrier(); if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT)) cons++; return cons; diff --git a/trunk/drivers/net/bonding/bond_main.c b/trunk/drivers/net/bonding/bond_main.c index 74824028f85c..2188a96fc090 100644 --- a/trunk/drivers/net/bonding/bond_main.c +++ b/trunk/drivers/net/bonding/bond_main.c @@ -5181,6 +5181,7 @@ static int __init bonding_init(void) { int i; int res; + struct bonding *bond; printk(KERN_INFO "%s", version); @@ -5211,6 +5212,13 @@ static int __init bonding_init(void) goto out; err: + list_for_each_entry(bond, &bond_dev_list, bond_list) { + bond_work_cancel_all(bond); + destroy_workqueue(bond->wq); + } + + bond_destroy_sysfs(); + rtnl_lock(); bond_free_all(); rtnl_unlock(); diff --git a/trunk/drivers/net/igb/igb_main.c b/trunk/drivers/net/igb/igb_main.c index e25343588fc7..08c801490c72 100644 --- a/trunk/drivers/net/igb/igb_main.c +++ b/trunk/drivers/net/igb/igb_main.c @@ -2006,7 +2006,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) struct e1000_hw *hw = &adapter->hw; u32 rctl; u32 srrctl = 0; - int i; + int i, j; rctl = rd32(E1000_RCTL); @@ -2071,6 +2071,8 @@ static void igb_setup_rctl(struct igb_adapter *adapter) if (adapter->vfs_allocated_count) { u32 vmolr; + j = adapter->rx_ring[0].reg_idx; + /* set all queue drop enable bits */ wr32(E1000_QDE, ALL_QUEUES); srrctl |= E1000_SRRCTL_DROP_EN; @@ -2078,16 +2080,16 @@ static void igb_setup_rctl(struct igb_adapter *adapter) /* disable queue 0 to prevent tail write w/o re-config */ wr32(E1000_RXDCTL(0), 0); - vmolr = rd32(E1000_VMOLR(adapter->vfs_allocated_count)); + vmolr = rd32(E1000_VMOLR(j)); if (rctl & E1000_RCTL_LPE) vmolr |= E1000_VMOLR_LPE; - if (adapter->num_rx_queues > 1) + if (adapter->num_rx_queues > 0) vmolr |= E1000_VMOLR_RSSE; - wr32(E1000_VMOLR(adapter->vfs_allocated_count), vmolr); + wr32(E1000_VMOLR(j), vmolr); } for (i = 0; i < adapter->num_rx_queues; i++) { - int j = adapter->rx_ring[i].reg_idx; + j = adapter->rx_ring[i].reg_idx; wr32(E1000_SRRCTL(j), srrctl); } diff --git a/trunk/drivers/net/wan/ixp4xx_hss.c b/trunk/drivers/net/wan/ixp4xx_hss.c index 765a7f5d6aa4..3bf7d3f447db 100644 --- a/trunk/drivers/net/wan/ixp4xx_hss.c +++ b/trunk/drivers/net/wan/ixp4xx_hss.c @@ -1249,7 +1249,7 @@ static int __devinit hss_init_one(struct platform_device *pdev) return -ENOMEM; if ((port->npe = npe_request(0)) == NULL) { - err = -ENODEV; + err = -ENOSYS; goto err_free; } @@ -1311,7 +1311,7 @@ static int __init hss_init_module(void) if ((ixp4xx_read_feature_bits() & (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) != (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) - return -ENODEV; + return -ENOSYS; spin_lock_init(&npe_lock); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-sta.c b/trunk/drivers/net/wireless/iwlwifi/iwl-sta.c index 44ab03a12e40..5798fe49c771 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-sta.c @@ -719,14 +719,6 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, { unsigned long flags; int ret = 0; - __le16 key_flags = 0; - - key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); - key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); - key_flags &= ~STA_KEY_FLG_INVALID; - - if (sta_id == priv->hw_params.bcast_sta_id) - key_flags |= STA_KEY_MULTICAST_MSK; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; @@ -746,9 +738,6 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, "no space for a new key"); - priv->stations[sta_id].sta.key.key_flags = key_flags; - - /* This copy is acutally not needed: we get the key with each TX */ memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); @@ -765,7 +754,9 @@ void iwl_update_tkip_key(struct iwl_priv *priv, { u8 sta_id = IWL_INVALID_STATION; unsigned long flags; + __le16 key_flags = 0; int i; + DECLARE_MAC_BUF(mac); sta_id = iwl_find_station(priv, addr); if (sta_id == IWL_INVALID_STATION) { @@ -780,8 +771,16 @@ void iwl_update_tkip_key(struct iwl_priv *priv, return; } + key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); + key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); + key_flags &= ~STA_KEY_FLG_INVALID; + + if (sta_id == priv->hw_params.bcast_sta_id) + key_flags |= STA_KEY_MULTICAST_MSK; + spin_lock_irqsave(&priv->sta_lock, flags); + priv->stations[sta_id].sta.key.key_flags = key_flags; priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; for (i = 0; i < 5; i++) diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c index 4cce66133500..70a00c8ee42e 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -1744,6 +1744,7 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx rxq->bd = NULL; rxq->rb_stts = NULL; } +EXPORT_SYMBOL(iwl3945_rx_queue_free); /* Convert linear signal-to-noise ratio into dB */ diff --git a/trunk/drivers/scsi/osd/osd_uld.c b/trunk/drivers/scsi/osd/osd_uld.c index 22b59e13ba83..f644c9571eab 100644 --- a/trunk/drivers/scsi/osd/osd_uld.c +++ b/trunk/drivers/scsi/osd/osd_uld.c @@ -173,26 +173,26 @@ static const struct file_operations osd_fops = { .unlocked_ioctl = osd_uld_ioctl, }; -struct osd_dev *osduld_path_lookup(const char *name) +struct osd_dev *osduld_path_lookup(const char *path) { - struct path path; + struct nameidata nd; struct inode *inode; struct cdev *cdev; struct osd_uld_device *uninitialized_var(oud); int error; - if (!name || !*name) { + if (!path || !*path) { OSD_ERR("Mount with !path || !*path\n"); return ERR_PTR(-EINVAL); } - error = kern_path(name, LOOKUP_FOLLOW, &path); + error = path_lookup(path, LOOKUP_FOLLOW, &nd); if (error) { - OSD_ERR("path_lookup of %s failed=>%d\n", name, error); + OSD_ERR("path_lookup of %s faild=>%d\n", path, error); return ERR_PTR(error); } - inode = path.dentry->d_inode; + inode = nd.path.dentry->d_inode; error = -EINVAL; /* Not the right device e.g osd_uld_device */ if (!S_ISCHR(inode->i_mode)) { OSD_DEBUG("!S_ISCHR()\n"); @@ -202,15 +202,15 @@ struct osd_dev *osduld_path_lookup(const char *name) cdev = inode->i_cdev; if (!cdev) { OSD_ERR("Before mounting an OSD Based filesystem\n"); - OSD_ERR(" user-mode must open+close the %s device\n", name); - OSD_ERR(" Example: bash: echo < %s\n", name); + OSD_ERR(" user-mode must open+close the %s device\n", path); + OSD_ERR(" Example: bash: echo < %s\n", path); goto out; } /* The Magic wand. Is it our char-dev */ /* TODO: Support sg devices */ if (cdev->owner != THIS_MODULE) { - OSD_ERR("Error mounting %s - is not an OSD device\n", name); + OSD_ERR("Error mounting %s - is not an OSD device\n", path); goto out; } @@ -220,7 +220,7 @@ struct osd_dev *osduld_path_lookup(const char *name) error = 0; out: - path_put(&path); + path_put(&nd.path); return error ? ERR_PTR(error) : &oud->od; } EXPORT_SYMBOL(osduld_path_lookup); diff --git a/trunk/fs/9p/vfs_super.c b/trunk/fs/9p/vfs_super.c index ab5547ff29a1..5f8ab8adb5f5 100644 --- a/trunk/fs/9p/vfs_super.c +++ b/trunk/fs/9p/vfs_super.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -156,7 +155,6 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags, root = d_alloc_root(inode); if (!root) { - iput(inode); retval = -ENOMEM; goto release_sb; } @@ -175,7 +173,10 @@ P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n"); return 0; release_sb: - deactivate_locked_super(sb); + if (sb) { + up_write(&sb->s_umount); + deactivate_super(sb); + } free_stat: kfree(st); @@ -229,12 +230,9 @@ static int v9fs_show_options(struct seq_file *m, struct vfsmount *mnt) static void v9fs_umount_begin(struct super_block *sb) { - struct v9fs_session_info *v9ses; + struct v9fs_session_info *v9ses = sb->s_fs_info; - lock_kernel(); - v9ses = sb->s_fs_info; v9fs_session_cancel(v9ses); - unlock_kernel(); } static const struct super_operations v9fs_super_ops = { diff --git a/trunk/fs/affs/super.c b/trunk/fs/affs/super.c index 63f5183f263b..5ce695e707fe 100644 --- a/trunk/fs/affs/super.c +++ b/trunk/fs/affs/super.c @@ -507,7 +507,8 @@ affs_remount(struct super_block *sb, int *flags, char *data) kfree(new_opts); return -EINVAL; } - replace_mount_options(sb, new_opts); + kfree(sb->s_options); + sb->s_options = new_opts; sbi->s_flags = mount_flags; sbi->s_mode = mode; diff --git a/trunk/fs/afs/super.c b/trunk/fs/afs/super.c index 76828e5f8a39..aee239a048cb 100644 --- a/trunk/fs/afs/super.c +++ b/trunk/fs/afs/super.c @@ -405,20 +405,21 @@ static int afs_get_sb(struct file_system_type *fs_type, sb->s_flags = flags; ret = afs_fill_super(sb, ¶ms); if (ret < 0) { - deactivate_locked_super(sb); + up_write(&sb->s_umount); + deactivate_super(sb); goto error; } - save_mount_options(sb, new_opts); + sb->s_options = new_opts; sb->s_flags |= MS_ACTIVE; } else { _debug("reuse"); + kfree(new_opts); ASSERTCMP(sb->s_flags, &, MS_ACTIVE); } simple_set_mnt(mnt, sb); afs_put_volume(params.volume); afs_put_cell(params.cell); - kfree(new_opts); _leave(" = 0 [%p]", sb); return 0; diff --git a/trunk/fs/btrfs/super.c b/trunk/fs/btrfs/super.c index 6dfae5b28f59..3536bdb2d7cb 100644 --- a/trunk/fs/btrfs/super.c +++ b/trunk/fs/btrfs/super.c @@ -502,7 +502,8 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags, if (s->s_root) { if ((flags ^ s->s_flags) & MS_RDONLY) { - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); error = -EBUSY; goto error_close_devices; } @@ -516,7 +517,8 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags, error = btrfs_fill_super(s, fs_devices, data, flags & MS_SILENT ? 1 : 0); if (error) { - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); goto error_free_subvol_name; } @@ -533,13 +535,15 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags, mutex_unlock(&s->s_root->d_inode->i_mutex); if (IS_ERR(root)) { - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); error = PTR_ERR(root); goto error_free_subvol_name; } if (!root->d_inode) { dput(root); - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); error = -ENXIO; goto error_free_subvol_name; } diff --git a/trunk/fs/cifs/cifsfs.c b/trunk/fs/cifs/cifsfs.c index 5e6d35804d73..0d6d8b573652 100644 --- a/trunk/fs/cifs/cifsfs.c +++ b/trunk/fs/cifs/cifsfs.c @@ -35,7 +35,6 @@ #include #include #include -#include #include "cifsfs.h" #include "cifspdu.h" #define DECLARE_GLOBALS_HERE @@ -531,7 +530,6 @@ static void cifs_umount_begin(struct super_block *sb) if (tcon == NULL) return; - lock_kernel(); read_lock(&cifs_tcp_ses_lock); if (tcon->tc_count == 1) tcon->tidStatus = CifsExiting; @@ -550,7 +548,6 @@ static void cifs_umount_begin(struct super_block *sb) } /* BB FIXME - finish add checks for tidStatus BB */ - unlock_kernel(); return; } @@ -602,7 +599,8 @@ cifs_get_sb(struct file_system_type *fs_type, rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0); if (rc) { - deactivate_locked_super(sb); + up_write(&sb->s_umount); + deactivate_super(sb); return rc; } sb->s_flags |= MS_ACTIVE; diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index 75659a6fd1f8..1fcffebfb44f 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -481,7 +481,7 @@ static void __shrink_dcache_sb(struct super_block *sb, int *count, int flags) if ((flags & DCACHE_REFERENCED) && (dentry->d_flags & DCACHE_REFERENCED)) { dentry->d_flags &= ~DCACHE_REFERENCED; - list_move(&dentry->d_lru, &referenced); + list_move_tail(&dentry->d_lru, &referenced); spin_unlock(&dentry->d_lock); } else { list_move_tail(&dentry->d_lru, &tmp); diff --git a/trunk/fs/devpts/inode.c b/trunk/fs/devpts/inode.c index 21165cf934ff..63a4a59e4148 100644 --- a/trunk/fs/devpts/inode.c +++ b/trunk/fs/devpts/inode.c @@ -389,10 +389,11 @@ static int devpts_get_sb(struct file_system_type *fs_type, return 0; out_dput: - dput(s->s_root); /* undo dget() in simple_set_mnt() */ + dput(s->s_root); out_undo_sget: - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); return error; } diff --git a/trunk/fs/ecryptfs/main.c b/trunk/fs/ecryptfs/main.c index 9f0aa9883c28..ccabd5faa04d 100644 --- a/trunk/fs/ecryptfs/main.c +++ b/trunk/fs/ecryptfs/main.c @@ -614,8 +614,9 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags, } goto out; out_abort: - dput(sb->s_root); /* aka mnt->mnt_root, as set by get_sb_nodev() */ - deactivate_locked_super(sb); + dput(sb->s_root); + up_write(&sb->s_umount); + deactivate_super(sb); out: return rc; } diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 895823d0149d..639177b0eeac 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -105,28 +105,40 @@ static inline void put_binfmt(struct linux_binfmt * fmt) SYSCALL_DEFINE1(uselib, const char __user *, library) { struct file *file; + struct nameidata nd; char *tmp = getname(library); int error = PTR_ERR(tmp); - if (IS_ERR(tmp)) - goto out; - - file = do_filp_open(AT_FDCWD, tmp, - O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0, - MAY_READ | MAY_EXEC | MAY_OPEN); - putname(tmp); - error = PTR_ERR(file); - if (IS_ERR(file)) + if (!IS_ERR(tmp)) { + error = path_lookup_open(AT_FDCWD, tmp, + LOOKUP_FOLLOW, &nd, + FMODE_READ|FMODE_EXEC); + putname(tmp); + } + if (error) goto out; error = -EINVAL; - if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) + if (!S_ISREG(nd.path.dentry->d_inode->i_mode)) goto exit; error = -EACCES; - if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) + if (nd.path.mnt->mnt_flags & MNT_NOEXEC) + goto exit; + + error = inode_permission(nd.path.dentry->d_inode, + MAY_READ | MAY_EXEC | MAY_OPEN); + if (error) + goto exit; + error = ima_path_check(&nd.path, MAY_READ | MAY_EXEC | MAY_OPEN); + if (error) goto exit; + file = nameidata_to_filp(&nd, O_RDONLY|O_LARGEFILE); + error = PTR_ERR(file); + if (IS_ERR(file)) + goto out; + fsnotify_open(file->f_path.dentry); error = -ENOEXEC; @@ -148,10 +160,13 @@ SYSCALL_DEFINE1(uselib, const char __user *, library) } read_unlock(&binfmt_lock); } -exit: fput(file); out: return error; +exit: + release_open_intent(&nd); + path_put(&nd.path); + goto out; } #ifdef CONFIG_MMU @@ -646,33 +661,47 @@ EXPORT_SYMBOL(setup_arg_pages); struct file *open_exec(const char *name) { + struct nameidata nd; struct file *file; int err; - file = do_filp_open(AT_FDCWD, name, - O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0, - MAY_EXEC | MAY_OPEN); - if (IS_ERR(file)) + err = path_lookup_open(AT_FDCWD, name, LOOKUP_FOLLOW, &nd, + FMODE_READ|FMODE_EXEC); + if (err) goto out; err = -EACCES; - if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) - goto exit; + if (!S_ISREG(nd.path.dentry->d_inode->i_mode)) + goto out_path_put; - if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) - goto exit; + if (nd.path.mnt->mnt_flags & MNT_NOEXEC) + goto out_path_put; + + err = inode_permission(nd.path.dentry->d_inode, MAY_EXEC | MAY_OPEN); + if (err) + goto out_path_put; + err = ima_path_check(&nd.path, MAY_EXEC | MAY_OPEN); + if (err) + goto out_path_put; + + file = nameidata_to_filp(&nd, O_RDONLY|O_LARGEFILE); + if (IS_ERR(file)) + return file; fsnotify_open(file->f_path.dentry); err = deny_write_access(file); - if (err) - goto exit; + if (err) { + fput(file); + goto out; + } -out: return file; -exit: - fput(file); + out_path_put: + release_open_intent(&nd); + path_put(&nd.path); + out: return ERR_PTR(err); } EXPORT_SYMBOL(open_exec); diff --git a/trunk/fs/fuse/inode.c b/trunk/fs/fuse/inode.c index d1bc4d33ccbc..459b73dd45e1 100644 --- a/trunk/fs/fuse/inode.c +++ b/trunk/fs/fuse/inode.c @@ -19,7 +19,6 @@ #include #include #include -#include MODULE_AUTHOR("Miklos Szeredi "); MODULE_DESCRIPTION("Filesystem in Userspace"); @@ -260,9 +259,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, static void fuse_umount_begin(struct super_block *sb) { - lock_kernel(); fuse_abort_conn(get_fuse_conn_super(sb)); - unlock_kernel(); } static void fuse_send_destroy(struct fuse_conn *fc) diff --git a/trunk/fs/gfs2/glock.c b/trunk/fs/gfs2/glock.c index ff4981090489..1afd9f26bcb1 100644 --- a/trunk/fs/gfs2/glock.c +++ b/trunk/fs/gfs2/glock.c @@ -1304,7 +1304,6 @@ static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask) nr--; if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) gfs2_glock_put(gl); - got_ref = 0; } spin_lock(&lru_lock); if (may_demote) diff --git a/trunk/fs/gfs2/ops_fstype.c b/trunk/fs/gfs2/ops_fstype.c index 1ff9473ea753..650a730707b7 100644 --- a/trunk/fs/gfs2/ops_fstype.c +++ b/trunk/fs/gfs2/ops_fstype.c @@ -1282,21 +1282,21 @@ static int gfs2_get_sb(struct file_system_type *fs_type, int flags, static struct super_block *get_gfs2_sb(const char *dev_name) { struct super_block *sb; - struct path path; + struct nameidata nd; int error; - error = kern_path(dev_name, LOOKUP_FOLLOW, &path); + error = path_lookup(dev_name, LOOKUP_FOLLOW, &nd); if (error) { printk(KERN_WARNING "GFS2: path_lookup on %s returned error %d\n", dev_name, error); return NULL; } - sb = path.dentry->d_inode->i_sb; + sb = nd.path.dentry->d_inode->i_sb; if (sb && (sb->s_type == &gfs2_fs_type)) atomic_inc(&sb->s_active); else sb = NULL; - path_put(&path); + path_put(&nd.path); return sb; } diff --git a/trunk/fs/hpfs/super.c b/trunk/fs/hpfs/super.c index fc77965be841..fecf402d7b8a 100644 --- a/trunk/fs/hpfs/super.c +++ b/trunk/fs/hpfs/super.c @@ -423,7 +423,8 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data) if (!(*flags & MS_RDONLY)) mark_dirty(s); - replace_mount_options(s, new_opts); + kfree(s->s_options); + s->s_options = new_opts; return 0; diff --git a/trunk/fs/inode.c b/trunk/fs/inode.c index 0571983755dc..6ad14a1cd8c9 100644 --- a/trunk/fs/inode.c +++ b/trunk/fs/inode.c @@ -99,7 +99,7 @@ static DEFINE_MUTEX(iprune_mutex); */ struct inodes_stat_t inodes_stat; -static struct kmem_cache *inode_cachep __read_mostly; +static struct kmem_cache * inode_cachep __read_mostly; static void wake_up_inode(struct inode *inode) { @@ -124,7 +124,7 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode) static struct inode_operations empty_iops; static const struct file_operations empty_fops; - struct address_space *const mapping = &inode->i_data; + struct address_space * const mapping = &inode->i_data; inode->i_sb = sb; inode->i_blkbits = sb->s_blocksize_bits; @@ -216,7 +216,7 @@ static struct inode *alloc_inode(struct super_block *sb) return NULL; } -void destroy_inode(struct inode *inode) +void destroy_inode(struct inode *inode) { BUG_ON(inode_has_buffers(inode)); security_inode_free(inode); @@ -252,11 +252,12 @@ void inode_init_once(struct inode *inode) mutex_init(&inode->inotify_mutex); #endif } + EXPORT_SYMBOL(inode_init_once); static void init_once(void *foo) { - struct inode *inode = (struct inode *) foo; + struct inode * inode = (struct inode *) foo; inode_init_once(inode); } @@ -264,7 +265,7 @@ static void init_once(void *foo) /* * inode_lock must be held */ -void __iget(struct inode *inode) +void __iget(struct inode * inode) { if (atomic_read(&inode->i_count)) { atomic_inc(&inode->i_count); @@ -288,7 +289,7 @@ void clear_inode(struct inode *inode) { might_sleep(); invalidate_inode_buffers(inode); - + BUG_ON(inode->i_data.nrpages); BUG_ON(!(inode->i_state & I_FREEING)); BUG_ON(inode->i_state & I_CLEAR); @@ -302,6 +303,7 @@ void clear_inode(struct inode *inode) cd_forget(inode); inode->i_state = I_CLEAR; } + EXPORT_SYMBOL(clear_inode); /* @@ -349,8 +351,8 @@ static int invalidate_list(struct list_head *head, struct list_head *dispose) next = head->next; for (;;) { - struct list_head *tmp = next; - struct inode *inode; + struct list_head * tmp = next; + struct inode * inode; /* * We can reschedule here without worrying about the list's @@ -389,7 +391,7 @@ static int invalidate_list(struct list_head *head, struct list_head *dispose) * fails because there are busy inodes then a non zero value is returned. * If the discard is successful all the inodes have been discarded. */ -int invalidate_inodes(struct super_block *sb) +int invalidate_inodes(struct super_block * sb) { int busy; LIST_HEAD(throw_away); @@ -405,6 +407,7 @@ int invalidate_inodes(struct super_block *sb) return busy; } + EXPORT_SYMBOL(invalidate_inodes); static int can_unuse(struct inode *inode) @@ -501,7 +504,7 @@ static int shrink_icache_memory(int nr, gfp_t gfp_mask) * Nasty deadlock avoidance. We may hold various FS locks, * and we don't want to recurse into the FS that called us * in clear_inode() and friends.. - */ + */ if (!(gfp_mask & __GFP_FS)) return -1; prune_icache(nr); @@ -521,13 +524,10 @@ static void __wait_on_freeing_inode(struct inode *inode); * by hand after calling find_inode now! This simplifies iunique and won't * add any additional branch in the common code. */ -static struct inode *find_inode(struct super_block *sb, - struct hlist_head *head, - int (*test)(struct inode *, void *), - void *data) +static struct inode * find_inode(struct super_block * sb, struct hlist_head *head, int (*test)(struct inode *, void *), void *data) { struct hlist_node *node; - struct inode *inode = NULL; + struct inode * inode = NULL; repeat: hlist_for_each_entry(inode, node, head, i_hash) { @@ -548,11 +548,10 @@ static struct inode *find_inode(struct super_block *sb, * find_inode_fast is the fast path version of find_inode, see the comment at * iget_locked for details. */ -static struct inode *find_inode_fast(struct super_block *sb, - struct hlist_head *head, unsigned long ino) +static struct inode * find_inode_fast(struct super_block * sb, struct hlist_head *head, unsigned long ino) { struct hlist_node *node; - struct inode *inode = NULL; + struct inode * inode = NULL; repeat: hlist_for_each_entry(inode, node, head, i_hash) { @@ -632,10 +631,10 @@ struct inode *new_inode(struct super_block *sb) * here to attempt to avoid that. */ static unsigned int last_ino; - struct inode *inode; + struct inode * inode; spin_lock_prefetch(&inode_lock); - + inode = alloc_inode(sb); if (inode) { spin_lock(&inode_lock); @@ -646,6 +645,7 @@ struct inode *new_inode(struct super_block *sb) } return inode; } + EXPORT_SYMBOL(new_inode); void unlock_new_inode(struct inode *inode) @@ -674,6 +674,7 @@ void unlock_new_inode(struct inode *inode) inode->i_state &= ~(I_LOCK|I_NEW); wake_up_inode(inode); } + EXPORT_SYMBOL(unlock_new_inode); /* @@ -682,17 +683,13 @@ EXPORT_SYMBOL(unlock_new_inode); * We no longer cache the sb_flags in i_flags - see fs.h * -- rmk@arm.uk.linux.org */ -static struct inode *get_new_inode(struct super_block *sb, - struct hlist_head *head, - int (*test)(struct inode *, void *), - int (*set)(struct inode *, void *), - void *data) +static struct inode * get_new_inode(struct super_block *sb, struct hlist_head *head, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *data) { - struct inode *inode; + struct inode * inode; inode = alloc_inode(sb); if (inode) { - struct inode *old; + struct inode * old; spin_lock(&inode_lock); /* We released the lock, so.. */ @@ -734,14 +731,13 @@ static struct inode *get_new_inode(struct super_block *sb, * get_new_inode_fast is the fast path version of get_new_inode, see the * comment at iget_locked for details. */ -static struct inode *get_new_inode_fast(struct super_block *sb, - struct hlist_head *head, unsigned long ino) +static struct inode * get_new_inode_fast(struct super_block *sb, struct hlist_head *head, unsigned long ino) { - struct inode *inode; + struct inode * inode; inode = alloc_inode(sb); if (inode) { - struct inode *old; + struct inode * old; spin_lock(&inode_lock); /* We released the lock, so.. */ @@ -827,6 +823,7 @@ struct inode *igrab(struct inode *inode) spin_unlock(&inode_lock); return inode; } + EXPORT_SYMBOL(igrab); /** @@ -927,6 +924,7 @@ struct inode *ilookup5_nowait(struct super_block *sb, unsigned long hashval, return ifind(sb, head, test, data, 0); } + EXPORT_SYMBOL(ilookup5_nowait); /** @@ -955,6 +953,7 @@ struct inode *ilookup5(struct super_block *sb, unsigned long hashval, return ifind(sb, head, test, data, 1); } + EXPORT_SYMBOL(ilookup5); /** @@ -977,6 +976,7 @@ struct inode *ilookup(struct super_block *sb, unsigned long ino) return ifind_fast(sb, head, ino); } + EXPORT_SYMBOL(ilookup); /** @@ -1015,6 +1015,7 @@ struct inode *iget5_locked(struct super_block *sb, unsigned long hashval, */ return get_new_inode(sb, head, test, set, data); } + EXPORT_SYMBOL(iget5_locked); /** @@ -1046,6 +1047,7 @@ struct inode *iget_locked(struct super_block *sb, unsigned long ino) */ return get_new_inode_fast(sb, head, ino); } + EXPORT_SYMBOL(iget_locked); int insert_inode_locked(struct inode *inode) @@ -1074,6 +1076,7 @@ int insert_inode_locked(struct inode *inode) iput(old); } } + EXPORT_SYMBOL(insert_inode_locked); int insert_inode_locked4(struct inode *inode, unsigned long hashval, @@ -1103,6 +1106,7 @@ int insert_inode_locked4(struct inode *inode, unsigned long hashval, iput(old); } } + EXPORT_SYMBOL(insert_inode_locked4); /** @@ -1120,6 +1124,7 @@ void __insert_inode_hash(struct inode *inode, unsigned long hashval) hlist_add_head(&inode->i_hash, head); spin_unlock(&inode_lock); } + EXPORT_SYMBOL(__insert_inode_hash); /** @@ -1134,6 +1139,7 @@ void remove_inode_hash(struct inode *inode) hlist_del_init(&inode->i_hash); spin_unlock(&inode_lock); } + EXPORT_SYMBOL(remove_inode_hash); /* @@ -1181,6 +1187,7 @@ void generic_delete_inode(struct inode *inode) BUG_ON(inode->i_state != I_CLEAR); destroy_inode(inode); } + EXPORT_SYMBOL(generic_delete_inode); static void generic_forget_inode(struct inode *inode) @@ -1230,11 +1237,12 @@ void generic_drop_inode(struct inode *inode) else generic_forget_inode(inode); } + EXPORT_SYMBOL_GPL(generic_drop_inode); /* * Called when we're dropping the last reference - * to an inode. + * to an inode. * * Call the FS "drop()" function, defaulting to * the legacy UNIX filesystem behaviour.. @@ -1254,7 +1262,7 @@ static inline void iput_final(struct inode *inode) } /** - * iput - put an inode + * iput - put an inode * @inode: inode to put * * Puts an inode, dropping its usage count. If the inode use count hits @@ -1271,6 +1279,7 @@ void iput(struct inode *inode) iput_final(inode); } } + EXPORT_SYMBOL(iput); /** @@ -1281,10 +1290,10 @@ EXPORT_SYMBOL(iput); * Returns the block number on the device holding the inode that * is the disk block number for the block of the file requested. * That is, asked for block 4 of inode 1 the function will return the - * disk block relative to the disk start that holds that block of the + * disk block relative to the disk start that holds that block of the * file. */ -sector_t bmap(struct inode *inode, sector_t block) +sector_t bmap(struct inode * inode, sector_t block) { sector_t res = 0; if (inode->i_mapping->a_ops->bmap) @@ -1416,6 +1425,7 @@ void file_update_time(struct file *file) mark_inode_dirty_sync(inode); mnt_drop_write(file->f_path.mnt); } + EXPORT_SYMBOL(file_update_time); int inode_needs_sync(struct inode *inode) @@ -1426,6 +1436,7 @@ int inode_needs_sync(struct inode *inode) return 1; return 0; } + EXPORT_SYMBOL(inode_needs_sync); int inode_wait(void *word) diff --git a/trunk/fs/libfs.c b/trunk/fs/libfs.c index 80046ddf5063..cd223190c4e9 100644 --- a/trunk/fs/libfs.c +++ b/trunk/fs/libfs.c @@ -246,7 +246,8 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name, return 0; Enomem: - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); return -ENOMEM; } diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 967c3db92724..78f253cd2d4f 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -1130,8 +1130,8 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt, * @nd: pointer to nameidata * @open_flags: open intent flags */ -static int path_lookup_open(int dfd, const char *name, - unsigned int lookup_flags, struct nameidata *nd, int open_flags) +int path_lookup_open(int dfd, const char *name, unsigned int lookup_flags, + struct nameidata *nd, int open_flags) { struct file *filp = get_empty_filp(); int err; @@ -1637,19 +1637,18 @@ static int open_will_write_to_fs(int flag, struct inode *inode) * open_to_namei_flags() for more details. */ struct file *do_filp_open(int dfd, const char *pathname, - int open_flag, int mode, int acc_mode) + int open_flag, int mode) { struct file *filp; struct nameidata nd; - int error; + int acc_mode, error; struct path path; struct dentry *dir; int count = 0; int will_write; int flag = open_to_namei_flags(open_flag); - if (!acc_mode) - acc_mode = MAY_OPEN | ACC_MODE(flag); + acc_mode = MAY_OPEN | ACC_MODE(flag); /* O_TRUNC implies we need access checks for write permissions */ if (flag & O_TRUNC) @@ -1870,7 +1869,7 @@ struct file *do_filp_open(int dfd, const char *pathname, */ struct file *filp_open(const char *filename, int flags, int mode) { - return do_filp_open(AT_FDCWD, filename, flags, mode, 0); + return do_filp_open(AT_FDCWD, filename, flags, mode); } EXPORT_SYMBOL(filp_open); diff --git a/trunk/fs/namespace.c b/trunk/fs/namespace.c index 134d494158d9..41196209a906 100644 --- a/trunk/fs/namespace.c +++ b/trunk/fs/namespace.c @@ -695,16 +695,12 @@ static inline void mangle(struct seq_file *m, const char *s) */ int generic_show_options(struct seq_file *m, struct vfsmount *mnt) { - const char *options; - - rcu_read_lock(); - options = rcu_dereference(mnt->mnt_sb->s_options); + const char *options = mnt->mnt_sb->s_options; if (options != NULL && options[0]) { seq_putc(m, ','); mangle(m, options); } - rcu_read_unlock(); return 0; } @@ -725,22 +721,11 @@ EXPORT_SYMBOL(generic_show_options); */ void save_mount_options(struct super_block *sb, char *options) { - BUG_ON(sb->s_options); - rcu_assign_pointer(sb->s_options, kstrdup(options, GFP_KERNEL)); + kfree(sb->s_options); + sb->s_options = kstrdup(options, GFP_KERNEL); } EXPORT_SYMBOL(save_mount_options); -void replace_mount_options(struct super_block *sb, char *options) -{ - char *old = sb->s_options; - rcu_assign_pointer(sb->s_options, options); - if (old) { - synchronize_rcu(); - kfree(old); - } -} -EXPORT_SYMBOL(replace_mount_options); - #ifdef CONFIG_PROC_FS /* iterator */ static void *m_start(struct seq_file *m, loff_t *pos) @@ -1088,7 +1073,9 @@ static int do_umount(struct vfsmount *mnt, int flags) */ if (flags & MNT_FORCE && sb->s_op->umount_begin) { + lock_kernel(); sb->s_op->umount_begin(sb); + unlock_kernel(); } /* diff --git a/trunk/fs/nfs/super.c b/trunk/fs/nfs/super.c index d2d67781c579..6717200923fe 100644 --- a/trunk/fs/nfs/super.c +++ b/trunk/fs/nfs/super.c @@ -683,12 +683,9 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt) */ static void nfs_umount_begin(struct super_block *sb) { - struct nfs_server *server; + struct nfs_server *server = NFS_SB(sb); struct rpc_clnt *rpc; - lock_kernel(); - - server = NFS_SB(sb); /* -EIO all pending I/O */ rpc = server->client_acl; if (!IS_ERR(rpc)) @@ -696,8 +693,6 @@ static void nfs_umount_begin(struct super_block *sb) rpc = server->client; if (!IS_ERR(rpc)) rpc_killall_tasks(rpc); - - unlock_kernel(); } /* @@ -2111,7 +2106,8 @@ static int nfs_get_sb(struct file_system_type *fs_type, error_splat_root: dput(mntroot); error_splat_super: - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); goto out; } @@ -2207,7 +2203,8 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags, return error; error_splat_super: - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); dprintk("<-- nfs_xdev_get_sb() = %d [splat]\n", error); return error; } @@ -2467,7 +2464,8 @@ static int nfs4_get_sb(struct file_system_type *fs_type, error_splat_root: dput(mntroot); error_splat_super: - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); goto out; } @@ -2561,7 +2559,8 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags, return error; error_splat_super: - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); dprintk("<-- nfs4_xdev_get_sb() = %d [splat]\n", error); return error; } @@ -2645,7 +2644,8 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags, return error; error_splat_super: - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error); return error; } diff --git a/trunk/fs/ocfs2/symlink.c b/trunk/fs/ocfs2/symlink.c index 579dd1b1110f..ed0a0cfd68d2 100644 --- a/trunk/fs/ocfs2/symlink.c +++ b/trunk/fs/ocfs2/symlink.c @@ -39,7 +39,6 @@ #include #include #include -#include #define MLOG_MASK_PREFIX ML_NAMEI #include @@ -55,6 +54,26 @@ #include "buffer_head_io.h" +static char *ocfs2_page_getlink(struct dentry * dentry, + struct page **ppage); +static char *ocfs2_fast_symlink_getlink(struct inode *inode, + struct buffer_head **bh); + +/* get the link contents into pagecache */ +static char *ocfs2_page_getlink(struct dentry * dentry, + struct page **ppage) +{ + struct page * page; + struct address_space *mapping = dentry->d_inode->i_mapping; + page = read_mapping_page(mapping, 0, NULL); + if (IS_ERR(page)) + goto sync_fail; + *ppage = page; + return kmap(page); + +sync_fail: + return (char*)page; +} static char *ocfs2_fast_symlink_getlink(struct inode *inode, struct buffer_head **bh) @@ -109,55 +128,40 @@ static int ocfs2_readlink(struct dentry *dentry, return ret; } -static void *ocfs2_fast_follow_link(struct dentry *dentry, - struct nameidata *nd) +static void *ocfs2_follow_link(struct dentry *dentry, + struct nameidata *nd) { - int status = 0; - int len; - char *target, *link = ERR_PTR(-ENOMEM); + int status; + char *link; struct inode *inode = dentry->d_inode; + struct page *page = NULL; struct buffer_head *bh = NULL; - - mlog_entry_void(); - - BUG_ON(!ocfs2_inode_is_fast_symlink(inode)); - target = ocfs2_fast_symlink_getlink(inode, &bh); - if (IS_ERR(target)) { - status = PTR_ERR(target); - mlog_errno(status); - goto bail; - } - - /* Fast symlinks can't be large */ - len = strlen(target); - link = kzalloc(len + 1, GFP_NOFS); - if (!link) { - status = -ENOMEM; + + if (ocfs2_inode_is_fast_symlink(inode)) + link = ocfs2_fast_symlink_getlink(inode, &bh); + else + link = ocfs2_page_getlink(dentry, &page); + if (IS_ERR(link)) { + status = PTR_ERR(link); mlog_errno(status); goto bail; } - memcpy(link, target, len); - nd_set_link(nd, link); + status = vfs_follow_link(nd, link); bail: + if (page) { + kunmap(page); + page_cache_release(page); + } brelse(bh); - mlog_exit(status); - return status ? ERR_PTR(status) : link; -} - -static void ocfs2_fast_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) -{ - char *link = cookie; - - kfree(link); + return ERR_PTR(status); } const struct inode_operations ocfs2_symlink_inode_operations = { .readlink = page_readlink, - .follow_link = page_follow_link_light, - .put_link = page_put_link, + .follow_link = ocfs2_follow_link, .getattr = ocfs2_getattr, .setattr = ocfs2_setattr, .setxattr = generic_setxattr, @@ -167,8 +171,7 @@ const struct inode_operations ocfs2_symlink_inode_operations = { }; const struct inode_operations ocfs2_fast_symlink_inode_operations = { .readlink = ocfs2_readlink, - .follow_link = ocfs2_fast_follow_link, - .put_link = ocfs2_fast_put_link, + .follow_link = ocfs2_follow_link, .getattr = ocfs2_getattr, .setattr = ocfs2_setattr, .setxattr = generic_setxattr, diff --git a/trunk/fs/open.c b/trunk/fs/open.c index bdfbf03615a4..377eb25b6abf 100644 --- a/trunk/fs/open.c +++ b/trunk/fs/open.c @@ -1033,7 +1033,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode) if (!IS_ERR(tmp)) { fd = get_unused_fd_flags(flags); if (fd >= 0) { - struct file *f = do_filp_open(dfd, tmp, flags, mode, 0); + struct file *f = do_filp_open(dfd, tmp, flags, mode); if (IS_ERR(f)) { put_unused_fd(fd); fd = PTR_ERR(f); diff --git a/trunk/fs/proc/root.c b/trunk/fs/proc/root.c index b080b791d9e3..1e15a2b176e8 100644 --- a/trunk/fs/proc/root.c +++ b/trunk/fs/proc/root.c @@ -67,7 +67,8 @@ static int proc_get_sb(struct file_system_type *fs_type, sb->s_flags = flags; err = proc_fill_super(sb); if (err) { - deactivate_locked_super(sb); + up_write(&sb->s_umount); + deactivate_super(sb); return err; } diff --git a/trunk/fs/reiserfs/dir.c b/trunk/fs/reiserfs/dir.c index 45ee3d357c70..67a80d7e59e2 100644 --- a/trunk/fs/reiserfs/dir.c +++ b/trunk/fs/reiserfs/dir.c @@ -41,18 +41,6 @@ static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, #define store_ih(where,what) copy_item_head (where, what) -static inline bool is_privroot_deh(struct dentry *dir, - struct reiserfs_de_head *deh) -{ - int ret = 0; -#ifdef CONFIG_REISERFS_FS_XATTR - struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root; - ret = (dir == dir->d_parent && privroot->d_inode && - deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid); -#endif - return ret; -} - int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, filldir_t filldir, loff_t *pos) { @@ -150,8 +138,18 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, } /* Ignore the .reiserfs_priv entry */ - if (is_privroot_deh(dentry, deh)) + if (reiserfs_xattrs(inode->i_sb) && + !old_format_only(inode->i_sb) && + dentry == inode->i_sb->s_root && + REISERFS_SB(inode->i_sb)->priv_root && + REISERFS_SB(inode->i_sb)->priv_root->d_inode + && deh_objectid(deh) == + le32_to_cpu(INODE_PKEY + (REISERFS_SB(inode->i_sb)-> + priv_root->d_inode)-> + k_objectid)) { continue; + } d_off = deh_offset(deh); *pos = d_off; diff --git a/trunk/fs/reiserfs/namei.c b/trunk/fs/reiserfs/namei.c index 271579128634..efd4d720718e 100644 --- a/trunk/fs/reiserfs/namei.c +++ b/trunk/fs/reiserfs/namei.c @@ -338,8 +338,21 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry, &path_to_entry, &de); pathrelse(&path_to_entry); if (retval == NAME_FOUND) { - inode = reiserfs_iget(dir->i_sb, - (struct cpu_key *)&(de.de_dir_id)); + /* Hide the .reiserfs_priv directory */ + if (reiserfs_xattrs(dir->i_sb) && + !old_format_only(dir->i_sb) && + REISERFS_SB(dir->i_sb)->priv_root && + REISERFS_SB(dir->i_sb)->priv_root->d_inode && + de.de_objectid == + le32_to_cpu(INODE_PKEY + (REISERFS_SB(dir->i_sb)->priv_root->d_inode)-> + k_objectid)) { + reiserfs_write_unlock(dir->i_sb); + return ERR_PTR(-EACCES); + } + + inode = + reiserfs_iget(dir->i_sb, (struct cpu_key *)&(de.de_dir_id)); if (!inode || IS_ERR(inode)) { reiserfs_write_unlock(dir->i_sb); return ERR_PTR(-EACCES); diff --git a/trunk/fs/reiserfs/super.c b/trunk/fs/reiserfs/super.c index 1215a4f50cd2..0ae6486d9046 100644 --- a/trunk/fs/reiserfs/super.c +++ b/trunk/fs/reiserfs/super.c @@ -1316,7 +1316,8 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) } out_ok: - replace_mount_options(s, new_opts); + kfree(s->s_options); + s->s_options = new_opts; return 0; out_err: @@ -1841,8 +1842,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) goto error; } - if ((errval = reiserfs_lookup_privroot(s)) || - (errval = reiserfs_xattr_init(s, s->s_flags))) { + if ((errval = reiserfs_xattr_init(s, s->s_flags))) { dput(s->s_root); s->s_root = NULL; goto error; @@ -1855,8 +1855,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) reiserfs_info(s, "using 3.5.x disk format\n"); } - if ((errval = reiserfs_lookup_privroot(s)) || - (errval = reiserfs_xattr_init(s, s->s_flags))) { + if ((errval = reiserfs_xattr_init(s, s->s_flags))) { dput(s->s_root); s->s_root = NULL; goto error; diff --git a/trunk/fs/reiserfs/xattr.c b/trunk/fs/reiserfs/xattr.c index 2237e10c7c7c..f83f52bae390 100644 --- a/trunk/fs/reiserfs/xattr.c +++ b/trunk/fs/reiserfs/xattr.c @@ -113,28 +113,41 @@ static int xattr_rmdir(struct inode *dir, struct dentry *dentry) #define xattr_may_create(flags) (!flags || flags & XATTR_CREATE) -static struct dentry *open_xa_root(struct super_block *sb, int flags) +/* Returns and possibly creates the xattr dir. */ +static struct dentry *lookup_or_create_dir(struct dentry *parent, + const char *name, int flags) { - struct dentry *privroot = REISERFS_SB(sb)->priv_root; - struct dentry *xaroot; - if (!privroot->d_inode) - return ERR_PTR(-ENODATA); - - mutex_lock_nested(&privroot->d_inode->i_mutex, I_MUTEX_XATTR); + struct dentry *dentry; + BUG_ON(!parent); - xaroot = dget(REISERFS_SB(sb)->xattr_root); - if (!xaroot->d_inode) { + dentry = lookup_one_len(name, parent, strlen(name)); + if (IS_ERR(dentry)) + return dentry; + else if (!dentry->d_inode) { int err = -ENODATA; - if (xattr_may_create(flags)) - err = xattr_mkdir(privroot->d_inode, xaroot, 0700); + + if (xattr_may_create(flags)) { + mutex_lock_nested(&parent->d_inode->i_mutex, + I_MUTEX_XATTR); + err = xattr_mkdir(parent->d_inode, dentry, 0700); + mutex_unlock(&parent->d_inode->i_mutex); + } + if (err) { - dput(xaroot); - xaroot = ERR_PTR(err); + dput(dentry); + dentry = ERR_PTR(err); } } - mutex_unlock(&privroot->d_inode->i_mutex); - return xaroot; + return dentry; +} + +static struct dentry *open_xa_root(struct super_block *sb, int flags) +{ + struct dentry *privroot = REISERFS_SB(sb)->priv_root; + if (!privroot) + return ERR_PTR(-ENODATA); + return lookup_or_create_dir(privroot, XAROOT_NAME, flags); } static struct dentry *open_xa_dir(const struct inode *inode, int flags) @@ -150,22 +163,10 @@ static struct dentry *open_xa_dir(const struct inode *inode, int flags) le32_to_cpu(INODE_PKEY(inode)->k_objectid), inode->i_generation); - mutex_lock_nested(&xaroot->d_inode->i_mutex, I_MUTEX_XATTR); - - xadir = lookup_one_len(namebuf, xaroot, strlen(namebuf)); - if (!IS_ERR(xadir) && !xadir->d_inode) { - int err = -ENODATA; - if (xattr_may_create(flags)) - err = xattr_mkdir(xaroot->d_inode, xadir, 0700); - if (err) { - dput(xadir); - xadir = ERR_PTR(err); - } - } - - mutex_unlock(&xaroot->d_inode->i_mutex); + xadir = lookup_or_create_dir(xaroot, namebuf, flags); dput(xaroot); return xadir; + } /* The following are side effects of other operations that aren't explicitly @@ -183,7 +184,6 @@ fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset, { struct reiserfs_dentry_buf *dbuf = buf; struct dentry *dentry; - WARN_ON_ONCE(!mutex_is_locked(&dbuf->xadir->d_inode->i_mutex)); if (dbuf->count == ARRAY_SIZE(dbuf->dentries)) return -ENOSPC; @@ -349,7 +349,6 @@ static struct dentry *xattr_lookup(struct inode *inode, const char *name, if (IS_ERR(xadir)) return ERR_CAST(xadir); - mutex_lock_nested(&xadir->d_inode->i_mutex, I_MUTEX_XATTR); xafile = lookup_one_len(name, xadir, strlen(name)); if (IS_ERR(xafile)) { err = PTR_ERR(xafile); @@ -361,15 +360,18 @@ static struct dentry *xattr_lookup(struct inode *inode, const char *name, if (!xafile->d_inode) { err = -ENODATA; - if (xattr_may_create(flags)) + if (xattr_may_create(flags)) { + mutex_lock_nested(&xadir->d_inode->i_mutex, + I_MUTEX_XATTR); err = xattr_create(xadir->d_inode, xafile, 0700|S_IFREG); + mutex_unlock(&xadir->d_inode->i_mutex); + } } if (err) dput(xafile); out: - mutex_unlock(&xadir->d_inode->i_mutex); dput(xadir); if (err) return ERR_PTR(err); @@ -433,7 +435,6 @@ static int lookup_and_delete_xattr(struct inode *inode, const char *name) if (IS_ERR(xadir)) return PTR_ERR(xadir); - mutex_lock_nested(&xadir->d_inode->i_mutex, I_MUTEX_XATTR); dentry = lookup_one_len(name, xadir, strlen(name)); if (IS_ERR(dentry)) { err = PTR_ERR(dentry); @@ -441,13 +442,14 @@ static int lookup_and_delete_xattr(struct inode *inode, const char *name) } if (dentry->d_inode) { + mutex_lock_nested(&xadir->d_inode->i_mutex, I_MUTEX_XATTR); err = xattr_unlink(xadir->d_inode, dentry); + mutex_unlock(&xadir->d_inode->i_mutex); update_ctime(inode); } dput(dentry); out_dput: - mutex_unlock(&xadir->d_inode->i_mutex); dput(xadir); return err; } @@ -841,7 +843,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size) if (!dentry->d_inode) return -EINVAL; - if (!dentry->d_sb->s_xattr || + if (!reiserfs_xattrs(dentry->d_sb) || get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1) return -EOPNOTSUPP; @@ -904,22 +906,19 @@ static int create_privroot(struct dentry *dentry) { int err; struct inode *inode = dentry->d_parent->d_inode; - WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex)); - + mutex_lock_nested(&inode->i_mutex, I_MUTEX_XATTR); err = xattr_mkdir(inode, dentry, 0700); - if (err || !dentry->d_inode) { - reiserfs_warning(dentry->d_sb, "jdm-20006", - "xattrs/ACLs enabled and couldn't " - "find/create .reiserfs_priv. " - "Failing mount."); - return -EOPNOTSUPP; + mutex_unlock(&inode->i_mutex); + if (err) { + dput(dentry); + dentry = NULL; } - dentry->d_inode->i_flags |= S_PRIVATE; - reiserfs_info(dentry->d_sb, "Created %s - reserved for xattr " - "storage.\n", PRIVROOT_NAME); + if (dentry && dentry->d_inode) + reiserfs_info(dentry->d_sb, "Created %s - reserved for xattr " + "storage.\n", PRIVROOT_NAME); - return 0; + return err; } static int xattr_mount_check(struct super_block *s) @@ -951,9 +950,11 @@ static int xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name) { struct dentry *priv_root = REISERFS_SB(dentry->d_sb)->priv_root; - if (container_of(q1, struct dentry, d_name) == priv_root) + if (name->len == priv_root->d_name.len && + name->hash == priv_root->d_name.hash && + !memcmp(name->name, priv_root->d_name.name, name->len)) { return -ENOENT; - if (q1->len == name->len && + } else if (q1->len == name->len && !memcmp(q1->name, name->name, name->len)) return 0; return 1; @@ -963,61 +964,60 @@ static const struct dentry_operations xattr_lookup_poison_ops = { .d_compare = xattr_lookup_poison, }; -int reiserfs_lookup_privroot(struct super_block *s) -{ - struct dentry *dentry; - int err = 0; - - /* If we don't have the privroot located yet - go find it */ - mutex_lock(&s->s_root->d_inode->i_mutex); - dentry = lookup_one_len(PRIVROOT_NAME, s->s_root, - strlen(PRIVROOT_NAME)); - if (!IS_ERR(dentry)) { - REISERFS_SB(s)->priv_root = dentry; - s->s_root->d_op = &xattr_lookup_poison_ops; - if (dentry->d_inode) - dentry->d_inode->i_flags |= S_PRIVATE; - } else - err = PTR_ERR(dentry); - mutex_unlock(&s->s_root->d_inode->i_mutex); - - return err; -} - /* We need to take a copy of the mount flags since things like * MS_RDONLY don't get set until *after* we're called. * mount_flags != mount_options */ int reiserfs_xattr_init(struct super_block *s, int mount_flags) { int err = 0; - struct dentry *privroot = REISERFS_SB(s)->priv_root; #ifdef CONFIG_REISERFS_FS_XATTR err = xattr_mount_check(s); if (err) goto error; +#endif - if (!privroot->d_inode && !(mount_flags & MS_RDONLY)) { - mutex_lock(&s->s_root->d_inode->i_mutex); - err = create_privroot(REISERFS_SB(s)->priv_root); - mutex_unlock(&s->s_root->d_inode->i_mutex); - } + /* If we don't have the privroot located yet - go find it */ + if (!REISERFS_SB(s)->priv_root) { + struct dentry *dentry; + dentry = lookup_one_len(PRIVROOT_NAME, s->s_root, + strlen(PRIVROOT_NAME)); + if (!IS_ERR(dentry)) { +#ifdef CONFIG_REISERFS_FS_XATTR + if (!(mount_flags & MS_RDONLY) && !dentry->d_inode) + err = create_privroot(dentry); +#endif + if (!dentry->d_inode) { + dput(dentry); + dentry = NULL; + } + } else + err = PTR_ERR(dentry); - if (privroot->d_inode) { - s->s_xattr = reiserfs_xattr_handlers; - mutex_lock(&privroot->d_inode->i_mutex); - if (!REISERFS_SB(s)->xattr_root) { - struct dentry *dentry; - dentry = lookup_one_len(XAROOT_NAME, privroot, - strlen(XAROOT_NAME)); - if (!IS_ERR(dentry)) - REISERFS_SB(s)->xattr_root = dentry; - else - err = PTR_ERR(dentry); + if (!err && dentry) { + s->s_root->d_op = &xattr_lookup_poison_ops; + dentry->d_inode->i_flags |= S_PRIVATE; + REISERFS_SB(s)->priv_root = dentry; +#ifdef CONFIG_REISERFS_FS_XATTR + /* xattrs are unavailable */ + } else if (!(mount_flags & MS_RDONLY)) { + /* If we're read-only it just means that the dir + * hasn't been created. Not an error -- just no + * xattrs on the fs. We'll check again if we + * go read-write */ + reiserfs_warning(s, "jdm-20006", + "xattrs/ACLs enabled and couldn't " + "find/create .reiserfs_priv. " + "Failing mount."); + err = -EOPNOTSUPP; +#endif } - mutex_unlock(&privroot->d_inode->i_mutex); } +#ifdef CONFIG_REISERFS_FS_XATTR + if (!err) + s->s_xattr = reiserfs_xattr_handlers; + error: if (err) { clear_bit(REISERFS_XATTRS_USER, &(REISERFS_SB(s)->s_mount_opt)); @@ -1026,12 +1026,11 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) #endif /* The super_block MS_POSIXACL must mirror the (no)acl mount option. */ + s->s_flags = s->s_flags & ~MS_POSIXACL; #ifdef CONFIG_REISERFS_FS_POSIX_ACL if (reiserfs_posixacl(s)) s->s_flags |= MS_POSIXACL; - else #endif - s->s_flags &= ~MS_POSIXACL; return err; } diff --git a/trunk/fs/reiserfs/xattr_security.c b/trunk/fs/reiserfs/xattr_security.c index a92c8792c0f6..4d3c20e787c3 100644 --- a/trunk/fs/reiserfs/xattr_security.c +++ b/trunk/fs/reiserfs/xattr_security.c @@ -55,16 +55,8 @@ int reiserfs_security_init(struct inode *dir, struct inode *inode, struct reiserfs_security_handle *sec) { int blocks = 0; - int error; - - sec->name = NULL; - - /* Don't add selinux attributes on xattrs - they'll never get used */ - if (IS_PRIVATE(dir)) - return 0; - - error = security_inode_init_security(inode, dir, &sec->name, - &sec->value, &sec->length); + int error = security_inode_init_security(inode, dir, &sec->name, + &sec->value, &sec->length); if (error) { if (error == -EOPNOTSUPP) error = 0; diff --git a/trunk/fs/romfs/super.c b/trunk/fs/romfs/super.c index 4ab3c03d8f95..c53b5ef8a02f 100644 --- a/trunk/fs/romfs/super.c +++ b/trunk/fs/romfs/super.c @@ -298,8 +298,7 @@ static struct inode *romfs_iget(struct super_block *sb, unsigned long pos) struct romfs_inode ri; struct inode *i; unsigned long nlen; - unsigned nextfh; - int ret; + unsigned nextfh, ret; umode_t mode; /* we might have to traverse a chain of "hard link" file entries to get diff --git a/trunk/fs/super.c b/trunk/fs/super.c index 1943fdf655fa..786fe7d72790 100644 --- a/trunk/fs/super.c +++ b/trunk/fs/super.c @@ -207,34 +207,6 @@ void deactivate_super(struct super_block *s) EXPORT_SYMBOL(deactivate_super); -/** - * deactivate_locked_super - drop an active reference to superblock - * @s: superblock to deactivate - * - * Equivalent of up_write(&s->s_umount); deactivate_super(s);, except that - * it does not unlock it until it's all over. As the result, it's safe to - * use to dispose of new superblock on ->get_sb() failure exits - nobody - * will see the sucker until it's all over. Equivalent using up_write + - * deactivate_super is safe for that purpose only if superblock is either - * safe to use or has NULL ->s_root when we unlock. - */ -void deactivate_locked_super(struct super_block *s) -{ - struct file_system_type *fs = s->s_type; - if (atomic_dec_and_lock(&s->s_active, &sb_lock)) { - s->s_count -= S_BIAS-1; - spin_unlock(&sb_lock); - vfs_dq_off(s, 0); - fs->kill_sb(s); - put_filesystem(fs); - put_super(s); - } else { - up_write(&s->s_umount); - } -} - -EXPORT_SYMBOL(deactivate_locked_super); - /** * grab_super - acquire an active reference * @s: reference we are trying to make active @@ -825,7 +797,8 @@ int get_sb_ns(struct file_system_type *fs_type, int flags, void *data, sb->s_flags = flags; err = fill_super(sb, data, flags & MS_SILENT ? 1 : 0); if (err) { - deactivate_locked_super(sb); + up_write(&sb->s_umount); + deactivate_super(sb); return err; } @@ -881,7 +854,8 @@ int get_sb_bdev(struct file_system_type *fs_type, if (s->s_root) { if ((flags ^ s->s_flags) & MS_RDONLY) { - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); error = -EBUSY; goto error_bdev; } @@ -896,7 +870,8 @@ int get_sb_bdev(struct file_system_type *fs_type, sb_set_blocksize(s, block_size(bdev)); error = fill_super(s, data, flags & MS_SILENT ? 1 : 0); if (error) { - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); goto error; } @@ -922,7 +897,7 @@ void kill_block_super(struct super_block *sb) struct block_device *bdev = sb->s_bdev; fmode_t mode = sb->s_mode; - bdev->bd_super = NULL; + bdev->bd_super = 0; generic_shutdown_super(sb); sync_blockdev(bdev); close_bdev_exclusive(bdev, mode); @@ -946,7 +921,8 @@ int get_sb_nodev(struct file_system_type *fs_type, error = fill_super(s, data, flags & MS_SILENT ? 1 : 0); if (error) { - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); return error; } s->s_flags |= MS_ACTIVE; @@ -976,7 +952,8 @@ int get_sb_single(struct file_system_type *fs_type, s->s_flags = flags; error = fill_super(s, data, flags & MS_SILENT ? 1 : 0); if (error) { - deactivate_locked_super(s); + up_write(&s->s_umount); + deactivate_super(s); return error; } s->s_flags |= MS_ACTIVE; @@ -1029,7 +1006,8 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void return mnt; out_sb: dput(mnt->mnt_root); - deactivate_locked_super(mnt->mnt_sb); + up_write(&mnt->mnt_sb->s_umount); + deactivate_super(mnt->mnt_sb); out_free_secdata: free_secdata(secdata); out_mnt: diff --git a/trunk/fs/ubifs/super.c b/trunk/fs/ubifs/super.c index e9f7a754c4f7..faa44f90608a 100644 --- a/trunk/fs/ubifs/super.c +++ b/trunk/fs/ubifs/super.c @@ -2055,7 +2055,8 @@ static int ubifs_get_sb(struct file_system_type *fs_type, int flags, return 0; out_deact: - deactivate_locked_super(sb); + up_write(&sb->s_umount); + deactivate_super(sb); out_close: ubi_close_volume(ubi); return err; diff --git a/trunk/fs/ufs/dir.c b/trunk/fs/ufs/dir.c index 6321b797061b..dbbbc4668769 100644 --- a/trunk/fs/ufs/dir.c +++ b/trunk/fs/ufs/dir.c @@ -666,6 +666,6 @@ int ufs_empty_dir(struct inode * inode) const struct file_operations ufs_dir_operations = { .read = generic_read_dir, .readdir = ufs_readdir, - .fsync = ufs_sync_file, + .fsync = file_fsync, .llseek = generic_file_llseek, }; diff --git a/trunk/fs/ufs/file.c b/trunk/fs/ufs/file.c index 2bd3a1615714..625ef17c6f83 100644 --- a/trunk/fs/ufs/file.c +++ b/trunk/fs/ufs/file.c @@ -30,7 +30,7 @@ #include "ufs.h" -int ufs_sync_file(struct file *file, struct dentry *dentry, int datasync) +static int ufs_sync_file(struct file *file, struct dentry *dentry, int datasync) { struct inode *inode = dentry->d_inode; int err; diff --git a/trunk/fs/ufs/ufs.h b/trunk/fs/ufs/ufs.h index d0c4acd4f1f3..69b3427d7885 100644 --- a/trunk/fs/ufs/ufs.h +++ b/trunk/fs/ufs/ufs.h @@ -98,8 +98,8 @@ extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, /* file.c */ extern const struct inode_operations ufs_file_inode_operations; extern const struct file_operations ufs_file_operations; + extern const struct address_space_operations ufs_aops; -extern int ufs_sync_file(struct file *, struct dentry *, int); /* ialloc.c */ extern void ufs_free_inode (struct inode *inode); diff --git a/trunk/include/linux/Kbuild b/trunk/include/linux/Kbuild index 3f0eaa397ef5..ca9b9b9bd331 100644 --- a/trunk/include/linux/Kbuild +++ b/trunk/include/linux/Kbuild @@ -138,7 +138,6 @@ header-y += qnxtypes.h header-y += radeonfb.h header-y += raw.h header-y += resource.h -header-y += romfs_fs.h header-y += rose.h header-y += serial_reg.h header-y += smbno.h @@ -315,6 +314,7 @@ unifdef-y += irqnr.h unifdef-y += reboot.h unifdef-y += reiserfs_fs.h unifdef-y += reiserfs_xattr.h +unifdef-y += romfs_fs.h unifdef-y += route.h unifdef-y += rtc.h unifdef-y += rtnetlink.h diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index 3b534e527e09..5bed436f4353 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -1775,7 +1775,6 @@ void kill_block_super(struct super_block *sb); void kill_anon_super(struct super_block *sb); void kill_litter_super(struct super_block *sb); void deactivate_super(struct super_block *sb); -void deactivate_locked_super(struct super_block *sb); int set_anon_super(struct super_block *s, void *data); struct super_block *sget(struct file_system_type *type, int (*test)(struct super_block *,void *), @@ -2118,7 +2117,7 @@ extern struct file *create_write_pipe(int flags); extern void free_write_pipe(struct file *); extern struct file *do_filp_open(int dfd, const char *pathname, - int open_flag, int mode, int acc_mode); + int open_flag, int mode); extern int may_open(struct path *, int, int); extern int kernel_read(struct file *, unsigned long, char *, unsigned long); @@ -2368,7 +2367,6 @@ extern void file_update_time(struct file *file); extern int generic_show_options(struct seq_file *m, struct vfsmount *mnt); extern void save_mount_options(struct super_block *sb, char *options); -extern void replace_mount_options(struct super_block *sb, char *options); static inline ino_t parent_ino(struct dentry *dentry) { diff --git a/trunk/include/linux/namei.h b/trunk/include/linux/namei.h index 518098fe63af..fc2e03579877 100644 --- a/trunk/include/linux/namei.h +++ b/trunk/include/linux/namei.h @@ -69,6 +69,7 @@ extern int path_lookup(const char *, unsigned, struct nameidata *); extern int vfs_path_lookup(struct dentry *, struct vfsmount *, const char *, unsigned int, struct nameidata *); +extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags); extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, int (*open)(struct inode *, struct file *)); extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); diff --git a/trunk/include/linux/netfilter/xt_LED.h b/trunk/include/linux/netfilter/xt_LED.h index f5509e7524d3..4c91a0d770d0 100644 --- a/trunk/include/linux/netfilter/xt_LED.h +++ b/trunk/include/linux/netfilter/xt_LED.h @@ -1,8 +1,6 @@ #ifndef _XT_LED_H #define _XT_LED_H -#include - struct xt_led_info { char id[27]; /* Unique ID for this trigger in the LED class */ __u8 always_blink; /* Blink even if the LED is already on */ diff --git a/trunk/include/linux/netfilter/xt_cluster.h b/trunk/include/linux/netfilter/xt_cluster.h index 886682656f09..5e0a0d07b526 100644 --- a/trunk/include/linux/netfilter/xt_cluster.h +++ b/trunk/include/linux/netfilter/xt_cluster.h @@ -12,6 +12,4 @@ struct xt_cluster_match_info { u_int32_t flags; }; -#define XT_CLUSTER_NODES_MAX 32 - #endif /* _XT_CLUSTER_MATCH_H */ diff --git a/trunk/include/linux/reiserfs_fs_sb.h b/trunk/include/linux/reiserfs_fs_sb.h index 6473650c28f1..6b361d23a499 100644 --- a/trunk/include/linux/reiserfs_fs_sb.h +++ b/trunk/include/linux/reiserfs_fs_sb.h @@ -402,7 +402,7 @@ struct reiserfs_sb_info { int reserved_blocks; /* amount of blocks reserved for further allocations */ spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */ struct dentry *priv_root; /* root of /.reiserfs_priv */ - struct dentry *xattr_root; /* root of /.reiserfs_priv/xattrs */ + struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ int j_errno; #ifdef CONFIG_QUOTA char *s_qf_names[MAXQUOTAS]; @@ -488,6 +488,7 @@ enum reiserfs_mount_options { #define reiserfs_data_log(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_LOG)) #define reiserfs_data_ordered(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_ORDERED)) #define reiserfs_data_writeback(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_WRITEBACK)) +#define reiserfs_xattrs(s) ((s)->s_xattr != NULL) #define reiserfs_xattrs_user(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS_USER)) #define reiserfs_posixacl(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_POSIXACL)) #define reiserfs_xattrs_optional(s) (reiserfs_xattrs_user(s) || reiserfs_posixacl(s)) diff --git a/trunk/include/linux/reiserfs_xattr.h b/trunk/include/linux/reiserfs_xattr.h index cdedc01036e4..dcae01e63e40 100644 --- a/trunk/include/linux/reiserfs_xattr.h +++ b/trunk/include/linux/reiserfs_xattr.h @@ -38,7 +38,6 @@ struct nameidata; int reiserfs_xattr_register_handlers(void) __init; void reiserfs_xattr_unregister_handlers(void); int reiserfs_xattr_init(struct super_block *sb, int mount_flags); -int reiserfs_lookup_privroot(struct super_block *sb); int reiserfs_delete_xattrs(struct inode *inode); int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); @@ -98,7 +97,7 @@ static inline size_t reiserfs_xattr_jcreate_nblocks(struct inode *inode) if ((REISERFS_I(inode)->i_flags & i_has_xattr_dir) == 0) { nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb); - if (!REISERFS_SB(inode->i_sb)->xattr_root->d_inode) + if (REISERFS_SB(inode->i_sb)->xattr_root == NULL) nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb); } diff --git a/trunk/include/linux/romfs_fs.h b/trunk/include/linux/romfs_fs.h index c490fbc43fe2..e20bbf9eb365 100644 --- a/trunk/include/linux/romfs_fs.h +++ b/trunk/include/linux/romfs_fs.h @@ -53,4 +53,9 @@ struct romfs_inode { #define ROMFH_PAD (ROMFH_SIZE-1) #define ROMFH_MASK (~ROMFH_PAD) +#ifdef __KERNEL__ + +/* Not much now */ + +#endif /* __KERNEL__ */ #endif diff --git a/trunk/include/sound/version.h b/trunk/include/sound/version.h index 456f1359e1c0..a7e74e23ad2e 100644 --- a/trunk/include/sound/version.h +++ b/trunk/include/sound/version.h @@ -1,3 +1,3 @@ /* include/version.h */ -#define CONFIG_SND_VERSION "1.0.20" +#define CONFIG_SND_VERSION "1.0.19" #define CONFIG_SND_DATE "" diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index a7267bfd3765..382109b5baeb 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -1133,7 +1133,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type, free_cg_links: free_cg_links(&tmp_cg_links); drop_new_super: - deactivate_locked_super(sb); + up_write(&sb->s_umount); + deactivate_super(sb); return ret; } diff --git a/trunk/net/Kconfig b/trunk/net/Kconfig index c19f549c8e74..ce77db4fcec8 100644 --- a/trunk/net/Kconfig +++ b/trunk/net/Kconfig @@ -119,6 +119,12 @@ menuconfig NETFILTER under "iptables" for the location of these packages. + Make sure to say N to "Fast switching" below if you intend to say Y + here, as Fast switching currently bypasses netfilter. + + Chances are that you should say Y here if you compile a kernel which + will run as a router and N for regular hosts. If unsure, say N. + if NETFILTER config NETFILTER_DEBUG diff --git a/trunk/net/bluetooth/hci_sysfs.c b/trunk/net/bluetooth/hci_sysfs.c index a05d45eb3ba1..582d8877078c 100644 --- a/trunk/net/bluetooth/hci_sysfs.c +++ b/trunk/net/bluetooth/hci_sysfs.c @@ -88,13 +88,10 @@ static struct device_type bt_link = { static void add_conn(struct work_struct *work) { struct hci_conn *conn = container_of(work, struct hci_conn, work_add); - struct hci_dev *hdev = conn->hdev; /* ensure previous del is complete */ flush_work(&conn->work_del); - dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); - if (device_add(&conn->dev) < 0) { BT_ERR("Failed to register connection device"); return; @@ -157,8 +154,12 @@ void hci_conn_init_sysfs(struct hci_conn *conn) void hci_conn_add_sysfs(struct hci_conn *conn) { + struct hci_dev *hdev = conn->hdev; + BT_DBG("conn %p", conn); + dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); + queue_work(bt_workq, &conn->work_add); } diff --git a/trunk/net/core/skbuff.c b/trunk/net/core/skbuff.c index d152394b2611..f091a5a845c1 100644 --- a/trunk/net/core/skbuff.c +++ b/trunk/net/core/skbuff.c @@ -502,9 +502,7 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size) shinfo->gso_segs = 0; shinfo->gso_type = 0; shinfo->ip6_frag_id = 0; - shinfo->tx_flags.flags = 0; shinfo->frag_list = NULL; - memset(&shinfo->hwtstamps, 0, sizeof(shinfo->hwtstamps)); memset(skb, 0, offsetof(struct sk_buff, tail)); skb->data = skb->head + NET_SKB_PAD; diff --git a/trunk/net/ipv4/Kconfig b/trunk/net/ipv4/Kconfig index 9d26a3da37e5..b2cf91e4ccaa 100644 --- a/trunk/net/ipv4/Kconfig +++ b/trunk/net/ipv4/Kconfig @@ -407,7 +407,7 @@ config INET_XFRM_MODE_BEET If unsure, say Y. config INET_LRO - bool "Large Receive Offload (ipv4/tcp)" + tristate "Large Receive Offload (ipv4/tcp)" ---help--- Support for Large Receive Offload (ipv4/tcp). diff --git a/trunk/net/ipv6/netfilter/ip6t_ipv6header.c b/trunk/net/ipv6/netfilter/ip6t_ipv6header.c index 91490ad9302c..14e6724d5672 100644 --- a/trunk/net/ipv6/netfilter/ip6t_ipv6header.c +++ b/trunk/net/ipv6/netfilter/ip6t_ipv6header.c @@ -50,14 +50,14 @@ ipv6header_mt6(const struct sk_buff *skb, const struct xt_match_param *par) struct ipv6_opt_hdr _hdr; int hdrlen; + /* Is there enough space for the next ext header? */ + if (len < (int)sizeof(struct ipv6_opt_hdr)) + return false; /* No more exthdr -> evaluate */ if (nexthdr == NEXTHDR_NONE) { temp |= MASK_NONE; break; } - /* Is there enough space for the next ext header? */ - if (len < (int)sizeof(struct ipv6_opt_hdr)) - return false; /* ESP -> evaluate */ if (nexthdr == NEXTHDR_ESP) { temp |= MASK_ESP; diff --git a/trunk/net/mac80211/rc80211_minstrel.c b/trunk/net/mac80211/rc80211_minstrel.c index 70df3dcc3cf6..3824990d340b 100644 --- a/trunk/net/mac80211/rc80211_minstrel.c +++ b/trunk/net/mac80211/rc80211_minstrel.c @@ -476,7 +476,7 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp) return NULL; for (i = 0; i < IEEE80211_NUM_BANDS; i++) { - sband = hw->wiphy->bands[i]; + sband = hw->wiphy->bands[hw->conf.channel->band]; if (sband->n_bitrates > max_rates) max_rates = sband->n_bitrates; } diff --git a/trunk/net/mac80211/rc80211_pid_algo.c b/trunk/net/mac80211/rc80211_pid_algo.c index 01d59a8e334c..b16801cde06f 100644 --- a/trunk/net/mac80211/rc80211_pid_algo.c +++ b/trunk/net/mac80211/rc80211_pid_algo.c @@ -317,44 +317,13 @@ rate_control_pid_rate_init(void *priv, struct ieee80211_supported_band *sband, struct ieee80211_sta *sta, void *priv_sta) { struct rc_pid_sta_info *spinfo = priv_sta; - struct rc_pid_info *pinfo = priv; - struct rc_pid_rateinfo *rinfo = pinfo->rinfo; struct sta_info *si; - int i, j, tmp; - bool s; /* TODO: This routine should consider using RSSI from previous packets * as we need to have IEEE 802.1X auth succeed immediately after assoc.. * Until that method is implemented, we will use the lowest supported * rate as a workaround. */ - /* Sort the rates. This is optimized for the most common case (i.e. - * almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed - * mapping too. */ - for (i = 0; i < sband->n_bitrates; i++) { - rinfo[i].index = i; - rinfo[i].rev_index = i; - if (RC_PID_FAST_START) - rinfo[i].diff = 0; - else - rinfo[i].diff = i * pinfo->norm_offset; - } - for (i = 1; i < sband->n_bitrates; i++) { - s = 0; - for (j = 0; j < sband->n_bitrates - i; j++) - if (unlikely(sband->bitrates[rinfo[j].index].bitrate > - sband->bitrates[rinfo[j + 1].index].bitrate)) { - tmp = rinfo[j].index; - rinfo[j].index = rinfo[j + 1].index; - rinfo[j + 1].index = tmp; - rinfo[rinfo[j].index].rev_index = j; - rinfo[rinfo[j + 1].index].rev_index = j + 1; - s = 1; - } - if (!s) - break; - } - spinfo->txrate_idx = rate_lowest_index(sband, sta); /* HACK */ si = container_of(sta, struct sta_info, sta); @@ -367,22 +336,21 @@ static void *rate_control_pid_alloc(struct ieee80211_hw *hw, struct rc_pid_info *pinfo; struct rc_pid_rateinfo *rinfo; struct ieee80211_supported_band *sband; - int i, max_rates = 0; + int i, j, tmp; + bool s; #ifdef CONFIG_MAC80211_DEBUGFS struct rc_pid_debugfs_entries *de; #endif + sband = hw->wiphy->bands[hw->conf.channel->band]; + pinfo = kmalloc(sizeof(*pinfo), GFP_ATOMIC); if (!pinfo) return NULL; - for (i = 0; i < IEEE80211_NUM_BANDS; i++) { - sband = hw->wiphy->bands[i]; - if (sband->n_bitrates > max_rates) - max_rates = sband->n_bitrates; - } - - rinfo = kmalloc(sizeof(*rinfo) * max_rates, GFP_ATOMIC); + /* We can safely assume that sband won't change unless we get + * reinitialized. */ + rinfo = kmalloc(sizeof(*rinfo) * sband->n_bitrates, GFP_ATOMIC); if (!rinfo) { kfree(pinfo); return NULL; @@ -400,6 +368,33 @@ static void *rate_control_pid_alloc(struct ieee80211_hw *hw, pinfo->rinfo = rinfo; pinfo->oldrate = 0; + /* Sort the rates. This is optimized for the most common case (i.e. + * almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed + * mapping too. */ + for (i = 0; i < sband->n_bitrates; i++) { + rinfo[i].index = i; + rinfo[i].rev_index = i; + if (RC_PID_FAST_START) + rinfo[i].diff = 0; + else + rinfo[i].diff = i * pinfo->norm_offset; + } + for (i = 1; i < sband->n_bitrates; i++) { + s = 0; + for (j = 0; j < sband->n_bitrates - i; j++) + if (unlikely(sband->bitrates[rinfo[j].index].bitrate > + sband->bitrates[rinfo[j + 1].index].bitrate)) { + tmp = rinfo[j].index; + rinfo[j].index = rinfo[j + 1].index; + rinfo[j + 1].index = tmp; + rinfo[rinfo[j].index].rev_index = j; + rinfo[rinfo[j + 1].index].rev_index = j + 1; + s = 1; + } + if (!s) + break; + } + #ifdef CONFIG_MAC80211_DEBUGFS de = &pinfo->dentries; de->target = debugfs_create_u32("target_pf", S_IRUSR | S_IWUSR, diff --git a/trunk/net/mac80211/tx.c b/trunk/net/mac80211/tx.c index 63656266d567..3fb04a86444d 100644 --- a/trunk/net/mac80211/tx.c +++ b/trunk/net/mac80211/tx.c @@ -772,7 +772,7 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) hdrlen = ieee80211_hdrlen(hdr->frame_control); /* internal error, why is TX_FRAGMENTED set? */ - if (WARN_ON(skb->len + FCS_LEN <= frag_threshold)) + if (WARN_ON(skb->len <= frag_threshold)) return TX_DROP; /* diff --git a/trunk/net/netfilter/ipvs/ip_vs_conn.c b/trunk/net/netfilter/ipvs/ip_vs_conn.c index 77bfdfeb966e..60aba45023ff 100644 --- a/trunk/net/netfilter/ipvs/ip_vs_conn.c +++ b/trunk/net/netfilter/ipvs/ip_vs_conn.c @@ -260,10 +260,7 @@ struct ip_vs_conn *ip_vs_ct_in_get list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { if (cp->af == af && ip_vs_addr_equal(af, s_addr, &cp->caddr) && - /* protocol should only be IPPROTO_IP if - * d_addr is a fwmark */ - ip_vs_addr_equal(protocol == IPPROTO_IP ? AF_UNSPEC : af, - d_addr, &cp->vaddr) && + ip_vs_addr_equal(af, d_addr, &cp->vaddr) && s_port == cp->cport && d_port == cp->vport && cp->flags & IP_VS_CONN_F_TEMPLATE && protocol == cp->protocol) { @@ -701,9 +698,7 @@ ip_vs_conn_new(int af, int proto, const union nf_inet_addr *caddr, __be16 cport, cp->cport = cport; ip_vs_addr_copy(af, &cp->vaddr, vaddr); cp->vport = vport; - /* proto should only be IPPROTO_IP if d_addr is a fwmark */ - ip_vs_addr_copy(proto == IPPROTO_IP ? AF_UNSPEC : af, - &cp->daddr, daddr); + ip_vs_addr_copy(af, &cp->daddr, daddr); cp->dport = dport; cp->flags = flags; spin_lock_init(&cp->lock); diff --git a/trunk/net/netfilter/ipvs/ip_vs_core.c b/trunk/net/netfilter/ipvs/ip_vs_core.c index 8dddb17a947a..cb3e031335eb 100644 --- a/trunk/net/netfilter/ipvs/ip_vs_core.c +++ b/trunk/net/netfilter/ipvs/ip_vs_core.c @@ -278,7 +278,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc, */ if (svc->fwmark) { union nf_inet_addr fwmark = { - .ip = htonl(svc->fwmark) + .all = { 0, 0, 0, htonl(svc->fwmark) } }; ct = ip_vs_ct_in_get(svc->af, IPPROTO_IP, &snet, 0, @@ -306,7 +306,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc, */ if (svc->fwmark) { union nf_inet_addr fwmark = { - .ip = htonl(svc->fwmark) + .all = { 0, 0, 0, htonl(svc->fwmark) } }; ct = ip_vs_conn_new(svc->af, IPPROTO_IP, diff --git a/trunk/net/netfilter/nf_conntrack_netlink.c b/trunk/net/netfilter/nf_conntrack_netlink.c index c523f0b8cee5..f13fc57e1ecb 100644 --- a/trunk/net/netfilter/nf_conntrack_netlink.c +++ b/trunk/net/netfilter/nf_conntrack_netlink.c @@ -1186,6 +1186,28 @@ ctnetlink_change_conntrack(struct nf_conn *ct, struct nlattr *cda[]) return 0; } +static inline void +ctnetlink_event_report(struct nf_conn *ct, u32 pid, int report) +{ + unsigned int events = 0; + + if (test_bit(IPS_EXPECTED_BIT, &ct->status)) + events |= IPCT_RELATED; + else + events |= IPCT_NEW; + + nf_conntrack_event_report(IPCT_STATUS | + IPCT_HELPER | + IPCT_REFRESH | + IPCT_PROTOINFO | + IPCT_NATSEQADJ | + IPCT_MARK | + events, + ct, + pid, + report); +} + static struct nf_conn * ctnetlink_create_conntrack(struct nlattr *cda[], struct nf_conntrack_tuple *otuple, @@ -1351,7 +1373,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, err = -ENOENT; if (nlh->nlmsg_flags & NLM_F_CREATE) { struct nf_conn *ct; - enum ip_conntrack_events events; ct = ctnetlink_create_conntrack(cda, &otuple, &rtuple, u3); @@ -1362,18 +1383,9 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, err = 0; nf_conntrack_get(&ct->ct_general); spin_unlock_bh(&nf_conntrack_lock); - if (test_bit(IPS_EXPECTED_BIT, &ct->status)) - events = IPCT_RELATED; - else - events = IPCT_NEW; - - nf_conntrack_event_report(IPCT_STATUS | - IPCT_HELPER | - IPCT_PROTOINFO | - IPCT_NATSEQADJ | - IPCT_MARK | events, - ct, NETLINK_CB(skb).pid, - nlmsg_report(nlh)); + ctnetlink_event_report(ct, + NETLINK_CB(skb).pid, + nlmsg_report(nlh)); nf_ct_put(ct); } else spin_unlock_bh(&nf_conntrack_lock); @@ -1392,13 +1404,9 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, if (err == 0) { nf_conntrack_get(&ct->ct_general); spin_unlock_bh(&nf_conntrack_lock); - nf_conntrack_event_report(IPCT_STATUS | - IPCT_HELPER | - IPCT_PROTOINFO | - IPCT_NATSEQADJ | - IPCT_MARK, - ct, NETLINK_CB(skb).pid, - nlmsg_report(nlh)); + ctnetlink_event_report(ct, + NETLINK_CB(skb).pid, + nlmsg_report(nlh)); nf_ct_put(ct); } else spin_unlock_bh(&nf_conntrack_lock); diff --git a/trunk/net/netfilter/xt_cluster.c b/trunk/net/netfilter/xt_cluster.c index 69a639f35403..6c4847662b85 100644 --- a/trunk/net/netfilter/xt_cluster.c +++ b/trunk/net/netfilter/xt_cluster.c @@ -135,13 +135,7 @@ static bool xt_cluster_mt_checkentry(const struct xt_mtchk_param *par) { struct xt_cluster_match_info *info = par->matchinfo; - if (info->total_nodes > XT_CLUSTER_NODES_MAX) { - printk(KERN_ERR "xt_cluster: you have exceeded the maximum " - "number of cluster nodes (%u > %u)\n", - info->total_nodes, XT_CLUSTER_NODES_MAX); - return false; - } - if (info->node_mask >= (1ULL << info->total_nodes)) { + if (info->node_mask >= (1 << info->total_nodes)) { printk(KERN_ERR "xt_cluster: this node mask cannot be " "higher than the total number of nodes\n"); return false; diff --git a/trunk/net/sched/sch_fifo.c b/trunk/net/sched/sch_fifo.c index 69188e8358b4..92cfc9d7e3b9 100644 --- a/trunk/net/sched/sch_fifo.c +++ b/trunk/net/sched/sch_fifo.c @@ -51,7 +51,7 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt) u32 limit = qdisc_dev(sch)->tx_queue_len ? : 1; if (sch->ops == &bfifo_qdisc_ops) - limit *= psched_mtu(qdisc_dev(sch)); + limit *= qdisc_dev(sch)->mtu; q->limit = limit; } else { diff --git a/trunk/net/wimax/op-msg.c b/trunk/net/wimax/op-msg.c index 9ad4d893a566..5d149c1b5f0d 100644 --- a/trunk/net/wimax/op-msg.c +++ b/trunk/net/wimax/op-msg.c @@ -149,8 +149,7 @@ struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev, } result = nla_put(skb, WIMAX_GNL_MSG_DATA, size, msg); if (result < 0) { - dev_err(dev, "no memory to add payload (msg %p size %zu) in " - "attribute: %d\n", msg, size, result); + dev_err(dev, "no memory to add payload in attribute\n"); goto error_nla_put; } genlmsg_end(skb, genl_msg); @@ -300,10 +299,10 @@ int wimax_msg(struct wimax_dev *wimax_dev, const char *pipe_name, struct sk_buff *skb; skb = wimax_msg_alloc(wimax_dev, pipe_name, buf, size, gfp_flags); - if (IS_ERR(skb)) - result = PTR_ERR(skb); - else - result = wimax_msg_send(wimax_dev, skb); + if (skb == NULL) + goto error_msg_new; + result = wimax_msg_send(wimax_dev, skb); +error_msg_new: return result; } EXPORT_SYMBOL_GPL(wimax_msg); diff --git a/trunk/net/wimax/stack.c b/trunk/net/wimax/stack.c index 933e1422b09f..a0ee76b52510 100644 --- a/trunk/net/wimax/stack.c +++ b/trunk/net/wimax/stack.c @@ -338,21 +338,8 @@ void __wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state) */ void wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state) { - /* - * A driver cannot take the wimax_dev out of the - * __WIMAX_ST_NULL state unless by calling wimax_dev_add(). If - * the wimax_dev's state is still NULL, we ignore any request - * to change its state because it means it hasn't been yet - * registered. - * - * There is no need to complain about it, as routines that - * call this might be shared from different code paths that - * are called before or after wimax_dev_add() has done its - * job. - */ mutex_lock(&wimax_dev->mutex); - if (wimax_dev->state > __WIMAX_ST_NULL) - __wimax_state_change(wimax_dev, new_state); + __wimax_state_change(wimax_dev, new_state); mutex_unlock(&wimax_dev->mutex); return; } @@ -389,7 +376,7 @@ EXPORT_SYMBOL_GPL(wimax_state_get); void wimax_dev_init(struct wimax_dev *wimax_dev) { INIT_LIST_HEAD(&wimax_dev->id_table_node); - __wimax_state_set(wimax_dev, __WIMAX_ST_NULL); + __wimax_state_set(wimax_dev, WIMAX_ST_UNINITIALIZED); mutex_init(&wimax_dev->mutex); mutex_init(&wimax_dev->mutex_reset); } diff --git a/trunk/net/wireless/reg.c b/trunk/net/wireless/reg.c index 08265ca15785..6c1993d99902 100644 --- a/trunk/net/wireless/reg.c +++ b/trunk/net/wireless/reg.c @@ -907,7 +907,6 @@ EXPORT_SYMBOL(freq_reg_info); int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, const struct ieee80211_reg_rule **reg_rule) { - assert_cfg80211_lock(); return freq_reg_info_regd(wiphy, center_freq, bandwidth, reg_rule, NULL); } @@ -1134,8 +1133,7 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) if (is_world_regdom(cfg80211_regdomain->alpha2) || (wiphy->regd && is_world_regdom(wiphy->regd->alpha2))) return true; - if (last_request && - last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && + if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && wiphy->custom_regulatory) return true; return false; @@ -1144,12 +1142,6 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) /* Reap the advantages of previously found beacons */ static void reg_process_beacons(struct wiphy *wiphy) { - /* - * Means we are just firing up cfg80211, so no beacons would - * have been processed yet. - */ - if (!last_request) - return; if (!reg_is_world_roaming(wiphy)) return; wiphy_update_beacon_reg(wiphy); @@ -1184,8 +1176,6 @@ static void handle_channel_custom(struct wiphy *wiphy, struct ieee80211_supported_band *sband; struct ieee80211_channel *chan; - assert_cfg80211_lock(); - sband = wiphy->bands[band]; BUG_ON(chan_idx >= sband->n_channels); chan = &sband->channels[chan_idx]; @@ -1224,13 +1214,10 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy, const struct ieee80211_regdomain *regd) { enum ieee80211_band band; - - mutex_lock(&cfg80211_mutex); for (band = 0; band < IEEE80211_NUM_BANDS; band++) { if (wiphy->bands[band]) handle_band_custom(wiphy, band, regd); } - mutex_unlock(&cfg80211_mutex); } EXPORT_SYMBOL(wiphy_apply_custom_regulatory); @@ -1436,7 +1423,7 @@ static int __regulatory_hint(struct wiphy *wiphy, return call_crda(last_request->alpha2); } -/* This processes *all* regulatory hints */ +/* This currently only processes user and driver regulatory hints */ static void reg_process_hint(struct regulatory_request *reg_request) { int r = 0; diff --git a/trunk/net/wireless/scan.c b/trunk/net/wireless/scan.c index 1f260c40b6ca..2ae65b39b529 100644 --- a/trunk/net/wireless/scan.c +++ b/trunk/net/wireless/scan.c @@ -395,7 +395,6 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, memcpy(ies, res->pub.information_elements, ielen); found->ies_allocated = true; found->pub.information_elements = ies; - found->pub.len_information_elements = ielen; } } } diff --git a/trunk/security/tomoyo/common.c b/trunk/security/tomoyo/common.c index ddfb9cccf468..d4d41b3efc7c 100644 --- a/trunk/security/tomoyo/common.c +++ b/trunk/security/tomoyo/common.c @@ -1720,14 +1720,14 @@ static bool tomoyo_policy_loader_exists(void) * policies are not loaded yet. * Thus, let do_execve() call this function everytime. */ - struct path path; + struct nameidata nd; - if (kern_path(tomoyo_loader, LOOKUP_FOLLOW, &path)) { + if (path_lookup(tomoyo_loader, LOOKUP_FOLLOW, &nd)) { printk(KERN_INFO "Not activating Mandatory Access Control now " "since %s doesn't exist.\n", tomoyo_loader); return false; } - path_put(&path); + path_put(&nd.path); return true; } diff --git a/trunk/security/tomoyo/realpath.c b/trunk/security/tomoyo/realpath.c index 40927a84cb6e..bf8e2b451687 100644 --- a/trunk/security/tomoyo/realpath.c +++ b/trunk/security/tomoyo/realpath.c @@ -165,11 +165,11 @@ char *tomoyo_realpath_from_path(struct path *path) */ char *tomoyo_realpath(const char *pathname) { - struct path path; + struct nameidata nd; - if (pathname && kern_path(pathname, LOOKUP_FOLLOW, &path) == 0) { - char *buf = tomoyo_realpath_from_path(&path); - path_put(&path); + if (pathname && path_lookup(pathname, LOOKUP_FOLLOW, &nd) == 0) { + char *buf = tomoyo_realpath_from_path(&nd.path); + path_put(&nd.path); return buf; } return NULL; @@ -184,11 +184,11 @@ char *tomoyo_realpath(const char *pathname) */ char *tomoyo_realpath_nofollow(const char *pathname) { - struct path path; + struct nameidata nd; - if (pathname && kern_path(pathname, 0, &path) == 0) { - char *buf = tomoyo_realpath_from_path(&path); - path_put(&path); + if (pathname && path_lookup(pathname, 0, &nd) == 0) { + char *buf = tomoyo_realpath_from_path(&nd.path); + path_put(&nd.path); return buf; } return NULL; diff --git a/trunk/sound/drivers/serial-u16550.c b/trunk/sound/drivers/serial-u16550.c index a25fb7b1f441..b2b6d50c9425 100644 --- a/trunk/sound/drivers/serial-u16550.c +++ b/trunk/sound/drivers/serial-u16550.c @@ -963,11 +963,16 @@ static int __devinit snd_serial_probe(struct platform_device *devptr) if (err < 0) goto _err; - sprintf(card->longname, "%s [%s] at %#lx, irq %d", + sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d", card->shortname, - adaptor_names[uart->adaptor], uart->base, - uart->irq); + uart->irq, + uart->speed, + (int)uart->divisor, + outs[dev], + ins[dev], + adaptor_names[uart->adaptor], + uart->drop_on_full); snd_card_set_dev(card, &devptr->dev); diff --git a/trunk/sound/pci/hda/patch_sigmatel.c b/trunk/sound/pci/hda/patch_sigmatel.c index 03b3646018a1..917bc5d3ac2c 100644 --- a/trunk/sound/pci/hda/patch_sigmatel.c +++ b/trunk/sound/pci/hda/patch_sigmatel.c @@ -4079,12 +4079,7 @@ static int stac92xx_init(struct hda_codec *codec) pinctl = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0); /* if PINCTL already set then skip */ - /* Also, if both INPUT and OUTPUT are set, - * it must be a BIOS bug; need to override, too - */ - if (!(pinctl & AC_PINCTL_IN_EN) || - (pinctl & AC_PINCTL_OUT_EN)) { - pinctl &= ~AC_PINCTL_OUT_EN; + if (!(pinctl & AC_PINCTL_IN_EN)) { pinctl |= AC_PINCTL_IN_EN; stac92xx_auto_set_pinctl(codec, nid, pinctl); diff --git a/trunk/sound/pci/via82xx.c b/trunk/sound/pci/via82xx.c index 1ef58c51c213..809b233dd4a3 100644 --- a/trunk/sound/pci/via82xx.c +++ b/trunk/sound/pci/via82xx.c @@ -1687,7 +1687,7 @@ static int snd_via8233_pcmdxs_volume_put(struct snd_kcontrol *kcontrol, return change; } -static const DECLARE_TLV_DB_SCALE(db_scale_dxs, -4650, 150, 1); +static const DECLARE_TLV_DB_SCALE(db_scale_dxs, -9450, 150, 1); static struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control __devinitdata = { .name = "PCM Playback Volume", diff --git a/trunk/sound/soc/codecs/wm8990.c b/trunk/sound/soc/codecs/wm8990.c index 40cd274eb1ef..c518c3e5aa3f 100644 --- a/trunk/sound/soc/codecs/wm8990.c +++ b/trunk/sound/soc/codecs/wm8990.c @@ -729,7 +729,7 @@ SND_SOC_DAPM_MIXER_E("INMIXL", WM8990_INTDRIVBITS, WM8990_INMIXL_PWR_BIT, 0, inmixer_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), /* AINLMUX */ -SND_SOC_DAPM_MUX_E("AINLMUX", WM8990_INTDRIVBITS, WM8990_AINLMUX_PWR_BIT, 0, +SND_SOC_DAPM_MUX_E("AILNMUX", WM8990_INTDRIVBITS, WM8990_AINLMUX_PWR_BIT, 0, &wm8990_dapm_ainlmux_controls, inmixer_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), @@ -740,7 +740,7 @@ SND_SOC_DAPM_MIXER_E("INMIXR", WM8990_INTDRIVBITS, WM8990_INMIXR_PWR_BIT, 0, inmixer_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), /* AINRMUX */ -SND_SOC_DAPM_MUX_E("AINRMUX", WM8990_INTDRIVBITS, WM8990_AINRMUX_PWR_BIT, 0, +SND_SOC_DAPM_MUX_E("AIRNMUX", WM8990_INTDRIVBITS, WM8990_AINRMUX_PWR_BIT, 0, &wm8990_dapm_ainrmux_controls, inmixer_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), @@ -848,40 +848,40 @@ static const struct snd_soc_dapm_route audio_map[] = { {"LIN12 PGA", "LIN2 Switch", "LIN2"}, /* LIN34 PGA */ {"LIN34 PGA", "LIN3 Switch", "LIN3"}, - {"LIN34 PGA", "LIN4 Switch", "LIN4/RXN"}, + {"LIN34 PGA", "LIN4 Switch", "LIN4"}, /* INMIXL */ {"INMIXL", "Record Left Volume", "LOMIX"}, {"INMIXL", "LIN2 Volume", "LIN2"}, {"INMIXL", "LINPGA12 Switch", "LIN12 PGA"}, {"INMIXL", "LINPGA34 Switch", "LIN34 PGA"}, - /* AINLMUX */ - {"AINLMUX", "INMIXL Mix", "INMIXL"}, - {"AINLMUX", "DIFFINL Mix", "LIN12 PGA"}, - {"AINLMUX", "DIFFINL Mix", "LIN34 PGA"}, - {"AINLMUX", "RXVOICE Mix", "LIN4/RXN"}, - {"AINLMUX", "RXVOICE Mix", "RIN4/RXP"}, + /* AILNMUX */ + {"AILNMUX", "INMIXL Mix", "INMIXL"}, + {"AILNMUX", "DIFFINL Mix", "LIN12PGA"}, + {"AILNMUX", "DIFFINL Mix", "LIN34PGA"}, + {"AILNMUX", "RXVOICE Mix", "LIN4/RXN"}, + {"AILNMUX", "RXVOICE Mix", "RIN4/RXP"}, /* ADC */ - {"Left ADC", NULL, "AINLMUX"}, + {"Left ADC", NULL, "AILNMUX"}, /* RIN12 PGA */ {"RIN12 PGA", "RIN1 Switch", "RIN1"}, {"RIN12 PGA", "RIN2 Switch", "RIN2"}, /* RIN34 PGA */ {"RIN34 PGA", "RIN3 Switch", "RIN3"}, - {"RIN34 PGA", "RIN4 Switch", "RIN4/RXP"}, + {"RIN34 PGA", "RIN4 Switch", "RIN4"}, /* INMIXL */ {"INMIXR", "Record Right Volume", "ROMIX"}, {"INMIXR", "RIN2 Volume", "RIN2"}, {"INMIXR", "RINPGA12 Switch", "RIN12 PGA"}, {"INMIXR", "RINPGA34 Switch", "RIN34 PGA"}, - /* AINRMUX */ - {"AINRMUX", "INMIXR Mix", "INMIXR"}, - {"AINRMUX", "DIFFINR Mix", "RIN12 PGA"}, - {"AINRMUX", "DIFFINR Mix", "RIN34 PGA"}, - {"AINRMUX", "RXVOICE Mix", "LIN4/RXN"}, - {"AINRMUX", "RXVOICE Mix", "RIN4/RXP"}, + /* AIRNMUX */ + {"AIRNMUX", "INMIXR Mix", "INMIXR"}, + {"AIRNMUX", "DIFFINR Mix", "RIN12PGA"}, + {"AIRNMUX", "DIFFINR Mix", "RIN34PGA"}, + {"AIRNMUX", "RXVOICE Mix", "RIN4/RXN"}, + {"AIRNMUX", "RXVOICE Mix", "RIN4/RXP"}, /* ADC */ - {"Right ADC", NULL, "AINRMUX"}, + {"Right ADC", NULL, "AIRNMUX"}, /* LOMIX */ {"LOMIX", "LOMIX RIN3 Bypass Switch", "RIN3"}, @@ -922,7 +922,7 @@ static const struct snd_soc_dapm_route audio_map[] = { {"LOPMIX", "LOPMIX Left Mixer PGA Switch", "LOPGA"}, /* OUT3MIX */ - {"OUT3MIX", "OUT3MIX LIN4/RXP Bypass Switch", "LIN4/RXN"}, + {"OUT3MIX", "OUT3MIX LIN4/RXP Bypass Switch", "LIN4/RXP"}, {"OUT3MIX", "OUT3MIX Left Out PGA Switch", "LOPGA"}, /* OUT4MIX */ @@ -949,7 +949,7 @@ static const struct snd_soc_dapm_route audio_map[] = { /* Output Pins */ {"LON", NULL, "LONMIX"}, {"LOP", NULL, "LOPMIX"}, - {"OUT3", NULL, "OUT3MIX"}, + {"OUT", NULL, "OUT3MIX"}, {"LOUT", NULL, "LOUT PGA"}, {"SPKN", NULL, "SPKMIX"}, {"ROUT", NULL, "ROUT PGA"},