diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-08-25 09:12:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-08-25 09:12:35 +0000 |
commit | c7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch) | |
tree | 3682407a599b8f9f03fc096298134cafba1c9b2f /fs/umsdos/file.c | |
parent | 1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff) |
o Merge with Linux 2.1.116.
o New Newport console code.
o New G364 console code.
Diffstat (limited to 'fs/umsdos/file.c')
-rw-r--r-- | fs/umsdos/file.c | 136 |
1 files changed, 71 insertions, 65 deletions
diff --git a/fs/umsdos/file.c b/fs/umsdos/file.c index b7f58a2b9..a9267e122 100644 --- a/fs/umsdos/file.c +++ b/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 @@ struct inode_operations umsdos_file_inode_operations = { }; /* 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 @@ struct inode_operations umsdos_file_inode_operations_no_bmap = { NULL, /* mknod */ NULL, /* rename */ NULL, /* readlink */ - NULL, /* follow link */ + NULL, /* follow link */ NULL, /* readpage */ NULL, /* writepage */ NULL, /* bmap */ @@ -145,20 +150,22 @@ struct inode_operations umsdos_file_inode_operations_no_bmap = { }; /* 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 @@ struct inode_operations umsdos_file_inode_operations_readpage = { NULL, /* mknod */ NULL, /* rename */ NULL, /* readlink */ - NULL, /* follow link */ + NULL, /* follow link */ fat_readpage, /* readpage */ NULL, /* writepage */ NULL, /* bmap */ @@ -178,4 +185,3 @@ struct inode_operations umsdos_file_inode_operations_readpage = { NULL, /* permission */ NULL, /* smap */ }; - |