diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index 0b86485..3cc0fa7 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -166,11 +166,6 @@ return cramfs_read_file(f->f_inode, f->pos, buf, size); } -static loff_t cramfs_lseek(struct device_d *dev, FILE *f, loff_t pos) -{ - return pos; -} - #if 0 static int cramfs_info (struct device_d *dev) { @@ -490,7 +485,6 @@ static struct fs_driver_d cramfs_driver = { .read = cramfs_read, - .lseek = cramfs_lseek, .drv = { .probe = cramfs_probe, .remove = cramfs_remove, diff --git a/fs/efivarfs.c b/fs/efivarfs.c index 34a2619..d261577 100644 --- a/fs/efivarfs.c +++ b/fs/efivarfs.c @@ -307,11 +307,6 @@ return 0; } -static loff_t efivarfs_lseek(struct device_d *dev, FILE *f, loff_t pos) -{ - return pos; -} - static DIR *efivarfs_opendir(struct device_d *dev, const char *pathname) { struct efivarfs_priv *priv = dev->priv; @@ -435,7 +430,6 @@ .read = efivarfs_read, .write = efivarfs_write, .truncate = efivarfs_truncate, - .lseek = efivarfs_lseek, .opendir = efivarfs_opendir, .readdir = efivarfs_readdir, .closedir = efivarfs_closedir, diff --git a/fs/ext4/ext_barebox.c b/fs/ext4/ext_barebox.c index 6e41b83..82d4c58 100644 --- a/fs/ext4/ext_barebox.c +++ b/fs/ext4/ext_barebox.c @@ -59,11 +59,6 @@ return ext4fs_read_file(node, f->pos, insize, buf); } -static loff_t ext_lseek(struct device_d *dev, FILE *f, loff_t pos) -{ - return pos; -} - static struct inode *ext_alloc_inode(struct super_block *sb) { struct fs_device_d *fsdev = container_of(sb, struct fs_device_d, sb); @@ -302,7 +297,6 @@ static struct fs_driver_d ext_driver = { .read = ext_read, - .lseek = ext_lseek, .type = filetype_ext, .flags = 0, .drv = { diff --git a/fs/fs.c b/fs/fs.c index bfed252..8cd965b 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -413,10 +413,6 @@ f = &files[fildes]; fsdrv = f->fsdev->driver; - if (!fsdrv->lseek) { - ret = -ENOSYS; - goto out; - } ret = -EINVAL; @@ -442,10 +438,12 @@ goto out; } - pos = fsdrv->lseek(&f->fsdev->dev, f, pos); - if (IS_ERR_VALUE(pos)) { - errno = -pos; - return -1; + if (fsdrv->lseek) { + pos = fsdrv->lseek(&f->fsdev->dev, f, pos); + if (IS_ERR_VALUE(pos)) { + errno = -pos; + return -1; + } } f->pos = pos; diff --git a/fs/omap4_usbbootfs.c b/fs/omap4_usbbootfs.c index 51038c7..cc33287 100644 --- a/fs/omap4_usbbootfs.c +++ b/fs/omap4_usbbootfs.c @@ -149,11 +149,6 @@ return size; } -static loff_t omap4_usbbootfs_lseek(struct device_d *dev, FILE *f, loff_t pos) -{ - return pos; -} - static DIR *omap4_usbbootfs_opendir(struct device_d *dev, const char *pathname) { return NULL; @@ -190,7 +185,6 @@ .open = omap4_usbbootfs_open, .close = omap4_usbbootfs_close, .read = omap4_usbbootfs_read, - .lseek = omap4_usbbootfs_lseek, .opendir = omap4_usbbootfs_opendir, .stat = omap4_usbbootfs_stat, /* diff --git a/fs/ramfs.c b/fs/ramfs.c index f571cd5..153b9b6 100644 --- a/fs/ramfs.c +++ b/fs/ramfs.c @@ -347,11 +347,6 @@ return insize; } -static loff_t ramfs_lseek(struct device_d *dev, FILE *f, loff_t pos) -{ - return pos; -} - static int ramfs_truncate(struct device_d *dev, FILE *f, ulong size) { struct inode *inode = f->f_inode; @@ -447,7 +442,6 @@ static struct fs_driver_d ramfs_driver = { .read = ramfs_read, .write = ramfs_write, - .lseek = ramfs_lseek, .truncate = ramfs_truncate, .flags = FS_DRIVER_NO_DEV, .drv = { diff --git a/fs/ratpfs.c b/fs/ratpfs.c index e316289..dffd276 100644 --- a/fs/ratpfs.c +++ b/fs/ratpfs.c @@ -284,13 +284,6 @@ return ret; } -static loff_t ratpfs_lseek(struct device_d __always_unused *dev, - FILE *f, loff_t pos) -{ - pr_debug("%s\n", __func__); - return pos; -} - static DIR* ratpfs_opendir(struct device_d __always_unused *dev, const char *pathname) { @@ -449,7 +442,6 @@ .open = ratpfs_open, .close = ratpfs_close, .read = ratpfs_read, - .lseek = ratpfs_lseek, .opendir = ratpfs_opendir, .readdir = ratpfs_readdir, .closedir = ratpfs_closedir, diff --git a/fs/squashfs/squashfs.c b/fs/squashfs/squashfs.c index 87b182a..38aff6d 100644 --- a/fs/squashfs/squashfs.c +++ b/fs/squashfs/squashfs.c @@ -231,11 +231,6 @@ return insize; } -static loff_t squashfs_lseek(struct device_d *dev, FILE *f, loff_t pos) -{ - return pos; -} - struct squashfs_dir { struct file file; struct dentry dentry; @@ -251,7 +246,6 @@ .open = squashfs_open, .close = squashfs_close, .read = squashfs_read, - .lseek = squashfs_lseek, .type = filetype_squashfs, .drv = { .probe = squashfs_probe, diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index ec6d008..494b1f2 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -394,11 +394,6 @@ return insize; } -static loff_t ubifs_lseek(struct device_d *dev, FILE *f, loff_t pos) -{ - return pos; -} - static void ubifs_set_rootarg(struct ubifs_priv *priv, struct fs_device_d *fsdev) { struct ubi_volume_info vi = {}; @@ -475,7 +470,6 @@ .open = ubifs_open, .close = ubifs_close, .read = ubifs_read, - .lseek = ubifs_lseek, .type = filetype_ubifs, .flags = 0, .drv = {