diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2019-06-17 10:19:39 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-06-17 10:19:38 -0700 |
| commit | 4e933027e6848a194b03aa35c26bc20fe06205e9 (patch) | |
| tree | ab1dda795bb590c589a5af45f0692b3b6f3c3931 /fs/open.c | |
| parent | c176a066dfd36e31ebaf2796a12b2c523e7083dc (diff) | |
| parent | 5ef154a26639ad07ed3ebdaea1dabe29065982b0 (diff) | |
Merge "Merge android-4.4.181 (bd858d7) into msm-4.4"
Diffstat (limited to 'fs/open.c')
| -rw-r--r-- | fs/open.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/open.c b/fs/open.c index 1fd96c5d3895..e6a55dd45cba 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1165,3 +1165,21 @@ int nonseekable_open(struct inode *inode, struct file *filp) } EXPORT_SYMBOL(nonseekable_open); + +/* + * stream_open is used by subsystems that want stream-like file descriptors. + * Such file descriptors are not seekable and don't have notion of position + * (file.f_pos is always 0). Contrary to file descriptors of other regular + * files, .read() and .write() can run simultaneously. + * + * stream_open never fails and is marked to return int so that it could be + * directly used as file_operations.open . + */ +int stream_open(struct inode *inode, struct file *filp) +{ + filp->f_mode &= ~(FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE | FMODE_ATOMIC_POS); + filp->f_mode |= FMODE_STREAM; + return 0; +} + +EXPORT_SYMBOL(stream_open); |
