diff options
author | Christoph Hellwig <hch@lst.de> | 2008-11-05 08:58:42 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-04 04:22:57 -0500 |
commit | fd4ce1acd0f8558033b1a6968001552bd7671e6d (patch) | |
tree | 7ce54f2b2c967fe2315917ffa2eb8eb7d47e7a2b /fs | |
parent | ebbefc011e56bd85b4745d01e5b8d7d05d95ed5d (diff) |
[PATCH 1/2] kill FMODE_NDELAY_NOW
Update FMODE_NDELAY before each ioctl call so that we can kill the
magic FMODE_NDELAY_NOW. It would be even better to do this directly
in setfl(), but for that we'd need to have FMODE_NDELAY for all files,
not just block special files.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 7c727523bc5..99e0ae1a4c7 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1206,8 +1206,16 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg) | |||
1206 | { | 1206 | { |
1207 | struct block_device *bdev = I_BDEV(file->f_mapping->host); | 1207 | struct block_device *bdev = I_BDEV(file->f_mapping->host); |
1208 | fmode_t mode = file->f_mode; | 1208 | fmode_t mode = file->f_mode; |
1209 | |||
1210 | /* | ||
1211 | * O_NDELAY can be altered using fcntl(.., F_SETFL, ..), so we have | ||
1212 | * to updated it before every ioctl. | ||
1213 | */ | ||
1209 | if (file->f_flags & O_NDELAY) | 1214 | if (file->f_flags & O_NDELAY) |
1210 | mode |= FMODE_NDELAY_NOW; | 1215 | mode |= FMODE_NDELAY; |
1216 | else | ||
1217 | mode &= ~FMODE_NDELAY; | ||
1218 | |||
1211 | return blkdev_ioctl(bdev, mode, cmd, arg); | 1219 | return blkdev_ioctl(bdev, mode, cmd, arg); |
1212 | } | 1220 | } |
1213 | 1221 | ||