patch-2.3.43 linux/fs/coda/psdev.c

Next file: linux/fs/coda/symlink.c
Previous file: linux/fs/coda/pioctl.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.42/linux/fs/coda/psdev.c linux/fs/coda/psdev.c
@@ -76,6 +76,21 @@
 	return mask;
 }
 
+static int coda_psdev_ioctl(struct inode * inode, struct file * filp, 
+			    unsigned int cmd, unsigned long arg)
+{
+	unsigned int data;
+
+	switch(cmd) {
+	case CIOC_KERNEL_VERSION:
+		data = CODA_KERNEL_VERSION;
+		return put_user(data, (int *) arg);
+	default:
+		return -ENOTTY;
+	}
+
+	return 0;
+}
 
 /*
  *	Receive a message written by Venus to the psdev
@@ -246,7 +261,6 @@
 	vcp->vc_inuse++;
 	MOD_INC_USE_COUNT;
 
-
 	if ( file->f_flags == O_RDWR ) {
 		vcp->vc_pid = current->pid;
 		vcp->vc_seq = 0;
@@ -262,7 +276,6 @@
 }
 
 
-
 static int coda_psdev_release(struct inode * inode, struct file * file)
 {
         struct venus_comm *vcp = &coda_upc_comm;
@@ -298,6 +311,7 @@
 			CODA_FREE(req, (u_int)sizeof(struct upc_req));
 			continue;
 		}
+		req->uc_flags |= REQ_ABORT;
 		wake_up(&req->uc_sleep);
         }
         
@@ -305,6 +319,7 @@
 	CDEBUG(D_PSDEV, "wake up processing clients\n");
 	while ( (lh = lh->next) != &vcp->vc_processing) {
 		req = list_entry(lh, struct upc_req, uc_chain);
+		req->uc_flags |= REQ_ABORT;
 	        wake_up(&req->uc_sleep);
         }
 	CDEBUG(D_PSDEV, "Done.\n");
@@ -315,19 +330,12 @@
 
 
 static struct file_operations coda_psdev_fops = {
-      NULL,                  /* llseek */
-      coda_psdev_read,       /* read */
-      coda_psdev_write,      /* write */
-      NULL,		     /* coda_psdev_readdir */
-      coda_psdev_poll,       /* poll */
-      NULL,                  /* ioctl */
-      NULL,		     /* coda_psdev_mmap */
-      coda_psdev_open,       /* open */
-      NULL,
-      coda_psdev_release,    /* release */
-      NULL,                  /* fsync */
-      NULL,                  /* fasync */
-      NULL                   /* lock */
+	read:		coda_psdev_read,
+	write:		coda_psdev_write,
+	poll:		coda_psdev_poll,
+	ioctl:		coda_psdev_ioctl,
+	open:		coda_psdev_open,
+	release:	coda_psdev_release,
 };
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)