patch-2.1.103 linux/fs/umsdos/file.c

Next file: linux/fs/umsdos/inode.c
Previous file: linux/fs/umsdos/emd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.102/linux/fs/umsdos/file.c linux/fs/umsdos/file.c
@@ -2,7 +2,7 @@
  *  linux/fs/umsdos/file.c
  *
  *  Written 1993 by Jacques Gelinas
- *	inspired from linux/fs/msdos/file.c Werner Almesberger
+ *      inspired from linux/fs/msdos/file.c Werner Almesberger
  *
  *  Extended MS-DOS regular file handling primitives
  */
@@ -24,71 +24,74 @@
 
 
 /*
-	Read a file into user space memory
-*/
-static ssize_t UMSDOS_file_read(
-	struct file *filp,
-	char *buf,
-	size_t  count,
-	loff_t *ppos
-	)
+ * Read a file into user space memory
+ */
+static ssize_t UMSDOS_file_read (
+					struct file *filp,
+					char *buf,
+					size_t count,
+					loff_t * ppos
+)
 {
-	struct dentry * dentry = filp->f_dentry;
+	struct dentry *dentry = filp->f_dentry;
 	struct inode *inode = dentry->d_inode;
-	
+
 	/* We have to set the access time because msdos don't care */
 	/* FIXME */
-	int ret = fat_file_read(filp,buf,count,ppos);
-	if (!IS_RDONLY(inode)){
+	int ret = fat_file_read (filp, buf, count, ppos);
+
+	if (!IS_RDONLY (inode)) {
 		inode->i_atime = CURRENT_TIME;
 		/* FIXME 
-		inode->i_dirt = 1;
-		*/
+		 * inode->i_dirt = 1;
+		 */
 	}
 	return ret;
 }
 
 
 /*
-	Write a file from user space memory
-*/
-static ssize_t UMSDOS_file_write(
-	struct file *filp,
-	const char *buf,
-	size_t count,
-	loff_t *ppos)
+ * Write a file from user space memory
+ */
+static ssize_t UMSDOS_file_write (
+					 struct file *filp,
+					 const char *buf,
+					 size_t count,
+					 loff_t * ppos)
 {
-	return fat_file_write(filp,buf,count,ppos);
+	return fat_file_write (filp, buf, count, ppos);
 }
 
 
 /*
-	Truncate a file to 0 length.
-*/
-static void UMSDOS_truncate(struct inode *inode)
+ * Truncate a file to 0 length.
+ */
+static void UMSDOS_truncate (struct inode *inode)
 {
 	Printk (("UMSDOS_truncate\n"));
 	fat_truncate (inode);
 	inode->i_ctime = inode->i_mtime = CURRENT_TIME;
-	
-	/*FIXME	inode->i_dirt = 1; */
+
+	/*FIXME inode->i_dirt = 1; */
 }
 
 /* Function for normal file system (512 bytes hardware sector size) */
-struct file_operations umsdos_file_operations = {
-	NULL,				/* lseek - default */
+struct file_operations umsdos_file_operations =
+{
+	NULL,			/* lseek - default */
 	UMSDOS_file_read,	/* read */
 	UMSDOS_file_write,	/* write */
-	NULL,				/* readdir - bad */
-	NULL,				/* poll - default */
-	NULL,				/* ioctl - default */
-	generic_file_mmap,		/* mmap */
-	NULL,				/* no special open is needed */
-	NULL,				/* release */
-	file_fsync			/* fsync */
+	NULL,			/* readdir - bad */
+	NULL,			/* poll - default */
+	NULL,			/* ioctl - default */
+	generic_file_mmap,	/* mmap */
+	NULL,			/* no special open is needed */
+	NULL,			/* release */
+	file_fsync		/* fsync */
 };
 
-struct inode_operations umsdos_file_inode_operations = {
+struct inode_operations umsdos_file_inode_operations =
+{
 	&umsdos_file_operations,	/* default file operations */
 	NULL,			/* create */
 	NULL,			/* lookup */
@@ -110,20 +113,22 @@
 };
 
 /* For other with larger and unaligned file system */
-struct file_operations umsdos_file_operations_no_bmap = {
-	NULL,				/* lseek - default */
-	UMSDOS_file_read,		/* read */
-	UMSDOS_file_write,		/* write */
-	NULL,				/* readdir - bad */
-	NULL,				/* poll - default */
-	NULL,				/* ioctl - default */
-	fat_mmap,			/* mmap */
-	NULL,				/* no special open is needed */
-	NULL,				/* release */
-	file_fsync			/* fsync */
+struct file_operations umsdos_file_operations_no_bmap =
+{
+	NULL,			/* lseek - default */
+	UMSDOS_file_read,	/* read */
+	UMSDOS_file_write,	/* write */
+	NULL,			/* readdir - bad */
+	NULL,			/* poll - default */
+	NULL,			/* ioctl - default */
+	fat_mmap,		/* mmap */
+	NULL,			/* no special open is needed */
+	NULL,			/* release */
+	file_fsync		/* fsync */
 };
 
-struct inode_operations umsdos_file_inode_operations_no_bmap = {
+struct inode_operations umsdos_file_inode_operations_no_bmap =
+{
 	&umsdos_file_operations_no_bmap,	/* default file operations */
 	NULL,			/* create */
 	NULL,			/* lookup */
@@ -135,7 +140,7 @@
 	NULL,			/* mknod */
 	NULL,			/* rename */
 	NULL,			/* readlink */
-	NULL,                   /* follow link */
+	NULL,			/* follow link */
 	NULL,			/* readpage */
 	NULL,			/* writepage */
 	NULL,			/* bmap */
@@ -145,20 +150,22 @@
 };
 
 /* For other with larger and unaligned file system with readpage */
-struct file_operations umsdos_file_operations_readpage = {
-	NULL,				/* lseek - default */
-	UMSDOS_file_read,		/* read */
-	UMSDOS_file_write,		/* write */
-	NULL,				/* readdir - bad */
-	NULL,				/* poll - default */
-	NULL,				/* ioctl - default */
-	generic_file_mmap,		/* mmap */
-	NULL,				/* no special open is needed */
-	NULL,				/* release */
-	file_fsync			/* fsync */
+struct file_operations umsdos_file_operations_readpage =
+{
+	NULL,			/* lseek - default */
+	UMSDOS_file_read,	/* read */
+	UMSDOS_file_write,	/* write */
+	NULL,			/* readdir - bad */
+	NULL,			/* poll - default */
+	NULL,			/* ioctl - default */
+	generic_file_mmap,	/* mmap */
+	NULL,			/* no special open is needed */
+	NULL,			/* release */
+	file_fsync		/* fsync */
 };
 
-struct inode_operations umsdos_file_inode_operations_readpage = {
+struct inode_operations umsdos_file_inode_operations_readpage =
+{
 	&umsdos_file_operations_readpage,	/* default file operations */
 	NULL,			/* create */
 	NULL,			/* lookup */
@@ -170,7 +177,7 @@
 	NULL,			/* mknod */
 	NULL,			/* rename */
 	NULL,			/* readlink */
-	NULL,                   /* follow link */
+	NULL,			/* follow link */
 	fat_readpage,		/* readpage */
 	NULL,			/* writepage */
 	NULL,			/* bmap */
@@ -178,4 +185,3 @@
 	NULL,			/* permission */
 	NULL,			/* smap */
 };
-

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov