diff --git a/[refs] b/[refs] index 95f29a970704..0a6dfeffdf36 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 099e657625e801adf82054c8050dde5aceb68452 +refs/heads/master: 4f6b434fee2402b3decdeae9d16eb648725ae426 diff --git a/trunk/drivers/rtc/Kconfig b/trunk/drivers/rtc/Kconfig index 165a81843357..123092d8a984 100644 --- a/trunk/drivers/rtc/Kconfig +++ b/trunk/drivers/rtc/Kconfig @@ -102,13 +102,9 @@ config RTC_INTF_DEV_UIE_EMUL depends on RTC_INTF_DEV help Provides an emulation for RTC_UIE if the underlying rtc chip - driver does not expose RTC_UIE ioctls. Those requests generate + driver does not expose RTC_UIE ioctls. Those requests generate once-per-second update interrupts, used for synchronization. - The emulation code will read the time from the hardware - clock several times per second, please enable this option - only if you know that you really need it. - config RTC_DRV_TEST tristate "Test driver/device" help diff --git a/trunk/drivers/rtc/interface.c b/trunk/drivers/rtc/interface.c index fd2c652504ff..a04c1b6b1575 100644 --- a/trunk/drivers/rtc/interface.c +++ b/trunk/drivers/rtc/interface.c @@ -307,60 +307,6 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) } EXPORT_SYMBOL_GPL(rtc_set_alarm); -int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled) -{ - int err = mutex_lock_interruptible(&rtc->ops_lock); - if (err) - return err; - - if (!rtc->ops) - err = -ENODEV; - else if (!rtc->ops->alarm_irq_enable) - err = -EINVAL; - else - err = rtc->ops->alarm_irq_enable(rtc->dev.parent, enabled); - - mutex_unlock(&rtc->ops_lock); - return err; -} -EXPORT_SYMBOL_GPL(rtc_alarm_irq_enable); - -int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled) -{ - int err = mutex_lock_interruptible(&rtc->ops_lock); - if (err) - return err; - -#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL - if (enabled == 0 && rtc->uie_irq_active) { - mutex_unlock(&rtc->ops_lock); - return rtc_dev_update_irq_enable_emul(rtc, enabled); - } -#endif - - if (!rtc->ops) - err = -ENODEV; - else if (!rtc->ops->update_irq_enable) - err = -EINVAL; - else - err = rtc->ops->update_irq_enable(rtc->dev.parent, enabled); - - mutex_unlock(&rtc->ops_lock); - -#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL - /* - * Enable emulation if the driver did not provide - * the update_irq_enable function pointer or if returned - * -EINVAL to signal that it has been configured without - * interrupts or that are not available at the moment. - */ - if (err == -EINVAL) - err = rtc_dev_update_irq_enable_emul(rtc, enabled); -#endif - return err; -} -EXPORT_SYMBOL_GPL(rtc_update_irq_enable); - /** * rtc_update_irq - report RTC periodic, alarm, and/or update irqs * @rtc: the rtc device diff --git a/trunk/drivers/rtc/rtc-dev.c b/trunk/drivers/rtc/rtc-dev.c index 45152f4952d6..ecdea44ae4e5 100644 --- a/trunk/drivers/rtc/rtc-dev.c +++ b/trunk/drivers/rtc/rtc-dev.c @@ -92,10 +92,10 @@ static void rtc_uie_timer(unsigned long data) spin_unlock_irqrestore(&rtc->irq_lock, flags); } -static int clear_uie(struct rtc_device *rtc) +static void clear_uie(struct rtc_device *rtc) { spin_lock_irq(&rtc->irq_lock); - if (rtc->uie_irq_active) { + if (rtc->irq_active) { rtc->stop_uie_polling = 1; if (rtc->uie_timer_active) { spin_unlock_irq(&rtc->irq_lock); @@ -108,10 +108,9 @@ static int clear_uie(struct rtc_device *rtc) flush_scheduled_work(); spin_lock_irq(&rtc->irq_lock); } - rtc->uie_irq_active = 0; + rtc->irq_active = 0; } spin_unlock_irq(&rtc->irq_lock); - return 0; } static int set_uie(struct rtc_device *rtc) @@ -123,8 +122,8 @@ static int set_uie(struct rtc_device *rtc) if (err) return err; spin_lock_irq(&rtc->irq_lock); - if (!rtc->uie_irq_active) { - rtc->uie_irq_active = 1; + if (!rtc->irq_active) { + rtc->irq_active = 1; rtc->stop_uie_polling = 0; rtc->oldsecs = tm.tm_sec; rtc->uie_task_active = 1; @@ -135,16 +134,6 @@ static int set_uie(struct rtc_device *rtc) spin_unlock_irq(&rtc->irq_lock); return 0; } - -int rtc_dev_update_irq_enable_emul(struct rtc_device *rtc, unsigned int enabled) -{ - if (enabled) - return set_uie(rtc); - else - return clear_uie(rtc); -} -EXPORT_SYMBOL(rtc_dev_update_irq_enable_emul); - #endif /* CONFIG_RTC_INTF_DEV_UIE_EMUL */ static ssize_t @@ -368,22 +357,6 @@ static long rtc_dev_ioctl(struct file *file, err = rtc_irq_set_state(rtc, NULL, 0); break; - case RTC_AIE_ON: - mutex_unlock(&rtc->ops_lock); - return rtc_alarm_irq_enable(rtc, 1); - - case RTC_AIE_OFF: - mutex_unlock(&rtc->ops_lock); - return rtc_alarm_irq_enable(rtc, 0); - - case RTC_UIE_ON: - mutex_unlock(&rtc->ops_lock); - return rtc_update_irq_enable(rtc, 1); - - case RTC_UIE_OFF: - mutex_unlock(&rtc->ops_lock); - return rtc_update_irq_enable(rtc, 0); - case RTC_IRQP_SET: err = rtc_irq_set_freq(rtc, NULL, arg); break; @@ -428,6 +401,17 @@ static long rtc_dev_ioctl(struct file *file, err = -EFAULT; return err; +#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL + case RTC_UIE_OFF: + mutex_unlock(&rtc->ops_lock); + clear_uie(rtc); + return 0; + + case RTC_UIE_ON: + mutex_unlock(&rtc->ops_lock); + err = set_uie(rtc); + return err; +#endif default: err = -ENOTTY; break; @@ -456,10 +440,7 @@ static int rtc_dev_release(struct inode *inode, struct file *file) * Leave the alarm alone; it may be set to trigger a system wakeup * later, or be used by kernel code, and is a one-shot event anyway. */ - - /* Keep ioctl until all drivers are converted */ rtc_dev_ioctl(file, RTC_UIE_OFF, 0); - rtc_update_irq_enable(rtc, 0); rtc_irq_set_state(rtc, NULL, 0); if (rtc->ops->release) diff --git a/trunk/drivers/video/via/viafbdev.c b/trunk/drivers/video/via/viafbdev.c index e21fe5b6f9ff..73ac754ad801 100644 --- a/trunk/drivers/video/via/viafbdev.c +++ b/trunk/drivers/video/via/viafbdev.c @@ -546,25 +546,23 @@ static int viafb_blank(int blank_mode, struct fb_info *info) static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) { - union { - struct viafb_ioctl_mode viamode; - struct viafb_ioctl_samm viasamm; - struct viafb_driver_version driver_version; - struct fb_var_screeninfo sec_var; - struct _panel_size_pos_info panel_pos_size_para; - struct viafb_ioctl_setting viafb_setting; - struct device_t active_dev; - } u; + struct viafb_ioctl_mode viamode; + struct viafb_ioctl_samm viasamm; + struct viafb_driver_version driver_version; + struct fb_var_screeninfo sec_var; + struct _panel_size_pos_info panel_pos_size_para; u32 state_info = 0; + u32 viainfo_size = sizeof(struct viafb_ioctl_info); u32 *viafb_gamma_table; char driver_name[] = "viafb"; u32 __user *argp = (u32 __user *) arg; u32 gpu32; u32 video_dev_info = 0; + struct viafb_ioctl_setting viafb_setting = {}; + struct device_t active_dev = {}; DEBUG_MSG(KERN_INFO "viafb_ioctl: 0x%X !!\n", cmd); - memset(&u, 0, sizeof(u)); switch (cmd) { case VIAFB_GET_CHIP_INFO: @@ -573,7 +571,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) return -EFAULT; break; case VIAFB_GET_INFO_SIZE: - return put_user((u32)sizeof(struct viafb_ioctl_info), argp); + return put_user(viainfo_size, argp); case VIAFB_GET_INFO: return viafb_ioctl_get_viafb_info(arg); case VIAFB_HOTPLUG: @@ -586,60 +584,60 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) viafb_hotplug = (gpu32) ? 1 : 0; break; case VIAFB_GET_RESOLUTION: - u.viamode.xres = (u32) viafb_hotplug_Xres; - u.viamode.yres = (u32) viafb_hotplug_Yres; - u.viamode.refresh = (u32) viafb_hotplug_refresh; - u.viamode.bpp = (u32) viafb_hotplug_bpp; + viamode.xres = (u32) viafb_hotplug_Xres; + viamode.yres = (u32) viafb_hotplug_Yres; + viamode.refresh = (u32) viafb_hotplug_refresh; + viamode.bpp = (u32) viafb_hotplug_bpp; if (viafb_SAMM_ON == 1) { - u.viamode.xres_sec = viafb_second_xres; - u.viamode.yres_sec = viafb_second_yres; - u.viamode.virtual_xres_sec = viafb_second_virtual_xres; - u.viamode.virtual_yres_sec = viafb_second_virtual_yres; - u.viamode.refresh_sec = viafb_refresh1; - u.viamode.bpp_sec = viafb_bpp1; + viamode.xres_sec = viafb_second_xres; + viamode.yres_sec = viafb_second_yres; + viamode.virtual_xres_sec = viafb_second_virtual_xres; + viamode.virtual_yres_sec = viafb_second_virtual_yres; + viamode.refresh_sec = viafb_refresh1; + viamode.bpp_sec = viafb_bpp1; } else { - u.viamode.xres_sec = 0; - u.viamode.yres_sec = 0; - u.viamode.virtual_xres_sec = 0; - u.viamode.virtual_yres_sec = 0; - u.viamode.refresh_sec = 0; - u.viamode.bpp_sec = 0; + viamode.xres_sec = 0; + viamode.yres_sec = 0; + viamode.virtual_xres_sec = 0; + viamode.virtual_yres_sec = 0; + viamode.refresh_sec = 0; + viamode.bpp_sec = 0; } - if (copy_to_user(argp, &u.viamode, sizeof(u.viamode))) + if (copy_to_user(argp, &viamode, sizeof(viamode))) return -EFAULT; break; case VIAFB_GET_SAMM_INFO: - u.viasamm.samm_status = viafb_SAMM_ON; + viasamm.samm_status = viafb_SAMM_ON; if (viafb_SAMM_ON == 1) { if (viafb_dual_fb) { - u.viasamm.size_prim = viaparinfo->fbmem_free; - u.viasamm.size_sec = viaparinfo1->fbmem_free; + viasamm.size_prim = viaparinfo->fbmem_free; + viasamm.size_sec = viaparinfo1->fbmem_free; } else { if (viafb_second_size) { - u.viasamm.size_prim = + viasamm.size_prim = viaparinfo->fbmem_free - viafb_second_size * 1024 * 1024; - u.viasamm.size_sec = + viasamm.size_sec = viafb_second_size * 1024 * 1024; } else { - u.viasamm.size_prim = + viasamm.size_prim = viaparinfo->fbmem_free >> 1; - u.viasamm.size_sec = + viasamm.size_sec = (viaparinfo->fbmem_free >> 1); } } - u.viasamm.mem_base = viaparinfo->fbmem; - u.viasamm.offset_sec = viafb_second_offset; + viasamm.mem_base = viaparinfo->fbmem; + viasamm.offset_sec = viafb_second_offset; } else { - u.viasamm.size_prim = + viasamm.size_prim = viaparinfo->memsize - viaparinfo->fbmem_used; - u.viasamm.size_sec = 0; - u.viasamm.mem_base = viaparinfo->fbmem; - u.viasamm.offset_sec = 0; + viasamm.size_sec = 0; + viasamm.mem_base = viaparinfo->fbmem; + viasamm.offset_sec = 0; } - if (copy_to_user(argp, &u.viasamm, sizeof(u.viasamm))) + if (copy_to_user(argp, &viasamm, sizeof(viasamm))) return -EFAULT; break; @@ -664,75 +662,74 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) viafb_lcd_disable(); break; case VIAFB_SET_DEVICE: - if (copy_from_user(&u.active_dev, (void *)argp, - sizeof(u.active_dev))) + if (copy_from_user(&active_dev, (void *)argp, + sizeof(active_dev))) return -EFAULT; - viafb_set_device(u.active_dev); + viafb_set_device(active_dev); viafb_set_par(info); break; case VIAFB_GET_DEVICE: - u.active_dev.crt = viafb_CRT_ON; - u.active_dev.dvi = viafb_DVI_ON; - u.active_dev.lcd = viafb_LCD_ON; - u.active_dev.samm = viafb_SAMM_ON; - u.active_dev.primary_dev = viafb_primary_dev; + active_dev.crt = viafb_CRT_ON; + active_dev.dvi = viafb_DVI_ON; + active_dev.lcd = viafb_LCD_ON; + active_dev.samm = viafb_SAMM_ON; + active_dev.primary_dev = viafb_primary_dev; - u.active_dev.lcd_dsp_cent = viafb_lcd_dsp_method; - u.active_dev.lcd_panel_id = viafb_lcd_panel_id; - u.active_dev.lcd_mode = viafb_lcd_mode; + active_dev.lcd_dsp_cent = viafb_lcd_dsp_method; + active_dev.lcd_panel_id = viafb_lcd_panel_id; + active_dev.lcd_mode = viafb_lcd_mode; - u.active_dev.xres = viafb_hotplug_Xres; - u.active_dev.yres = viafb_hotplug_Yres; + active_dev.xres = viafb_hotplug_Xres; + active_dev.yres = viafb_hotplug_Yres; - u.active_dev.xres1 = viafb_second_xres; - u.active_dev.yres1 = viafb_second_yres; + active_dev.xres1 = viafb_second_xres; + active_dev.yres1 = viafb_second_yres; - u.active_dev.bpp = viafb_bpp; - u.active_dev.bpp1 = viafb_bpp1; - u.active_dev.refresh = viafb_refresh; - u.active_dev.refresh1 = viafb_refresh1; + active_dev.bpp = viafb_bpp; + active_dev.bpp1 = viafb_bpp1; + active_dev.refresh = viafb_refresh; + active_dev.refresh1 = viafb_refresh1; - u.active_dev.epia_dvi = viafb_platform_epia_dvi; - u.active_dev.lcd_dual_edge = viafb_device_lcd_dualedge; - u.active_dev.bus_width = viafb_bus_width; + active_dev.epia_dvi = viafb_platform_epia_dvi; + active_dev.lcd_dual_edge = viafb_device_lcd_dualedge; + active_dev.bus_width = viafb_bus_width; - if (copy_to_user(argp, &u.active_dev, sizeof(u.active_dev))) + if (copy_to_user(argp, &active_dev, sizeof(active_dev))) return -EFAULT; break; case VIAFB_GET_DRIVER_VERSION: - u.driver_version.iMajorNum = VERSION_MAJOR; - u.driver_version.iKernelNum = VERSION_KERNEL; - u.driver_version.iOSNum = VERSION_OS; - u.driver_version.iMinorNum = VERSION_MINOR; + driver_version.iMajorNum = VERSION_MAJOR; + driver_version.iKernelNum = VERSION_KERNEL; + driver_version.iOSNum = VERSION_OS; + driver_version.iMinorNum = VERSION_MINOR; - if (copy_to_user(argp, &u.driver_version, - sizeof(u.driver_version))) + if (copy_to_user(argp, &driver_version, + sizeof(driver_version))) return -EFAULT; break; case VIAFB_SET_DEVICE_INFO: - if (copy_from_user(&u.viafb_setting, - argp, sizeof(u.viafb_setting))) + if (copy_from_user(&viafb_setting, + argp, sizeof(viafb_setting))) return -EFAULT; - if (apply_device_setting(u.viafb_setting, info) < 0) + if (apply_device_setting(viafb_setting, info) < 0) return -EINVAL; break; case VIAFB_SET_SECOND_MODE: - if (copy_from_user(&u.sec_var, argp, sizeof(u.sec_var))) + if (copy_from_user(&sec_var, argp, sizeof(sec_var))) return -EFAULT; - apply_second_mode_setting(&u.sec_var); + apply_second_mode_setting(&sec_var); break; case VIAFB_GET_DEVICE_INFO: - retrieve_device_setting(&u.viafb_setting); + retrieve_device_setting(&viafb_setting); - if (copy_to_user(argp, &u.viafb_setting, - sizeof(u.viafb_setting))) + if (copy_to_user(argp, &viafb_setting, sizeof(viafb_setting))) return -EFAULT; break; @@ -809,51 +806,51 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) break; case VIAFB_GET_PANEL_MAX_SIZE: - if (copy_from_user(&u.panel_pos_size_para, argp, - sizeof(u.panel_pos_size_para))) + if (copy_from_user + (&panel_pos_size_para, argp, sizeof(panel_pos_size_para))) return -EFAULT; - u.panel_pos_size_para.x = u.panel_pos_size_para.y = 0; - if (copy_to_user(argp, &u.panel_pos_size_para, - sizeof(u.panel_pos_size_para))) + panel_pos_size_para.x = panel_pos_size_para.y = 0; + if (copy_to_user(argp, &panel_pos_size_para, + sizeof(panel_pos_size_para))) return -EFAULT; break; case VIAFB_GET_PANEL_MAX_POSITION: - if (copy_from_user(&u.panel_pos_size_para, argp, - sizeof(u.panel_pos_size_para))) + if (copy_from_user + (&panel_pos_size_para, argp, sizeof(panel_pos_size_para))) return -EFAULT; - u.panel_pos_size_para.x = u.panel_pos_size_para.y = 0; - if (copy_to_user(argp, &u.panel_pos_size_para, - sizeof(u.panel_pos_size_para))) + panel_pos_size_para.x = panel_pos_size_para.y = 0; + if (copy_to_user(argp, &panel_pos_size_para, + sizeof(panel_pos_size_para))) return -EFAULT; break; case VIAFB_GET_PANEL_POSITION: - if (copy_from_user(&u.panel_pos_size_para, argp, - sizeof(u.panel_pos_size_para))) + if (copy_from_user + (&panel_pos_size_para, argp, sizeof(panel_pos_size_para))) return -EFAULT; - u.panel_pos_size_para.x = u.panel_pos_size_para.y = 0; - if (copy_to_user(argp, &u.panel_pos_size_para, - sizeof(u.panel_pos_size_para))) + panel_pos_size_para.x = panel_pos_size_para.y = 0; + if (copy_to_user(argp, &panel_pos_size_para, + sizeof(panel_pos_size_para))) return -EFAULT; break; case VIAFB_GET_PANEL_SIZE: - if (copy_from_user(&u.panel_pos_size_para, argp, - sizeof(u.panel_pos_size_para))) + if (copy_from_user + (&panel_pos_size_para, argp, sizeof(panel_pos_size_para))) return -EFAULT; - u.panel_pos_size_para.x = u.panel_pos_size_para.y = 0; - if (copy_to_user(argp, &u.panel_pos_size_para, - sizeof(u.panel_pos_size_para))) + panel_pos_size_para.x = panel_pos_size_para.y = 0; + if (copy_to_user(argp, &panel_pos_size_para, + sizeof(panel_pos_size_para))) return -EFAULT; break; case VIAFB_SET_PANEL_POSITION: - if (copy_from_user(&u.panel_pos_size_para, argp, - sizeof(u.panel_pos_size_para))) + if (copy_from_user + (&panel_pos_size_para, argp, sizeof(panel_pos_size_para))) return -EFAULT; break; case VIAFB_SET_PANEL_SIZE: - if (copy_from_user(&u.panel_pos_size_para, argp, - sizeof(u.panel_pos_size_para))) + if (copy_from_user + (&panel_pos_size_para, argp, sizeof(panel_pos_size_para))) return -EFAULT; break; @@ -1055,8 +1052,10 @@ static void viafb_imageblit(struct fb_info *info, static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) { + u8 data[CURSOR_SIZE / 8]; + u32 data_bak[CURSOR_SIZE / 32]; u32 temp, xx, yy, bg_col = 0, fg_col = 0; - int i, j = 0; + int size, i, j = 0; static int hw_cursor; struct viafb_par *p_viafb_par; @@ -1179,29 +1178,22 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) } if (cursor->set & FB_CUR_SETSHAPE) { - struct { - u8 data[CURSOR_SIZE / 8]; - u32 bak[CURSOR_SIZE / 32]; - } *cr_data = kzalloc(sizeof(*cr_data), GFP_ATOMIC); - int size = + size = ((viacursor.image.width + 7) >> 3) * viacursor.image.height; - if (cr_data == NULL) - goto out; - if (MAX_CURS == 32) { for (i = 0; i < (CURSOR_SIZE / 32); i++) { - cr_data->bak[i] = 0x0; - cr_data->bak[i + 1] = 0xFFFFFFFF; + data_bak[i] = 0x0; + data_bak[i + 1] = 0xFFFFFFFF; i += 1; } } else if (MAX_CURS == 64) { for (i = 0; i < (CURSOR_SIZE / 32); i++) { - cr_data->bak[i] = 0x0; - cr_data->bak[i + 1] = 0x0; - cr_data->bak[i + 2] = 0xFFFFFFFF; - cr_data->bak[i + 3] = 0xFFFFFFFF; + data_bak[i] = 0x0; + data_bak[i + 1] = 0x0; + data_bak[i + 2] = 0xFFFFFFFF; + data_bak[i + 3] = 0xFFFFFFFF; i += 3; } } @@ -1209,12 +1201,12 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) switch (viacursor.rop) { case ROP_XOR: for (i = 0; i < size; i++) - cr_data->data[i] = viacursor.mask[i]; + data[i] = viacursor.mask[i]; break; case ROP_COPY: for (i = 0; i < size; i++) - cr_data->data[i] = viacursor.mask[i]; + data[i] = viacursor.mask[i]; break; default: break; @@ -1222,25 +1214,23 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) if (MAX_CURS == 32) { for (i = 0; i < size; i++) { - cr_data->bak[j] = (u32) cr_data->data[i]; - cr_data->bak[j + 1] = ~cr_data->bak[j]; + data_bak[j] = (u32) data[i]; + data_bak[j + 1] = ~data_bak[j]; j += 2; } } else if (MAX_CURS == 64) { for (i = 0; i < size; i++) { - cr_data->bak[j] = (u32) cr_data->data[i]; - cr_data->bak[j + 1] = 0x0; - cr_data->bak[j + 2] = ~cr_data->bak[j]; - cr_data->bak[j + 3] = ~cr_data->bak[j + 1]; + data_bak[j] = (u32) data[i]; + data_bak[j + 1] = 0x0; + data_bak[j + 2] = ~data_bak[j]; + data_bak[j + 3] = ~data_bak[j + 1]; j += 4; } } memcpy(((struct viafb_par *)(info->par))->fbmem_virt + ((struct viafb_par *)(info->par))->cursor_start, - cr_data->bak, CURSOR_SIZE); -out: - kfree(cr_data); + data_bak, CURSOR_SIZE); } if (viacursor.enable) diff --git a/trunk/fs/affs/file.c b/trunk/fs/affs/file.c index 9246cb4aa018..1377b1240b6e 100644 --- a/trunk/fs/affs/file.c +++ b/trunk/fs/affs/file.c @@ -628,7 +628,7 @@ static int affs_write_begin_ofs(struct file *file, struct address_space *mapping } index = pos >> PAGE_CACHE_SHIFT; - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) return -ENOMEM; *pagep = page; diff --git a/trunk/fs/afs/write.c b/trunk/fs/afs/write.c index 3fb36d433621..d6b85dab35fc 100644 --- a/trunk/fs/afs/write.c +++ b/trunk/fs/afs/write.c @@ -144,7 +144,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping, candidate->state = AFS_WBACK_PENDING; init_waitqueue_head(&candidate->waitq); - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) { kfree(candidate); return -ENOMEM; diff --git a/trunk/fs/buffer.c b/trunk/fs/buffer.c index a13f09b696f7..776ae091d3b0 100644 --- a/trunk/fs/buffer.c +++ b/trunk/fs/buffer.c @@ -1996,7 +1996,7 @@ int block_write_begin(struct file *file, struct address_space *mapping, page = *pagep; if (page == NULL) { ownpage = 1; - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) { status = -ENOMEM; goto out; @@ -2502,7 +2502,7 @@ int nobh_write_begin(struct file *file, struct address_space *mapping, from = pos & (PAGE_CACHE_SIZE - 1); to = from + len; - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) return -ENOMEM; *pagep = page; diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index 12bb656fbe75..b1e1fc6a6e6a 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -2074,7 +2074,7 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping, cFYI(1, ("write_begin from %lld len %d", (long long)pos, len)); - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) { rc = -ENOMEM; goto out; diff --git a/trunk/fs/ecryptfs/mmap.c b/trunk/fs/ecryptfs/mmap.c index 46cec2b69796..04d7b3fa1ac6 100644 --- a/trunk/fs/ecryptfs/mmap.c +++ b/trunk/fs/ecryptfs/mmap.c @@ -288,7 +288,7 @@ static int ecryptfs_write_begin(struct file *file, loff_t prev_page_end_size; int rc = 0; - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) return -ENOMEM; *pagep = page; diff --git a/trunk/fs/ext3/inode.c b/trunk/fs/ext3/inode.c index 5fa453b49a64..c4bdccf976b5 100644 --- a/trunk/fs/ext3/inode.c +++ b/trunk/fs/ext3/inode.c @@ -1161,7 +1161,7 @@ static int ext3_write_begin(struct file *file, struct address_space *mapping, to = from + len; retry: - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) return -ENOMEM; *pagep = page; diff --git a/trunk/fs/ext3/namei.c b/trunk/fs/ext3/namei.c index 1dd2abe6313e..297ea8dfac7c 100644 --- a/trunk/fs/ext3/namei.c +++ b/trunk/fs/ext3/namei.c @@ -2175,7 +2175,8 @@ static int ext3_symlink (struct inode * dir, * We have a transaction open. All is sweetness. It also sets * i_size in generic_commit_write(). */ - err = __page_symlink(inode, symname, l, 1); + err = __page_symlink(inode, symname, l, + mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); if (err) { drop_nlink(inode); unlock_new_inode(inode); diff --git a/trunk/fs/ext4/ext4_sb.h b/trunk/fs/ext4/ext4_sb.h index b21f16713db0..445fde603df8 100644 --- a/trunk/fs/ext4/ext4_sb.h +++ b/trunk/fs/ext4/ext4_sb.h @@ -146,10 +146,4 @@ struct ext4_sb_info { struct flex_groups *s_flex_groups; }; -static inline spinlock_t * -sb_bgl_lock(struct ext4_sb_info *sbi, unsigned int block_group) -{ - return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); -} - #endif /* _EXT4_SB */ diff --git a/trunk/fs/ext4/inode.c b/trunk/fs/ext4/inode.c index 6702a49992a6..7c3325e0b005 100644 --- a/trunk/fs/ext4/inode.c +++ b/trunk/fs/ext4/inode.c @@ -1346,7 +1346,7 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping, goto out; } - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) { ext4_journal_stop(handle); ret = -ENOMEM; @@ -2550,7 +2550,7 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, goto out; } - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) { ext4_journal_stop(handle); ret = -ENOMEM; diff --git a/trunk/fs/ext4/namei.c b/trunk/fs/ext4/namei.c index 9fd2a5e1be4d..da98a9012fa5 100644 --- a/trunk/fs/ext4/namei.c +++ b/trunk/fs/ext4/namei.c @@ -2212,7 +2212,8 @@ static int ext4_symlink(struct inode *dir, * We have a transaction open. All is sweetness. It also sets * i_size in generic_commit_write(). */ - err = __page_symlink(inode, symname, l, 1); + err = __page_symlink(inode, symname, l, + mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); if (err) { clear_nlink(inode); unlock_new_inode(inode); diff --git a/trunk/fs/fuse/file.c b/trunk/fs/fuse/file.c index 4c9ee7011265..34930a964b82 100644 --- a/trunk/fs/fuse/file.c +++ b/trunk/fs/fuse/file.c @@ -646,7 +646,7 @@ static int fuse_write_begin(struct file *file, struct address_space *mapping, { pgoff_t index = pos >> PAGE_CACHE_SHIFT; - *pagep = grab_cache_page_write_begin(mapping, index, flags); + *pagep = __grab_cache_page(mapping, index); if (!*pagep) return -ENOMEM; return 0; @@ -779,7 +779,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req, break; err = -ENOMEM; - page = grab_cache_page_write_begin(mapping, index, 0); + page = __grab_cache_page(mapping, index); if (!page) break; diff --git a/trunk/fs/gfs2/ops_address.c b/trunk/fs/gfs2/ops_address.c index 15f710f2d4da..27563816e1c5 100644 --- a/trunk/fs/gfs2/ops_address.c +++ b/trunk/fs/gfs2/ops_address.c @@ -675,7 +675,7 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping, goto out_trans_fail; error = -ENOMEM; - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); *pagep = page; if (unlikely(!page)) goto out_endtrans; diff --git a/trunk/fs/hostfs/hostfs_kern.c b/trunk/fs/hostfs/hostfs_kern.c index 5c538e0ec14b..3a31451ac170 100644 --- a/trunk/fs/hostfs/hostfs_kern.c +++ b/trunk/fs/hostfs/hostfs_kern.c @@ -501,7 +501,7 @@ int hostfs_write_begin(struct file *file, struct address_space *mapping, { pgoff_t index = pos >> PAGE_CACHE_SHIFT; - *pagep = grab_cache_page_write_begin(mapping, index, flags); + *pagep = __grab_cache_page(mapping, index); if (!*pagep) return -ENOMEM; return 0; diff --git a/trunk/fs/jffs2/file.c b/trunk/fs/jffs2/file.c index 5edc2bf20581..5a98aa87c853 100644 --- a/trunk/fs/jffs2/file.c +++ b/trunk/fs/jffs2/file.c @@ -132,7 +132,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping, uint32_t pageofs = index << PAGE_CACHE_SHIFT; int ret = 0; - pg = grab_cache_page_write_begin(mapping, index, flags); + pg = __grab_cache_page(mapping, index); if (!pg) return -ENOMEM; *pagep = pg; diff --git a/trunk/fs/libfs.c b/trunk/fs/libfs.c index bdaec17fa388..e960a8321902 100644 --- a/trunk/fs/libfs.c +++ b/trunk/fs/libfs.c @@ -360,7 +360,7 @@ int simple_write_begin(struct file *file, struct address_space *mapping, index = pos >> PAGE_CACHE_SHIFT; from = pos & (PAGE_CACHE_SIZE - 1); - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) return -ENOMEM; diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index df2d3df4f049..dd5c9f0bf829 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -2817,23 +2817,18 @@ void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) } } -/* - * The nofs argument instructs pagecache_write_begin to pass AOP_FLAG_NOFS - */ -int __page_symlink(struct inode *inode, const char *symname, int len, int nofs) +int __page_symlink(struct inode *inode, const char *symname, int len, + gfp_t gfp_mask) { struct address_space *mapping = inode->i_mapping; struct page *page; void *fsdata; int err; char *kaddr; - unsigned int flags = AOP_FLAG_UNINTERRUPTIBLE; - if (nofs) - flags |= AOP_FLAG_NOFS; retry: err = pagecache_write_begin(NULL, mapping, 0, len-1, - flags, &page, &fsdata); + AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata); if (err) goto fail; @@ -2857,7 +2852,7 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs) int page_symlink(struct inode *inode, const char *symname, int len) { return __page_symlink(inode, symname, len, - !(mapping_gfp_mask(inode->i_mapping) & __GFP_FS)); + mapping_gfp_mask(inode->i_mapping)); } const struct inode_operations page_symlink_inode_operations = { diff --git a/trunk/fs/nfs/file.c b/trunk/fs/nfs/file.c index 90f292b520d2..d319b49f8f06 100644 --- a/trunk/fs/nfs/file.c +++ b/trunk/fs/nfs/file.c @@ -354,7 +354,7 @@ static int nfs_write_begin(struct file *file, struct address_space *mapping, file->f_path.dentry->d_name.name, mapping->host->i_ino, len, (long long) pos); - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) return -ENOMEM; *pagep = page; diff --git a/trunk/fs/reiserfs/inode.c b/trunk/fs/reiserfs/inode.c index ed04f47007f8..145c2d3e5e01 100644 --- a/trunk/fs/reiserfs/inode.c +++ b/trunk/fs/reiserfs/inode.c @@ -2561,7 +2561,7 @@ static int reiserfs_write_begin(struct file *file, } index = pos >> PAGE_CACHE_SHIFT; - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (!page) return -ENOMEM; *pagep = page; diff --git a/trunk/fs/smbfs/file.c b/trunk/fs/smbfs/file.c index 92d5e8ffb639..e4f8d51a5553 100644 --- a/trunk/fs/smbfs/file.c +++ b/trunk/fs/smbfs/file.c @@ -297,7 +297,7 @@ static int smb_write_begin(struct file *file, struct address_space *mapping, struct page **pagep, void **fsdata) { pgoff_t index = pos >> PAGE_CACHE_SHIFT; - *pagep = grab_cache_page_write_begin(mapping, index, flags); + *pagep = __grab_cache_page(mapping, index); if (!*pagep) return -ENOMEM; return 0; diff --git a/trunk/fs/ubifs/file.c b/trunk/fs/ubifs/file.c index bf37374567fa..fe82d2464d46 100644 --- a/trunk/fs/ubifs/file.c +++ b/trunk/fs/ubifs/file.c @@ -219,8 +219,7 @@ static void release_existing_page_budget(struct ubifs_info *c) } static int write_begin_slow(struct address_space *mapping, - loff_t pos, unsigned len, struct page **pagep, - unsigned flags) + loff_t pos, unsigned len, struct page **pagep) { struct inode *inode = mapping->host; struct ubifs_info *c = inode->i_sb->s_fs_info; @@ -248,7 +247,7 @@ static int write_begin_slow(struct address_space *mapping, if (unlikely(err)) return err; - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (unlikely(!page)) { ubifs_release_budget(c, &req); return -ENOMEM; @@ -439,7 +438,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping, return -EROFS; /* Try out the fast-path part first */ - page = grab_cache_page_write_begin(mapping, index, flags); + page = __grab_cache_page(mapping, index); if (unlikely(!page)) return -ENOMEM; @@ -484,7 +483,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping, unlock_page(page); page_cache_release(page); - return write_begin_slow(mapping, pos, len, pagep, flags); + return write_begin_slow(mapping, pos, len, pagep); } /* diff --git a/trunk/include/linux/blockgroup_lock.h b/trunk/include/linux/blockgroup_lock.h index e44b88ba552b..8607312983bd 100644 --- a/trunk/include/linux/blockgroup_lock.h +++ b/trunk/include/linux/blockgroup_lock.h @@ -53,10 +53,7 @@ static inline void bgl_lock_init(struct blockgroup_lock *bgl) * The accessor is a macro so we can embed a blockgroup_lock into different * superblock types */ -static inline spinlock_t * -bgl_lock_ptr(struct blockgroup_lock *bgl, unsigned int block_group) -{ - return &bgl->locks[(block_group) & (NR_BG_LOCKS-1)].lock; -} +#define sb_bgl_lock(sb, block_group) \ + (&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock) #endif diff --git a/trunk/include/linux/ext2_fs_sb.h b/trunk/include/linux/ext2_fs_sb.h index dc541f3653d1..f273415ab6f1 100644 --- a/trunk/include/linux/ext2_fs_sb.h +++ b/trunk/include/linux/ext2_fs_sb.h @@ -108,10 +108,4 @@ struct ext2_sb_info { struct ext2_reserve_window_node s_rsv_window_head; }; -static inline spinlock_t * -sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group) -{ - return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); -} - #endif /* _LINUX_EXT2_FS_SB */ diff --git a/trunk/include/linux/ext3_fs_sb.h b/trunk/include/linux/ext3_fs_sb.h index e024e38248ff..b65f0288b842 100644 --- a/trunk/include/linux/ext3_fs_sb.h +++ b/trunk/include/linux/ext3_fs_sb.h @@ -83,10 +83,4 @@ struct ext3_sb_info { #endif }; -static inline spinlock_t * -sb_bgl_lock(struct ext3_sb_info *sbi, unsigned int block_group) -{ - return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); -} - #endif /* _LINUX_EXT3_FS_SB */ diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index f2a3010140e3..e2170ee21e18 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -423,9 +423,6 @@ enum positive_aop_returns { #define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ #define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */ -#define AOP_FLAG_NOFS 0x0004 /* used by filesystem to direct - * helper code (eg buffer layer) - * to clear GFP_FS from alloc */ /* * oh the beauties of C type declarations. @@ -2038,7 +2035,7 @@ extern int page_readlink(struct dentry *, char __user *, int); extern void *page_follow_link_light(struct dentry *, struct nameidata *); extern void page_put_link(struct dentry *, struct nameidata *, void *); extern int __page_symlink(struct inode *inode, const char *symname, int len, - int nofs); + gfp_t gfp_mask); extern int page_symlink(struct inode *inode, const char *symname, int len); extern const struct inode_operations page_symlink_inode_operations; extern int generic_readlink(struct dentry *, char __user *, int); diff --git a/trunk/include/linux/pagemap.h b/trunk/include/linux/pagemap.h index 01ca0856caff..709742be02f0 100644 --- a/trunk/include/linux/pagemap.h +++ b/trunk/include/linux/pagemap.h @@ -241,8 +241,7 @@ unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, int tag, unsigned int nr_pages, struct page **pages); -struct page *grab_cache_page_write_begin(struct address_space *mapping, - pgoff_t index, unsigned flags); +struct page *__grab_cache_page(struct address_space *mapping, pgoff_t index); /* * Returns locked page at given index in given cache, creating it if needed. diff --git a/trunk/include/linux/rtc.h b/trunk/include/linux/rtc.h index 4046b75563c1..91f597ad6acc 100644 --- a/trunk/include/linux/rtc.h +++ b/trunk/include/linux/rtc.h @@ -145,8 +145,6 @@ struct rtc_class_ops { int (*irq_set_state)(struct device *, int enabled); int (*irq_set_freq)(struct device *, int freq); int (*read_callback)(struct device *, int data); - int (*alarm_irq_enable)(struct device *, unsigned int enabled); - int (*update_irq_enable)(struct device *, unsigned int enabled); }; #define RTC_DEVICE_NAME_SIZE 20 @@ -183,7 +181,7 @@ struct rtc_device struct timer_list uie_timer; /* Those fields are protected by rtc->irq_lock */ unsigned int oldsecs; - unsigned int uie_irq_active:1; + unsigned int irq_active:1; unsigned int stop_uie_polling:1; unsigned int uie_task_active:1; unsigned int uie_timer_active:1; @@ -218,10 +216,6 @@ extern int rtc_irq_set_state(struct rtc_device *rtc, struct rtc_task *task, int enabled); extern int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq); -extern int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled); -extern int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled); -extern int rtc_dev_update_irq_enable_emul(struct rtc_device *rtc, - unsigned int enabled); typedef struct rtc_task { void (*func)(void *private_data); diff --git a/trunk/include/linux/spi/spi.h b/trunk/include/linux/spi/spi.h index 82229317753d..4be01bb44377 100644 --- a/trunk/include/linux/spi/spi.h +++ b/trunk/include/linux/spi/spi.h @@ -19,8 +19,6 @@ #ifndef __LINUX_SPI_H #define __LINUX_SPI_H -#include - /* * INTERFACES between SPI master-side drivers and SPI infrastructure. * (There's no SPI slave support for Linux yet...) diff --git a/trunk/kernel/auditsc.c b/trunk/kernel/auditsc.c index 4819f3711973..c2e43ebb1b68 100644 --- a/trunk/kernel/auditsc.c +++ b/trunk/kernel/auditsc.c @@ -174,12 +174,6 @@ struct audit_aux_data_socketcall { unsigned long args[0]; }; -struct audit_aux_data_sockaddr { - struct audit_aux_data d; - int len; - char a[0]; -}; - struct audit_aux_data_fd_pair { struct audit_aux_data d; int fd[2]; @@ -234,7 +228,8 @@ struct audit_context { struct audit_context *previous; /* For nested syscalls */ struct audit_aux_data *aux; struct audit_aux_data *aux_pids; - + struct sockaddr_storage *sockaddr; + size_t sockaddr_len; /* Save things to print about task_struct */ pid_t pid, ppid; uid_t uid, euid, suid, fsuid; @@ -921,6 +916,7 @@ static inline void audit_free_context(struct audit_context *context) free_tree_refs(context); audit_free_aux(context); kfree(context->filterkey); + kfree(context->sockaddr); kfree(context); context = previous; } while (context); @@ -1383,13 +1379,6 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts audit_log_format(ab, " a%d=%lx", i, axs->args[i]); break; } - case AUDIT_SOCKADDR: { - struct audit_aux_data_sockaddr *axs = (void *)aux; - - audit_log_format(ab, "saddr="); - audit_log_n_hex(ab, axs->a, axs->len); - break; } - case AUDIT_FD_PAIR: { struct audit_aux_data_fd_pair *axs = (void *)aux; audit_log_format(ab, "fd0=%d fd1=%d", axs->fd[0], axs->fd[1]); @@ -1421,6 +1410,16 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts audit_log_end(ab); } + if (context->sockaddr_len) { + ab = audit_log_start(context, GFP_KERNEL, AUDIT_SOCKADDR); + if (ab) { + audit_log_format(ab, "saddr="); + audit_log_n_hex(ab, (void *)context->sockaddr, + context->sockaddr_len); + audit_log_end(ab); + } + } + for (aux = context->aux_pids; aux; aux = aux->next) { struct audit_aux_data_pids *axs = (void *)aux; @@ -1689,6 +1688,7 @@ void audit_syscall_exit(int valid, long return_code) context->aux_pids = NULL; context->target_pid = 0; context->target_sid = 0; + context->sockaddr_len = 0; kfree(context->filterkey); context->filterkey = NULL; tsk->audit_context = context; @@ -2468,22 +2468,20 @@ int __audit_fd_pair(int fd1, int fd2) */ int audit_sockaddr(int len, void *a) { - struct audit_aux_data_sockaddr *ax; struct audit_context *context = current->audit_context; if (likely(!context || context->dummy)) return 0; - ax = kmalloc(sizeof(*ax) + len, GFP_KERNEL); - if (!ax) - return -ENOMEM; - - ax->len = len; - memcpy(ax->a, a, len); + if (!context->sockaddr) { + void *p = kmalloc(sizeof(struct sockaddr_storage), GFP_KERNEL); + if (!p) + return -ENOMEM; + context->sockaddr = p; + } - ax->d.type = AUDIT_SOCKADDR; - ax->d.next = context->aux; - context->aux = (void *)ax; + context->sockaddr_len = len; + memcpy(context->sockaddr, a, len); return 0; } diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index 891a84eb9d30..48348dde6d81 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -2945,11 +2945,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys, parent = task_cgroup(tsk, subsys->subsys_id); /* Pin the hierarchy */ - if (!atomic_inc_not_zero(&parent->root->sb->s_active)) { - /* We race with the final deactivate_super() */ - mutex_unlock(&cgroup_mutex); - return 0; - } + atomic_inc(&parent->root->sb->s_active); /* Keep the cgroup alive */ get_css_set(cg); diff --git a/trunk/mm/filemap.c b/trunk/mm/filemap.c index f8c69273c37f..f3e5f8944d17 100644 --- a/trunk/mm/filemap.c +++ b/trunk/mm/filemap.c @@ -2140,24 +2140,19 @@ EXPORT_SYMBOL(generic_file_direct_write); * Find or create a page at the given pagecache position. Return the locked * page. This function is specifically for buffered writes. */ -struct page *grab_cache_page_write_begin(struct address_space *mapping, - pgoff_t index, unsigned flags) +struct page *__grab_cache_page(struct address_space *mapping, pgoff_t index) { int status; struct page *page; - gfp_t gfp_notmask = 0; - if (flags & AOP_FLAG_NOFS) - gfp_notmask = __GFP_FS; repeat: page = find_lock_page(mapping, index); if (likely(page)) return page; - page = __page_cache_alloc(mapping_gfp_mask(mapping) & ~gfp_notmask); + page = page_cache_alloc(mapping); if (!page) return NULL; - status = add_to_page_cache_lru(page, mapping, index, - GFP_KERNEL & ~gfp_notmask); + status = add_to_page_cache_lru(page, mapping, index, GFP_KERNEL); if (unlikely(status)) { page_cache_release(page); if (status == -EEXIST) @@ -2166,7 +2161,7 @@ struct page *grab_cache_page_write_begin(struct address_space *mapping, } return page; } -EXPORT_SYMBOL(grab_cache_page_write_begin); +EXPORT_SYMBOL(__grab_cache_page); static ssize_t generic_perform_write(struct file *file, struct iov_iter *i, loff_t pos) diff --git a/trunk/mm/vmalloc.c b/trunk/mm/vmalloc.c index 7465f22fec0c..1ddb77ba3995 100644 --- a/trunk/mm/vmalloc.c +++ b/trunk/mm/vmalloc.c @@ -151,12 +151,11 @@ static int vmap_pud_range(pgd_t *pgd, unsigned long addr, * * Ie. pte at addr+N*PAGE_SIZE shall point to pfn corresponding to pages[N] */ -static int vmap_page_range(unsigned long start, unsigned long end, +static int vmap_page_range(unsigned long addr, unsigned long end, pgprot_t prot, struct page **pages) { pgd_t *pgd; unsigned long next; - unsigned long addr = start; int err = 0; int nr = 0; @@ -168,7 +167,7 @@ static int vmap_page_range(unsigned long start, unsigned long end, if (err) break; } while (pgd++, addr = next, addr != end); - flush_cache_vmap(start, end); + flush_cache_vmap(addr, end); if (unlikely(err)) return err;