Changeset 55
- Timestamp:
- 12/09/98 16:11:32 (10 years ago)
- Files:
-
- lm-sensors/trunk/TODO (modified) (1 diff)
- lm-sensors/trunk/i2c/eeprom/Module.mk (modified) (1 diff)
- lm-sensors/trunk/kernel/i2c-proc.c (modified) (4 diffs)
- lm-sensors/trunk/kernel/sensors.c (modified) (4 diffs)
- lm-sensors/trunk/src/i2c-proc.c (modified) (4 diffs)
- lm-sensors/trunk/src/sensors.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/TODO
r53 r55 15 15 places, probably (everywhere where global vars are accessed). This must be 16 16 done for the i2c modules, too. 17 * Extend the mod_inc_use/mod_dec_use through the fill_inode trick, for all18 new /proc files.19 17 * Make lm78.c detect 'double hits', (same chip connected to both SMBus and 20 18 ISA). lm-sensors/trunk/i2c/eeprom/Module.mk
r52 r55 36 36 37 37 clean-i2c-eeprom: 38 $(RM) $(I2CEEPROMSOURCES:.c=. d) $(I2CEEPROMSOURCES:.c=.o) \38 $(RM) $(I2CEEPROMSOURCES:.c=.rd) $(I2CEEPROMSOURCES:.c=.ro) \ 39 39 $(I2CEEPROMTARGETS) 40 40 clean :: clean-i2c-eeprom lm-sensors/trunk/kernel/i2c-proc.c
r46 r55 41 41 static void i2cproc_inc_use(struct i2c_client *client); 42 42 static void i2cproc_dec_use(struct i2c_client *client); 43 44 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 45 static void monitor_bus_i2c(struct inode *inode, int fill); 46 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 43 47 44 48 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) … … 81 85 /* ops */ NULL, 82 86 /* get_info */ &read_bus_i2c 87 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 88 /* fill_inode */ &monitor_bus_i2c 89 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 83 90 }; 84 91 … … 223 230 return 0; 224 231 } 232 233 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 234 /* Monitor access to /proc/bus/i2c*; make unloading i2c-proc.o impossible 235 if some process still uses it or some file in it */ 236 void monitor_bus_i2c(struct inode *inode, int fill) 237 { 238 if (fill) 239 MOD_INC_USE_COUNT; 240 else 241 MOD_DEC_USE_COUNT; 242 } 243 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 244 225 245 226 246 /* This function generates the output for /proc/bus/i2c */ … … 350 370 } 351 371 proc_entry->ops = &i2cproc_inode_operations; 372 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 373 proc_entry->fill_inode = &monitor_bus_i2c; 374 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 352 375 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */ 353 376 if (!(proc_entry = kmalloc(sizeof(struct proc_dir_entry)+strlen(name)+1, lm-sensors/trunk/kernel/sensors.c
r51 r55 57 57 static struct i2c_client *sensors_clients[SENSORS_ENTRY_MAX]; 58 58 static unsigned short sensors_inodes[SENSORS_ENTRY_MAX]; 59 void sensors_fill_inode(struct inode *inode, int fill); 59 static void sensors_fill_inode(struct inode *inode, int fill); 60 static void sensors_dir_fill_inode(struct inode *inode, int fill); 60 61 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 61 62 … … 181 182 #endif /* DEBUG */ 182 183 sensors_inodes[id-256] = new_header->ctl_table->child->child->de->low_ino; 183 new_header->ctl_table->child->child->de->fill_inode = &sensors_ fill_inode;184 new_header->ctl_table->child->child->de->fill_inode = &sensors_dir_fill_inode; 184 185 #endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 185 186 … … 204 205 205 206 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 207 /* Monitor access for /proc/sys/dev/sensors; make unloading sensors.o 208 impossible if some process still uses it or some file in it */ 206 209 void sensors_fill_inode(struct inode *inode, int fill) 210 { 211 if (fill) 212 MOD_INC_USE_COUNT; 213 else 214 MOD_DEC_USE_COUNT; 215 } 216 217 /* Monitor access for /proc/sys/dev/sensors/* directories; make unloading 218 the corresponding module impossible if some process still uses it or 219 some file in it */ 220 void sensors_dir_fill_inode(struct inode *inode, int fill) 207 221 { 208 222 int i; … … 568 582 if (! (sensors_proc_header = register_sysctl_table(sensors_proc,0))) 569 583 return -ENOMEM; 584 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 585 sensors_proc_header->ctl_table->child->de->fill_inode = &sensors_fill_inode; 586 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 570 587 sensors_initialized ++; 571 588 return 0; lm-sensors/trunk/src/i2c-proc.c
r46 r55 41 41 static void i2cproc_inc_use(struct i2c_client *client); 42 42 static void i2cproc_dec_use(struct i2c_client *client); 43 44 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 45 static void monitor_bus_i2c(struct inode *inode, int fill); 46 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 43 47 44 48 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) … … 81 85 /* ops */ NULL, 82 86 /* get_info */ &read_bus_i2c 87 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 88 /* fill_inode */ &monitor_bus_i2c 89 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 83 90 }; 84 91 … … 223 230 return 0; 224 231 } 232 233 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 234 /* Monitor access to /proc/bus/i2c*; make unloading i2c-proc.o impossible 235 if some process still uses it or some file in it */ 236 void monitor_bus_i2c(struct inode *inode, int fill) 237 { 238 if (fill) 239 MOD_INC_USE_COUNT; 240 else 241 MOD_DEC_USE_COUNT; 242 } 243 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 244 225 245 226 246 /* This function generates the output for /proc/bus/i2c */ … … 350 370 } 351 371 proc_entry->ops = &i2cproc_inode_operations; 372 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 373 proc_entry->fill_inode = &monitor_bus_i2c; 374 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 352 375 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */ 353 376 if (!(proc_entry = kmalloc(sizeof(struct proc_dir_entry)+strlen(name)+1, lm-sensors/trunk/src/sensors.c
r51 r55 57 57 static struct i2c_client *sensors_clients[SENSORS_ENTRY_MAX]; 58 58 static unsigned short sensors_inodes[SENSORS_ENTRY_MAX]; 59 void sensors_fill_inode(struct inode *inode, int fill); 59 static void sensors_fill_inode(struct inode *inode, int fill); 60 static void sensors_dir_fill_inode(struct inode *inode, int fill); 60 61 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 61 62 … … 181 182 #endif /* DEBUG */ 182 183 sensors_inodes[id-256] = new_header->ctl_table->child->child->de->low_ino; 183 new_header->ctl_table->child->child->de->fill_inode = &sensors_ fill_inode;184 new_header->ctl_table->child->child->de->fill_inode = &sensors_dir_fill_inode; 184 185 #endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 185 186 … … 204 205 205 206 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 207 /* Monitor access for /proc/sys/dev/sensors; make unloading sensors.o 208 impossible if some process still uses it or some file in it */ 206 209 void sensors_fill_inode(struct inode *inode, int fill) 210 { 211 if (fill) 212 MOD_INC_USE_COUNT; 213 else 214 MOD_DEC_USE_COUNT; 215 } 216 217 /* Monitor access for /proc/sys/dev/sensors/* directories; make unloading 218 the corresponding module impossible if some process still uses it or 219 some file in it */ 220 void sensors_dir_fill_inode(struct inode *inode, int fill) 207 221 { 208 222 int i; … … 568 582 if (! (sensors_proc_header = register_sysctl_table(sensors_proc,0))) 569 583 return -ENOMEM; 584 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 585 sensors_proc_header->ctl_table->child->de->fill_inode = &sensors_fill_inode; 586 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 570 587 sensors_initialized ++; 571 588 return 0;
