summaryrefslogtreecommitdiffstats
path: root/drivers/char/ftape
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
commit27cfca1ec98e91261b1a5355d10a8996464b63af (patch)
tree8e895a53e372fa682b4c0a585b9377d67ed70d0e /drivers/char/ftape
parent6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff)
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too o Upgrade to 2.1.89. Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'drivers/char/ftape')
-rw-r--r--drivers/char/ftape/.cvsignore1
-rw-r--r--drivers/char/ftape/compressor/.cvsignore1
-rw-r--r--drivers/char/ftape/compressor/Makefile9
-rw-r--r--drivers/char/ftape/compressor/zftape-compress.c1
-rw-r--r--drivers/char/ftape/lowlevel/.cvsignore1
-rw-r--r--drivers/char/ftape/lowlevel/fdc-io.c20
-rw-r--r--drivers/char/ftape/lowlevel/ftape-ctl.c4
-rw-r--r--drivers/char/ftape/lowlevel/ftape-init.h9
-rw-r--r--drivers/char/ftape/lowlevel/ftape-rw.c9
-rw-r--r--drivers/char/ftape/lowlevel/ftape-tracing.h2
-rw-r--r--drivers/char/ftape/zftape/.cvsignore1
-rw-r--r--drivers/char/ftape/zftape/zftape-init.c37
-rw-r--r--drivers/char/ftape/zftape/zftape-rw.c1
-rw-r--r--drivers/char/ftape/zftape/zftape-rw.h1
-rw-r--r--drivers/char/ftape/zftape/zftape_syms.c1
15 files changed, 49 insertions, 49 deletions
diff --git a/drivers/char/ftape/.cvsignore b/drivers/char/ftape/.cvsignore
index 4671378ae..857dd22e9 100644
--- a/drivers/char/ftape/.cvsignore
+++ b/drivers/char/ftape/.cvsignore
@@ -1 +1,2 @@
.depend
+.*.flags
diff --git a/drivers/char/ftape/compressor/.cvsignore b/drivers/char/ftape/compressor/.cvsignore
index 4671378ae..857dd22e9 100644
--- a/drivers/char/ftape/compressor/.cvsignore
+++ b/drivers/char/ftape/compressor/.cvsignore
@@ -1 +1,2 @@
.depend
+.*.flags
diff --git a/drivers/char/ftape/compressor/Makefile b/drivers/char/ftape/compressor/Makefile
index fde3fd10b..50a7123ac 100644
--- a/drivers/char/ftape/compressor/Makefile
+++ b/drivers/char/ftape/compressor/Makefile
@@ -38,11 +38,6 @@ O_OBJS = zftape-compress.o lzrw3.o
M_OBJS = $(O_TARGET)
-include $(TOPDIR)/Rules.make
-
-#
-# sorry, a special rule.
-#
-lzrw3.o: lzrw3.c
- $(CC) $(CFLAGS) -O6 -funroll-all-loops -c $<
+CFLAGS_lzrw3.o := -O6 -funroll-all-loops
+include $(TOPDIR)/Rules.make
diff --git a/drivers/char/ftape/compressor/zftape-compress.c b/drivers/char/ftape/compressor/zftape-compress.c
index 382b58abe..9eb330f8c 100644
--- a/drivers/char/ftape/compressor/zftape-compress.c
+++ b/drivers/char/ftape/compressor/zftape-compress.c
@@ -31,7 +31,6 @@
char zftc_rev[] = "$Revision: 1.1.6.1 $";
char zftc_dat[] = "$Date: 1997/11/16 15:15:56 $";
-#include <linux/config.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/module.h>
diff --git a/drivers/char/ftape/lowlevel/.cvsignore b/drivers/char/ftape/lowlevel/.cvsignore
index 4671378ae..857dd22e9 100644
--- a/drivers/char/ftape/lowlevel/.cvsignore
+++ b/drivers/char/ftape/lowlevel/.cvsignore
@@ -1 +1,2 @@
.depend
+.*.flags
diff --git a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c
index 47229c5b4..bc00c4e86 100644
--- a/drivers/char/ftape/lowlevel/fdc-io.c
+++ b/drivers/char/ftape/lowlevel/fdc-io.c
@@ -26,6 +26,7 @@
* Linux.
*/
+#include <linux/config.h> /* for CONFIG_FT_* */
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/ioport.h>
@@ -385,7 +386,7 @@ int fdc_issue_command(const __u8 * out_data, int out_count,
int fdc_interrupt_wait(unsigned int time)
{
struct wait_queue wait = {current, NULL};
- int current_blocked = current->blocked;
+ sigset_t old_sigmask;
static int resetting = 0;
TRACE_FUN(ft_t_fdc_dma);
@@ -401,14 +402,23 @@ int fdc_interrupt_wait(unsigned int time)
/* timeout time will be up to USPT microseconds too long ! */
current->timeout = jiffies + (1000 * time + FT_USPT - 1) / FT_USPT;
current->state = TASK_INTERRUPTIBLE;
- current->blocked = _BLOCK_ALL; /* isn't this already set by the
- * high level routines?
- */
+
+ spin_lock_irq(&current->sigmask_lock);
+ old_sigmask = current->blocked;
+ sigfillset(&current->blocked);
+ recalc_sigpending(current);
+ spin_unlock_irq(&current->sigmask_lock);
+
add_wait_queue(&ftape_wait_intr, &wait);
while (!ft_interrupt_seen && current->state != TASK_RUNNING) {
schedule(); /* sets TASK_RUNNING on timeout */
}
- current->blocked = current_blocked; /* restore */
+
+ spin_lock_irq(&current->sigmask_lock);
+ current->blocked = old_sigmask;
+ recalc_sigpending(current);
+ spin_unlock_irq(&current->sigmask_lock);
+
remove_wait_queue(&ftape_wait_intr, &wait);
/* the following IS necessary. True: as well
* wake_up_interruptible() as the schedule() set TASK_RUNNING
diff --git a/drivers/char/ftape/lowlevel/ftape-ctl.c b/drivers/char/ftape/lowlevel/ftape-ctl.c
index 1ce4c2843..05f1f6146 100644
--- a/drivers/char/ftape/lowlevel/ftape-ctl.c
+++ b/drivers/char/ftape/lowlevel/ftape-ctl.c
@@ -794,8 +794,8 @@ void ftape_disable(void)
i, *ft_buffer[i]->address);
}
}
- if ((current->signal & _DONT_BLOCK) &&
- !(current->signal & _NEVER_BLOCK) &&
+ if (sigtestsetmask(&current->signal, _DONT_BLOCK) &&
+ !(sigtestsetmask(&current->signal, _NEVER_BLOCK)) &&
ftape_tape_running) {
TRACE(ft_t_warn,
"Interrupted by fatal signal and tape still running");
diff --git a/drivers/char/ftape/lowlevel/ftape-init.h b/drivers/char/ftape/lowlevel/ftape-init.h
index eae86b3dc..35ae7f94d 100644
--- a/drivers/char/ftape/lowlevel/ftape-init.h
+++ b/drivers/char/ftape/lowlevel/ftape-init.h
@@ -32,12 +32,9 @@
#include <linux/linkage.h>
#include <linux/signal.h>
-#define _S(nr) (1<<((nr)-1))
-#define _NEVER_BLOCK (_S(SIGKILL)|_S(SIGSTOP))
-#define _DONT_BLOCK (_NEVER_BLOCK|_S(SIGINT))
-#define _DO_BLOCK (_S(SIGPIPE))
-#define _BLOCK_ALL (0xffffffffL)
-
+#define _NEVER_BLOCK (sigmask(SIGKILL) | sigmask(SIGSTOP))
+#define _DONT_BLOCK (_NEVER_BLOCK | sigmask(SIGINT))
+#define _DO_BLOCK (sigmask(SIGPIPE))
#ifndef QIC117_TAPE_MAJOR
#define QIC117_TAPE_MAJOR 27
diff --git a/drivers/char/ftape/lowlevel/ftape-rw.c b/drivers/char/ftape/lowlevel/ftape-rw.c
index e3e0243f0..2ae96344e 100644
--- a/drivers/char/ftape/lowlevel/ftape-rw.c
+++ b/drivers/char/ftape/lowlevel/ftape-rw.c
@@ -432,7 +432,8 @@ int ftape_dumb_stop(void)
*/
result = ftape_ready_wait(ftape_timeout.pause,&status);
}
- } while (ftape_tape_running && (current->signal & _NEVER_BLOCK) == 0);
+ } while (ftape_tape_running
+ && !(sigtestsetmask(&current->signal, _NEVER_BLOCK)));
#ifndef TESTING
ft_location.known = 0;
#endif
@@ -660,7 +661,7 @@ static int seek_forward(int segment_id, int fast)
* to find a way to skip an EMPTY_SEGMENT. !!! FIXME !!!
*/
if (ftape_read_id() < 0 || !ft_location.known ||
- (current->signal & _DONT_BLOCK)) {
+ sigtestsetmask(&current->signal, _DONT_BLOCK)) {
ft_location.known = 0;
if (!ftape_tape_running ||
++failures > FT_SECTORS_PER_SEGMENT) {
@@ -775,7 +776,7 @@ static int skip_reverse(int segment_id, int *pstatus)
fast_seek(count, 1);
logical_forward();
if (ftape_read_id() < 0 || !ft_location.known ||
- (current->signal & _DONT_BLOCK)) {
+ (sigtestsetmask(&current->signal, _DONT_BLOCK))) {
if ((!ftape_tape_running && !ft_location.known) ||
++failures > FT_SECTORS_PER_SEGMENT) {
TRACE_ABORT(-EIO, ft_t_err,
@@ -1001,7 +1002,7 @@ int ftape_start_tape(int segment_id, int sector_offset)
while (result < 0 &&
retry++ <= 5 &&
!ft_failure &&
- (current->signal & _DONT_BLOCK) == 0) {
+ !(sigtestsetmask(&current->signal, _DONT_BLOCK))) {
if (retry && start_offset < 5) {
start_offset ++;
diff --git a/drivers/char/ftape/lowlevel/ftape-tracing.h b/drivers/char/ftape/lowlevel/ftape-tracing.h
index ac675568a..7f93942a5 100644
--- a/drivers/char/ftape/lowlevel/ftape-tracing.h
+++ b/drivers/char/ftape/lowlevel/ftape-tracing.h
@@ -171,7 +171,7 @@ extern void ftape_trace_log (const char *file, const char *name);
* but rather into ftape-rw.h (maybe)
*/
#define FT_SIGNAL_EXIT(sig_mask) \
- if (current->signal & (sig_mask)) { \
+ if (sigtestsetmask(&current->signal, sig_mask)) { \
TRACE_ABORT(-EINTR, \
ft_t_warn, \
"interrupted by non-blockable signal"); \
diff --git a/drivers/char/ftape/zftape/.cvsignore b/drivers/char/ftape/zftape/.cvsignore
index 4671378ae..857dd22e9 100644
--- a/drivers/char/ftape/zftape/.cvsignore
+++ b/drivers/char/ftape/zftape/.cvsignore
@@ -1 +1,2 @@
.depend
+.*.flags
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
index c6a4f4506..0c8a6f9eb 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -73,7 +73,7 @@ const ftape_info *zft_status;
/* Local vars.
*/
static int busy_flag = 0;
-static int orig_sigmask;
+static sigset_t orig_sigmask;
/* the interface to the kernel vfs layer
*/
@@ -171,7 +171,7 @@ static int zft_open(struct inode *ino, struct file *filep)
TRACE_ABORT(-ENXIO, ft_t_err, "failed: illegal unit nr");
}
orig_sigmask = current->blocked;
- current->blocked = _BLOCK_ALL;
+ sigfillset(&current->blocked);
result = _zft_open(MINOR(ino->i_rdev), filep->f_flags & O_ACCMODE);
if (result < 0) {
current->blocked = orig_sigmask; /* restore mask */
@@ -186,18 +186,15 @@ static int zft_open(struct inode *ino, struct file *filep)
/* Mask signals that will disturb proper operation of the
* program that is calling.
*/
- current->blocked = orig_sigmask | _DO_BLOCK;
+ current->blocked = orig_sigmask;
+ sigaddsetmask (&current->blocked, _DO_BLOCK);
TRACE_EXIT 0;
}
}
/* Close floppy tape device
*/
-#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,31)
static int zft_close(struct inode *ino, struct file *filep)
-#else
-static void zft_close(struct inode *ino, struct file *filep)
-#endif
{
int result;
TRACE_FUN(ft_t_flow);
@@ -210,7 +207,7 @@ static void zft_close(struct inode *ino, struct file *filep)
TRACE_EXIT; /* keep busy_flag !(?) */
#endif
}
- current->blocked = _BLOCK_ALL;
+ sigfillset(&current->blocked);
result = _zft_close();
if (result < 0) {
TRACE(ft_t_err, "_zft_close failed");
@@ -235,7 +232,7 @@ static int zft_ioctl(struct inode *ino, struct file *filep,
unsigned int command, unsigned long arg)
{
int result = -EIO;
- int old_sigmask;
+ sigset_t old_sigmask;
TRACE_FUN(ft_t_flow);
if (!busy_flag || MINOR(ino->i_rdev) != zft_unit || ft_failure) {
@@ -243,7 +240,7 @@ static int zft_ioctl(struct inode *ino, struct file *filep,
"failed: not busy, failure or wrong unit");
}
old_sigmask = current->blocked; /* save mask */
- current->blocked = _BLOCK_ALL;
+ sigfillset(&current->blocked);
/* This will work as long as sizeof(void *) == sizeof(long) */
result = _zft_ioctl(command, (void *) arg);
current->blocked = old_sigmask; /* restore mask */
@@ -261,7 +258,7 @@ static int zft_mmap(struct inode *ino,
#endif
{
int result = -EIO;
- int old_sigmask;
+ sigset_t old_sigmask;
TRACE_FUN(ft_t_flow);
if (!busy_flag ||
@@ -276,18 +273,14 @@ static int zft_mmap(struct inode *ino,
"failed: not busy, failure or wrong unit");
}
old_sigmask = current->blocked; /* save mask */
- current->blocked = _BLOCK_ALL;
+ sigfillset(&current->blocked);
if ((result = ftape_mmap(vma)) >= 0) {
#ifndef MSYNC_BUG_WAS_FIXED
static struct vm_operations_struct dummy = { NULL, };
vma->vm_ops = &dummy;
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,45)
- vma->vm_dentry = dget(filep->f_dentry);
-#else
- vma_set_inode (vma, ino);
- inode_inc_count (ino);
-#endif
+ vma->vm_file = filep;
+ filep->f_count++;
}
current->blocked = old_sigmask; /* restore mask */
TRACE_EXIT result;
@@ -307,7 +300,7 @@ static int zft_read(struct inode *ino, struct file *fp, char *buff,
#endif
{
int result = -EIO;
- int old_sigmask;
+ sigset_t old_sigmask;
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,60)
struct inode *ino = fp->f_dentry->d_inode;
#endif
@@ -319,7 +312,7 @@ static int zft_read(struct inode *ino, struct file *fp, char *buff,
"failed: not busy, failure or wrong unit");
}
old_sigmask = current->blocked; /* save mask */
- current->blocked = _BLOCK_ALL;
+ sigfillset(&current->blocked);
result = _zft_read(buff, req_len);
current->blocked = old_sigmask; /* restore mask */
TRACE(ft_t_data_flow, "return with count: %d", result);
@@ -343,7 +336,7 @@ static int zft_write(struct inode *ino, struct file *fp, char *buff,
#endif
{
int result = -EIO;
- int old_sigmask;
+ sigset_t old_sigmask;
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,60)
struct inode *ino = fp->f_dentry->d_inode;
#endif
@@ -355,7 +348,7 @@ static int zft_write(struct inode *ino, struct file *fp, char *buff,
"failed: not busy, failure or wrong unit");
}
old_sigmask = current->blocked; /* save mask */
- current->blocked = _BLOCK_ALL;
+ sigfillset(&current->blocked);
result = _zft_write(buff, req_len);
current->blocked = old_sigmask; /* restore mask */
TRACE(ft_t_data_flow, "return with count: %d", result);
diff --git a/drivers/char/ftape/zftape/zftape-rw.c b/drivers/char/ftape/zftape/zftape-rw.c
index d8ae9f1e7..784068096 100644
--- a/drivers/char/ftape/zftape/zftape-rw.c
+++ b/drivers/char/ftape/zftape/zftape-rw.c
@@ -24,6 +24,7 @@
* zftape.
*/
+#include <linux/config.h> /* for CONFIG_ZFT_DFLT_BLK_SZ */
#include <linux/errno.h>
#include <linux/mm.h>
#include <asm/segment.h>
diff --git a/drivers/char/ftape/zftape/zftape-rw.h b/drivers/char/ftape/zftape/zftape-rw.h
index a8622867b..69678229e 100644
--- a/drivers/char/ftape/zftape/zftape-rw.h
+++ b/drivers/char/ftape/zftape/zftape-rw.h
@@ -28,6 +28,7 @@
*
*/
+#include <linux/config.h> /* for CONFIG_ZFT_DFLT_BLK_SZ */
#include "../zftape/zftape-buffers.h"
#define SEGMENTS_PER_TAPE (ft_segments_per_track * ft_tracks_per_tape)
diff --git a/drivers/char/ftape/zftape/zftape_syms.c b/drivers/char/ftape/zftape/zftape_syms.c
index 71b3175a5..09e77bf10 100644
--- a/drivers/char/ftape/zftape/zftape_syms.c
+++ b/drivers/char/ftape/zftape/zftape_syms.c
@@ -24,7 +24,6 @@
* the ftape floppy tape driver exports
*/
-#include <linux/config.h>
#define __NO_VERSION__
#include <linux/module.h>