cifs: add support for SEEK_DATA and SEEK_HOLE
Subsystems (2)
cover cifs: add support for SEEK_DATA and SEEK_HOLE
Resending, I think something went wrong.
Steve,
Support for SEEK_DATA/HOLE.
It passes xfstests 285,286,436,445,448,490
PATCH 1/1 cifs: add support for SEEK_DATA and SEEK_HOLE
Signed-off-by Ronnie Sahlberg <[email protected]>
--- fs/cifs/cifsfs.c | 9 ++++++ fs/cifs/cifsglob.h | 2 ++ fs/cifs/smb2ops.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+)
fs/cifs/cifsfs.c +9 -0
@@ -878,6 +878,9 @@ static ssize_t cifs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)static loff_t cifs_llseek (struct file *file,loff_t offset,int whence) { +struct cifsFileInfo *cfile = file->private_data; +struct cifs_tcon *tcon; +/* * whence == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate * the cached file length
@@ -909,6 +912,12 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int whence)if (rc <0 )return (loff_t )rc; } +if (cfile && cfile->tlink) { + tcon =tlink_tcon (cfile->tlink); +if (tcon->ses->server->ops->llseek) +return tcon->ses->server->ops->llseek (file, tcon, + offset, whence); + }return generic_file_llseek (file, offset, whence); }
fs/cifs/cifsglob.h +2 -0
@@ -497,6 +497,8 @@ struct smb_version_operations {/* version specific fiemap implementation */ int (*fiemap)(struct cifs_tcon *tcon,struct cifsFileInfo *,struct fiemap_extent_info *,u64 ,u64 ); +/* version specific llseek implementation */ +loff_t (*llseek)(struct file *,struct cifs_tcon *,loff_t ,int ); };struct smb_version_values {
fs/cifs/smb2ops.c +88 -0
118 lines not on this page · raw message
Signature · 1 line
2.13.6