mdesc.c (01b944fe1cd4e21a2a9ed51adbdbafe2d5e905ba) | mdesc.c (b25472f9b96159cc0b9b7ed449448805973cd789) |
---|---|
1/* mdesc.c: Sun4V machine description handling. 2 * 3 * Copyright (C) 2007, 2008 David S. Miller <davem@davemloft.net> 4 */ 5#include <linux/kernel.h> 6#include <linux/types.h> 7#include <linux/memblock.h> 8#include <linux/log2.h> --- 1019 unchanged lines hidden (view full) --- 1028 return count; 1029 } else { 1030 return -EFAULT; 1031 } 1032} 1033 1034static loff_t mdesc_llseek(struct file *file, loff_t offset, int whence) 1035{ | 1/* mdesc.c: Sun4V machine description handling. 2 * 3 * Copyright (C) 2007, 2008 David S. Miller <davem@davemloft.net> 4 */ 5#include <linux/kernel.h> 6#include <linux/types.h> 7#include <linux/memblock.h> 8#include <linux/log2.h> --- 1019 unchanged lines hidden (view full) --- 1028 return count; 1029 } else { 1030 return -EFAULT; 1031 } 1032} 1033 1034static loff_t mdesc_llseek(struct file *file, loff_t offset, int whence) 1035{ |
1036 struct mdesc_handle *hp; | 1036 struct mdesc_handle *hp = file->private_data; |
1037 | 1037 |
1038 switch (whence) { 1039 case SEEK_CUR: 1040 offset += file->f_pos; 1041 break; 1042 case SEEK_SET: 1043 break; 1044 default: 1045 return -EINVAL; 1046 } 1047 1048 hp = file->private_data; 1049 if (offset > hp->handle_size) 1050 return -EINVAL; 1051 else 1052 file->f_pos = offset; 1053 1054 return offset; | 1038 return no_seek_end_llseek_size(file, offset, whence, hp->handle_size); |
1055} 1056 1057/* mdesc_close() - /dev/mdesc is being closed, release the reference to 1058 * mdesc structure. 1059 */ 1060static int mdesc_close(struct inode *inode, struct file *file) 1061{ 1062 mdesc_release(file->private_data); --- 52 unchanged lines hidden --- | 1039} 1040 1041/* mdesc_close() - /dev/mdesc is being closed, release the reference to 1042 * mdesc structure. 1043 */ 1044static int mdesc_close(struct inode *inode, struct file *file) 1045{ 1046 mdesc_release(file->private_data); --- 52 unchanged lines hidden --- |