From c2b2a47f7af86b850428bd16c245b4b877a8c314 Mon Sep 17 00:00:00 2001 From: wangchenyang Date: Sun, 17 Jan 2021 01:04:19 +0800 Subject: [PATCH] Description:vfs refactoring Feature or Bugfix:Feature Binary Source:Huawei PrivateCode(Yes/No):Yes Change-Id: I175d2648bc6f9078c34de2c0a5c93fda10b86c47 ChangeID:13306404 --- sys/dev/usb/serial/usb_serial.c | 8 ++++---- sys/dev/usb/storage/umass.c | 18 +++++++++--------- sys/dev/usb/usb_dev.c | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) mode change 100755 => 100644 sys/dev/usb/usb_dev.c diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c index 5a52384..2a18ac7 100644 --- a/sys/dev/usb/serial/usb_serial.c +++ b/sys/dev/usb/serial/usb_serial.c @@ -1351,7 +1351,7 @@ tty_usb_write_wait(void) static int tty_usb_open(struct file *filep) { - struct ucom_softc *sc = (struct ucom_softc *)filep->f_inode->i_private; + struct ucom_softc *sc = (struct ucom_softc *)((struct drv_data*)filep->f_vnode->data)->priv; int ret; UCOM_MTX_LOCK(sc); @@ -1369,7 +1369,7 @@ tty_usb_open(struct file *filep) static int tty_usb_close(struct file *filep) { - struct ucom_softc *sc = (struct ucom_softc *)filep->f_inode->i_private; + struct ucom_softc *sc = (struct ucom_softc *)((struct drv_data*)filep->f_vnode->data)->priv; UCOM_MTX_LOCK(sc); tty_usb_queue_delete(); @@ -1382,7 +1382,7 @@ tty_usb_close(struct file *filep) static ssize_t tty_usb_read(struct file *filep, char *buffer, size_t buflen) { - struct ucom_softc *sc = (struct ucom_softc *)filep->f_inode->i_private; + struct ucom_softc *sc = (struct ucom_softc *)((struct drv_data*)filep->f_vnode->data)->priv; int read_len = -1; int ret; UCOM_MTX_LOCK(sc); @@ -1440,7 +1440,7 @@ tty_usb_read(struct file *filep, char *buffer, size_t buflen) static ssize_t tty_usb_write(struct file *filep, const char *buffer, size_t buflen) { - struct ucom_softc *sc = (struct ucom_softc *)filep->f_inode->i_private; + struct ucom_softc *sc = (struct ucom_softc *)((struct drv_data*)filep->f_vnode->data)->priv; tx_data_copy_in(sc, (void *)buffer, buflen); ucom_outwakeup(sc); diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c index f8a3982..4324e04 100644 --- a/sys/dev/usb/storage/umass.c +++ b/sys/dev/usb/storage/umass.c @@ -3158,25 +3158,25 @@ umass_status(void) } static int -umass_open(FAR struct inode *filep) +umass_open(FAR struct Vnode *filep) { (void)filep; return (0); } static int -umass_close(FAR struct inode *filep) +umass_close(FAR struct Vnode *filep) { (void)filep; return (0); } static ssize_t -umass_read(FAR struct inode *umass_inode, FAR unsigned char *buffer, +umass_read(FAR struct Vnode *umass_inode, FAR unsigned char *buffer, uint64_t start_sector, unsigned int nsectors) { int status; - struct umass_softc *sc = (struct umass_softc *)umass_inode->i_private; + struct umass_softc *sc = (struct umass_softc *)((struct drv_data*)umass_inode->data)->priv; mtx_lock(&sc->sc_umass_mtx); if (sc->sc_super_disk == TRUE) { @@ -3193,11 +3193,11 @@ umass_read(FAR struct inode *umass_inode, FAR unsigned char *buffer, } static ssize_t -umass_write(FAR struct inode *umass_inode, FAR const unsigned char *buffer, +umass_write(FAR struct Vnode *umass_inode, FAR const unsigned char *buffer, uint64_t start_sector, unsigned int nsectors) { int status; - struct umass_softc *sc = (struct umass_softc *)umass_inode->i_private; + struct umass_softc *sc = (struct umass_softc *)((struct drv_data*)umass_inode->data)->priv; mtx_lock(&sc->sc_umass_mtx); if (sc->sc_super_disk == TRUE) { @@ -3214,14 +3214,14 @@ umass_write(FAR struct inode *umass_inode, FAR const unsigned char *buffer, } static int -umass_geometry(FAR struct inode *umass_inode, FAR struct geometry *ugeometry) +umass_geometry(FAR struct Vnode *umass_inode, FAR struct geometry *ugeometry) { struct umass_softc *sc; if ((ugeometry == NULL) || (umass_inode == NULL)) return (-1); - sc = (struct umass_softc *)umass_inode->i_private; + sc = (struct umass_softc *)(struct umass_softc *)((struct drv_data*)umass_inode->data)->priv; if (sc == NULL) return (-1); @@ -3238,7 +3238,7 @@ umass_geometry(FAR struct inode *umass_inode, FAR struct geometry *ugeometry) } static int -umass_ioctl(FAR struct inode *umass_inode, int cmd, unsigned long arg) +umass_ioctl(FAR struct Vnode *umass_inode, int cmd, unsigned long arg) { (void)umass_inode; (void)cmd; diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c old mode 100755 new mode 100644 index 065a402..63dd8a8 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -781,7 +781,7 @@ usb_fifo_close(struct usb_fifo *f, int fflags) static int usb_open(struct file *filep) { - struct usb_fs_privdata* pd = (struct usb_fs_privdata*)filep->f_inode->i_private; + struct usb_fs_privdata* pd = (struct usb_fs_privdata*)((struct drv_data*)filep->f_vnode->data)->priv; struct usb_cdev_refdata refs; struct usb_cdev_privdata *cpd = NULL; int err; -- GitLab