diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2019-05-14 23:17:02 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-05-16 05:27:53 +0200 |
commit | dece44e381ab4a9fd1021db45ba4472e8c85becb (patch) | |
tree | 0acf0893d4a05cfb0045df758cf47a4bddd070d1 /fs/cifs/cifsfs.c | |
parent | Fixed https://bugzilla.kernel.org/show_bug.cgi?id=202935 allow write on the s... (diff) | |
download | linux-dece44e381ab4a9fd1021db45ba4472e8c85becb.tar.xz linux-dece44e381ab4a9fd1021db45ba4472e8c85becb.zip |
cifs: add support for SEEK_DATA and SEEK_HOLE
Add llseek op for SEEK_DATA and SEEK_HOLE.
Improves xfstests/285,286,436,445,448 and 490
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index d0cb042732cb..f5fcd6360056 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -878,6 +878,9 @@ out: 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); } |