Commit 2f3c3a9b authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] rescue ftape from the ravages of that Rusty chap

parent bfdfd4c3
...@@ -40,15 +40,4 @@ ...@@ -40,15 +40,4 @@
#define QIC117_TAPE_MAJOR 27 #define QIC117_TAPE_MAJOR 27
#endif #endif
/* ftape-init.c defined global variables.
*/
/* ftape-init.c defined global functions not defined in ftape.h
*/
#ifdef MODULE
asmlinkage extern int init_module (void);
asmlinkage extern void cleanup_module(void);
#endif
#endif #endif
...@@ -648,50 +648,6 @@ int zft_check_write_access(zft_position *pos) ...@@ -648,50 +648,6 @@ int zft_check_write_access(zft_position *pos)
TRACE_EXIT 0; TRACE_EXIT 0;
} }
/* decide when we should lock the module in memory, even when calling
* the release routine. This really is necessary for use with
* kerneld.
*
* NOTE: we MUST NOT use zft_write_protected, because this includes
* the file access mode as well which has no meaning with our
* asynchronous update scheme.
*
* Ugly, ugly. We need to look the module if we changed the block size.
* How sad! Need persistent modules storage!
*
* NOTE: I don't want to lock the module if the number of dma buffers
* has been changed. It's enough! Stop the story! Give me persisitent
* module storage! Do it!
*/
int zft_dirty(void)
{
if (!ft_formatted || zft_offline) {
/* cannot be dirty if not formatted or offline */
return 0;
}
if (zft_blk_sz != CONFIG_ZFT_DFLT_BLK_SZ) {
/* blocksize changed, must lock */
return 1;
}
if (zft_mt_compression != 0) {
/* compression mode with /dev/qft, must lock */
return 1;
}
if (!zft_header_read) {
/* tape is logical at BOT, no lock */
return 0;
}
if (!zft_tape_at_lbot(&zft_pos)) {
/* somewhere inside a volume, lock tape */
return 1;
}
if (zft_volume_table_changed || zft_header_changed) {
/* header segments dirty if tape not write protected */
return !(ft_write_protected || zft_old_ftape);
}
return 0;
}
/* OPEN routine called by kernel-interface code /* OPEN routine called by kernel-interface code
* *
* NOTE: this is also called by mt_reset() with dev_minor == -1 * NOTE: this is also called by mt_reset() with dev_minor == -1
......
...@@ -314,7 +314,7 @@ extern int zft_compressor_init(void); ...@@ -314,7 +314,7 @@ extern int zft_compressor_init(void);
/* Called by modules package when installing the driver or by kernel /* Called by modules package when installing the driver or by kernel
* during the initialization phase * during the initialization phase
*/ */
int __init zft_init(void) static int __init zft_init(void)
{ {
int i; int i;
TRACE_FUN(ft_t_flow); TRACE_FUN(ft_t_flow);
...@@ -392,27 +392,9 @@ KERN_INFO ...@@ -392,27 +392,9 @@ KERN_INFO
} }
#ifdef MODULE
/* Called by modules package before trying to unload the module
*/
static int can_unload(void)
{
return (GET_USE_COUNT(THIS_MODULE)||zft_dirty()||test_bit(0,&busy_flag))?-EBUSY:0;
}
/* Called by modules package when installing the driver
*/
int init_module(void)
{
if (!mod_member_present(&__this_module, can_unload)) {
return -EBUSY;
}
__this_module.can_unload = can_unload;
return zft_init();
}
/* Called by modules package when removing the driver /* Called by modules package when removing the driver
*/ */
void cleanup_module(void) static void zft_exit(void)
{ {
int i; int i;
TRACE_FUN(ft_t_flow); TRACE_FUN(ft_t_flow);
...@@ -435,4 +417,5 @@ void cleanup_module(void) ...@@ -435,4 +417,5 @@ void cleanup_module(void)
TRACE_EXIT; TRACE_EXIT;
} }
#endif /* MODULE */ module_init(zft_init);
module_exit(zft_exit);
...@@ -73,13 +73,6 @@ extern int zft_cmpr_register(struct zft_cmpr_ops *new_ops); ...@@ -73,13 +73,6 @@ extern int zft_cmpr_register(struct zft_cmpr_ops *new_ops);
extern struct zft_cmpr_ops *zft_cmpr_unregister(void); extern struct zft_cmpr_ops *zft_cmpr_unregister(void);
extern int zft_cmpr_lock(int try_to_load); extern int zft_cmpr_lock(int try_to_load);
#ifdef MODULE
asmlinkage extern int init_module(void);
asmlinkage extern void cleanup_module(void);
#endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment