X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fs390%2Fchar%2Ftape_char.c;h=b830a8cbef7873baca2b68f886df21e0c044855e;hb=0b662c64840fb281e5948ab6f9d60f84817277d0;hp=97f75237bed6cbc3b2d64767a8e915e4eeee6740;hpb=b197ba3c70638a3a2ae39296781912f26ac0f991;p=linux-2.6-omap-h63xx.git diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 97f75237bed..b830a8cbef7 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c @@ -3,7 +3,7 @@ * character device frontend for tape device driver * * S390 and zSeries version - * Copyright (C) 2001,2002 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Copyright IBM Corp. 2001,2006 * Author(s): Carsten Otte * Michael Holzheu * Tuan Ngo-Anh @@ -39,7 +39,7 @@ static int tapechar_ioctl(struct inode *, struct file *, unsigned int, static long tapechar_compat_ioctl(struct file *, unsigned int, unsigned long); -static struct file_operations tape_fops = +static const struct file_operations tape_fops = { .owner = THIS_MODULE, .read = tapechar_read, @@ -89,22 +89,7 @@ tapechar_cleanup_device(struct tape_device *device) device->nt = NULL; } -/* - * Terminate write command (we write two TMs and skip backward over last) - * This ensures that the tape is always correctly terminated. - * When the user writes afterwards a new file, he will overwrite the - * second TM and therefore one TM will remain to separate the - * two files on the tape... - */ -static inline void -tapechar_terminate_write(struct tape_device *device) -{ - if (tape_mtop(device, MTWEOF, 1) == 0 && - tape_mtop(device, MTWEOF, 1) == 0) - tape_mtop(device, MTBSR, 1); -} - -static inline int +static int tapechar_check_idalbuffer(struct tape_device *device, size_t block_size) { struct idal_buffer *new; @@ -137,7 +122,7 @@ tapechar_check_idalbuffer(struct tape_device *device, size_t block_size) /* * Tape device read function */ -ssize_t +static ssize_t tapechar_read(struct file *filp, char __user *data, size_t count, loff_t *ppos) { struct tape_device *device; @@ -201,7 +186,7 @@ tapechar_read(struct file *filp, char __user *data, size_t count, loff_t *ppos) /* * Tape device write function */ -ssize_t +static ssize_t tapechar_write(struct file *filp, const char __user *data, size_t count, loff_t *ppos) { struct tape_device *device; @@ -291,20 +276,20 @@ tapechar_write(struct file *filp, const char __user *data, size_t count, loff_t /* * Character frontend tape device open function. */ -int +static int tapechar_open (struct inode *inode, struct file *filp) { struct tape_device *device; int minor, rc; DBF_EVENT(6, "TCHAR:open: %i:%i\n", - imajor(filp->f_dentry->d_inode), - iminor(filp->f_dentry->d_inode)); + imajor(filp->f_path.dentry->d_inode), + iminor(filp->f_path.dentry->d_inode)); - if (imajor(filp->f_dentry->d_inode) != tapechar_major) + if (imajor(filp->f_path.dentry->d_inode) != tapechar_major) return -ENODEV; - minor = iminor(filp->f_dentry->d_inode); + minor = iminor(filp->f_path.dentry->d_inode); device = tape_get_device(minor / TAPE_MINORS_PER_DEV); if (IS_ERR(device)) { DBF_EVENT(3, "TCHAR:open: tape_get_device() failed\n"); @@ -326,7 +311,7 @@ tapechar_open (struct inode *inode, struct file *filp) * Character frontend tape device release function. */ -int +static int tapechar_release(struct inode *inode, struct file *filp) { struct tape_device *device;