usb: convert to new timestamp accessors

Convert to using the new inode timestamp accessor functions.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20231004185347.80880-12-jlayton@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Jeff Layton 2023-10-04 14:51:59 -04:00 committed by Christian Brauner
parent 69f73ca33d
commit 2b450e9246
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2
1 changed files with 17 additions and 9 deletions

View File

@ -2642,21 +2642,24 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
snoop(&dev->dev, "%s: CONTROL\n", __func__);
ret = proc_control(ps, p);
if (ret >= 0)
inode->i_mtime = inode_set_ctime_current(inode);
inode_set_mtime_to_ts(inode,
inode_set_ctime_current(inode));
break;
case USBDEVFS_BULK:
snoop(&dev->dev, "%s: BULK\n", __func__);
ret = proc_bulk(ps, p);
if (ret >= 0)
inode->i_mtime = inode_set_ctime_current(inode);
inode_set_mtime_to_ts(inode,
inode_set_ctime_current(inode));
break;
case USBDEVFS_RESETEP:
snoop(&dev->dev, "%s: RESETEP\n", __func__);
ret = proc_resetep(ps, p);
if (ret >= 0)
inode->i_mtime = inode_set_ctime_current(inode);
inode_set_mtime_to_ts(inode,
inode_set_ctime_current(inode));
break;
case USBDEVFS_RESET:
@ -2668,7 +2671,8 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__);
ret = proc_clearhalt(ps, p);
if (ret >= 0)
inode->i_mtime = inode_set_ctime_current(inode);
inode_set_mtime_to_ts(inode,
inode_set_ctime_current(inode));
break;
case USBDEVFS_GETDRIVER:
@ -2695,7 +2699,8 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
snoop(&dev->dev, "%s: SUBMITURB\n", __func__);
ret = proc_submiturb(ps, p);
if (ret >= 0)
inode->i_mtime = inode_set_ctime_current(inode);
inode_set_mtime_to_ts(inode,
inode_set_ctime_current(inode));
break;
#ifdef CONFIG_COMPAT
@ -2703,14 +2708,16 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
snoop(&dev->dev, "%s: CONTROL32\n", __func__);
ret = proc_control_compat(ps, p);
if (ret >= 0)
inode->i_mtime = inode_set_ctime_current(inode);
inode_set_mtime_to_ts(inode,
inode_set_ctime_current(inode));
break;
case USBDEVFS_BULK32:
snoop(&dev->dev, "%s: BULK32\n", __func__);
ret = proc_bulk_compat(ps, p);
if (ret >= 0)
inode->i_mtime = inode_set_ctime_current(inode);
inode_set_mtime_to_ts(inode,
inode_set_ctime_current(inode));
break;
case USBDEVFS_DISCSIGNAL32:
@ -2722,7 +2729,8 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
snoop(&dev->dev, "%s: SUBMITURB32\n", __func__);
ret = proc_submiturb_compat(ps, p);
if (ret >= 0)
inode->i_mtime = inode_set_ctime_current(inode);
inode_set_mtime_to_ts(inode,
inode_set_ctime_current(inode));
break;
case USBDEVFS_IOCTL32:
@ -2804,7 +2812,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
done:
usb_unlock_device(dev);
if (ret >= 0)
inode->i_atime = current_time(inode);
inode_set_atime_to_ts(inode, current_time(inode));
return ret;
}