diff --git a/[refs] b/[refs] index ed273fa0399d..0e0325ca9859 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9fe4145530e6072cc838beb95ca68cada8c56909 +refs/heads/master: 947b10ae0aeda89fc066a7470fdba55f72b0b8fc diff --git a/trunk/drivers/input/evdev.c b/trunk/drivers/input/evdev.c index 68f09a868434..e3f7fc6f9565 100644 --- a/trunk/drivers/input/evdev.c +++ b/trunk/drivers/input/evdev.c @@ -534,73 +534,76 @@ static int handle_eviocgbit(struct input_dev *dev, } #undef OLD_KEY_MAX -static int evdev_handle_get_keycode(struct input_dev *dev, void __user *p) +static int evdev_handle_get_keycode(struct input_dev *dev, + void __user *p, size_t size) { - struct input_keymap_entry ke = { - .len = sizeof(unsigned int), - .flags = 0, - }; - int __user *ip = (int __user *)p; + struct input_keymap_entry ke; int error; - /* legacy case */ - if (copy_from_user(ke.scancode, p, sizeof(unsigned int))) - return -EFAULT; + memset(&ke, 0, sizeof(ke)); - error = input_get_keycode(dev, &ke); - if (error) - return error; + if (size == sizeof(unsigned int[2])) { + /* legacy case */ + int __user *ip = (int __user *)p; - if (put_user(ke.keycode, ip + 1)) - return -EFAULT; + if (copy_from_user(ke.scancode, p, sizeof(unsigned int))) + return -EFAULT; - return 0; -} + ke.len = sizeof(unsigned int); + ke.flags = 0; -static int evdev_handle_get_keycode_v2(struct input_dev *dev, void __user *p) -{ - struct input_keymap_entry ke; - int error; + error = input_get_keycode(dev, &ke); + if (error) + return error; - if (copy_from_user(&ke, p, sizeof(ke))) - return -EFAULT; + if (put_user(ke.keycode, ip + 1)) + return -EFAULT; - error = input_get_keycode(dev, &ke); - if (error) - return error; + } else { + size = min(size, sizeof(ke)); - if (copy_to_user(p, &ke, sizeof(ke))) - return -EFAULT; + if (copy_from_user(&ke, p, size)) + return -EFAULT; + error = input_get_keycode(dev, &ke); + if (error) + return error; + + if (copy_to_user(p, &ke, size)) + return -EFAULT; + } return 0; } -static int evdev_handle_set_keycode(struct input_dev *dev, void __user *p) +static int evdev_handle_set_keycode(struct input_dev *dev, + void __user *p, size_t size) { - struct input_keymap_entry ke = { - .len = sizeof(unsigned int), - .flags = 0, - }; - int __user *ip = (int __user *)p; + struct input_keymap_entry ke; - if (copy_from_user(ke.scancode, p, sizeof(unsigned int))) - return -EFAULT; + memset(&ke, 0, sizeof(ke)); - if (get_user(ke.keycode, ip + 1)) - return -EFAULT; + if (size == sizeof(unsigned int[2])) { + /* legacy case */ + int __user *ip = (int __user *)p; - return input_set_keycode(dev, &ke); -} + if (copy_from_user(ke.scancode, p, sizeof(unsigned int))) + return -EFAULT; -static int evdev_handle_set_keycode_v2(struct input_dev *dev, void __user *p) -{ - struct input_keymap_entry ke; + if (get_user(ke.keycode, ip + 1)) + return -EFAULT; - if (copy_from_user(&ke, p, sizeof(ke))) - return -EFAULT; + ke.len = sizeof(unsigned int); + ke.flags = 0; - if (ke.len > sizeof(ke.scancode)) - return -EINVAL; + } else { + size = min(size, sizeof(ke)); + + if (copy_from_user(&ke, p, size)) + return -EFAULT; + + if (ke.len > sizeof(ke.scancode)) + return -EINVAL; + } return input_set_keycode(dev, &ke); } @@ -666,18 +669,6 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, return evdev_grab(evdev, client); else return evdev_ungrab(evdev, client); - - case EVIOCGKEYCODE: - return evdev_handle_get_keycode(dev, p); - - case EVIOCSKEYCODE: - return evdev_handle_set_keycode(dev, p); - - case EVIOCGKEYCODE_V2: - return evdev_handle_get_keycode_v2(dev, p); - - case EVIOCSKEYCODE_V2: - return evdev_handle_set_keycode_v2(dev, p); } size = _IOC_SIZE(cmd); @@ -717,6 +708,12 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, return -EFAULT; return error; + + case EVIOC_MASK_SIZE(EVIOCGKEYCODE): + return evdev_handle_get_keycode(dev, p, size); + + case EVIOC_MASK_SIZE(EVIOCSKEYCODE): + return evdev_handle_set_keycode(dev, p, size); } /* Multi-number variable-length handlers */ diff --git a/trunk/drivers/input/tablet/wacom_wac.c b/trunk/drivers/input/tablet/wacom_wac.c index 435b0af401e4..4852b440960a 100644 --- a/trunk/drivers/input/tablet/wacom_wac.c +++ b/trunk/drivers/input/tablet/wacom_wac.c @@ -1436,8 +1436,6 @@ static struct wacom_features wacom_features_0xD2 = { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; static struct wacom_features wacom_features_0xD3 = { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; -static const struct wacom_features wacom_features_0xD4 = - { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255, 63, BAMBOO_PT }; static struct wacom_features wacom_features_0xD8 = { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; static struct wacom_features wacom_features_0xDA = @@ -1512,7 +1510,6 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0xD1) }, { USB_DEVICE_WACOM(0xD2) }, { USB_DEVICE_WACOM(0xD3) }, - { USB_DEVICE_WACOM(0xD4) }, { USB_DEVICE_WACOM(0xD8) }, { USB_DEVICE_WACOM(0xDA) }, { USB_DEVICE_WACOM(0xDB) }, diff --git a/trunk/fs/nilfs2/gcinode.c b/trunk/fs/nilfs2/gcinode.c index 33ad25ddd5c4..caf9a6a3fb54 100644 --- a/trunk/fs/nilfs2/gcinode.c +++ b/trunk/fs/nilfs2/gcinode.c @@ -176,7 +176,6 @@ int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh) int nilfs_init_gcinode(struct inode *inode) { struct nilfs_inode_info *ii = NILFS_I(inode); - struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; inode->i_mode = S_IFREG; mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); @@ -186,14 +185,6 @@ int nilfs_init_gcinode(struct inode *inode) ii->i_flags = 0; nilfs_bmap_init_gc(ii->i_bmap); - /* - * Add the inode to GC inode list. Garbage Collection - * is serialized and no two processes manipulate the - * list simultaneously. - */ - igrab(inode); - list_add(&NILFS_I(inode)->i_dirty, &nilfs->ns_gc_inodes); - return 0; } diff --git a/trunk/fs/nilfs2/ioctl.c b/trunk/fs/nilfs2/ioctl.c index e00d9457c256..b185e937a335 100644 --- a/trunk/fs/nilfs2/ioctl.c +++ b/trunk/fs/nilfs2/ioctl.c @@ -337,6 +337,7 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb, struct nilfs_argv *argv, void *buf) { size_t nmembs = argv->v_nmembs; + struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; struct inode *inode; struct nilfs_vdesc *vdesc; struct buffer_head *bh, *n; @@ -353,6 +354,17 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb, ret = PTR_ERR(inode); goto failed; } + if (list_empty(&NILFS_I(inode)->i_dirty)) { + /* + * Add the inode to GC inode list. Garbage Collection + * is serialized and no two processes manipulate the + * list simultaneously. + */ + igrab(inode); + list_add(&NILFS_I(inode)->i_dirty, + &nilfs->ns_gc_inodes); + } + do { ret = nilfs_ioctl_move_inode_block(inode, vdesc, &buffers); diff --git a/trunk/include/linux/input.h b/trunk/include/linux/input.h index 9777668883be..a8af21d42bc1 100644 --- a/trunk/include/linux/input.h +++ b/trunk/include/linux/input.h @@ -104,10 +104,8 @@ struct input_keymap_entry { #define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ #define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ -#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ -#define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry) -#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ -#define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry) +#define EVIOCGKEYCODE _IOR('E', 0x04, struct input_keymap_entry) /* get keycode */ +#define EVIOCSKEYCODE _IOW('E', 0x04, struct input_keymap_entry) /* set keycode */ #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */