X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Fread_write.c;fp=fs%2Fread_write.c;h=782dfc3acebcf038db62116ab65536fc28ed8a6a;hb=1bf9d14dff4a2c4de6152c6f751bdaf6896b68bb;hp=f646c8b565b913d5cbe02a5dafb2aba5a4b163ef;hpb=0747fdb2bd59d9404ae2345cbddd7d837c5c4648;p=~andy%2Flinux diff --git a/fs/read_write.c b/fs/read_write.c index f646c8b565b..782dfc3aceb 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -144,6 +144,26 @@ loff_t generic_file_llseek(struct file *file, loff_t offset, int whence) } EXPORT_SYMBOL(generic_file_llseek); +/** + * fixed_size_llseek - llseek implementation for fixed-sized devices + * @file: file structure to seek on + * @offset: file offset to seek to + * @whence: type of seek + * @size: size of the file + * + */ +loff_t fixed_size_llseek(struct file *file, loff_t offset, int whence, loff_t size) +{ + switch (whence) { + case SEEK_SET: case SEEK_CUR: case SEEK_END: + return generic_file_llseek_size(file, offset, whence, + size, size); + default: + return -EINVAL; + } +} +EXPORT_SYMBOL(fixed_size_llseek); + /** * noop_llseek - No Operation Performed llseek implementation * @file: file structure to seek on