diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-05 06:47:02 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-05 06:47:02 +0000 |
commit | 99a7e12f34b3661a0d1354eef83a0eef4df5e34c (patch) | |
tree | 3560aca9ca86792f9ab7bd87861ea143a1b3c7a3 /fs/udf | |
parent | e73a04659c0b8cdee4dd40e58630e2cf63afb316 (diff) |
Merge with Linux 2.3.38.
Diffstat (limited to 'fs/udf')
-rw-r--r-- | fs/udf/balloc.c | 4 | ||||
-rw-r--r-- | fs/udf/dir.c | 2 | ||||
-rw-r--r-- | fs/udf/file.c | 25 | ||||
-rw-r--r-- | fs/udf/inode.c | 11 | ||||
-rw-r--r-- | fs/udf/lowlevel.c | 104 | ||||
-rw-r--r-- | fs/udf/namei.c | 19 | ||||
-rw-r--r-- | fs/udf/super.c | 4 | ||||
-rw-r--r-- | fs/udf/udfdecl.h | 4 |
8 files changed, 47 insertions, 126 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index 03e66fe23..41274039d 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c @@ -104,7 +104,7 @@ static int read_block_bitmap(struct super_block * sb, unsigned int block, return retval; } -static int load__block_bitmap(struct super_block * sb, unsigned int block_group) +static int __load_block_bitmap(struct super_block * sb, unsigned int block_group) { int i, j, retval = 0; unsigned long block_bitmap_number; @@ -188,7 +188,7 @@ static inline int load_block_bitmap(struct super_block *sb, } else { - slot = load__block_bitmap(sb, block_group); + slot = __load_block_bitmap(sb, block_group); } if (slot < 0) diff --git a/fs/udf/dir.c b/fs/udf/dir.c index 84218eb14..7b7d065ff 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -62,8 +62,6 @@ static struct file_operations udf_dir_operations = { NULL, /* release */ udf_sync_file, /* fsync */ NULL, /* fasync */ - NULL, /* check_media_change */ - NULL, /* revalidate */ NULL /* lock */ }; diff --git a/fs/udf/file.c b/fs/udf/file.c index 2e17d81d4..81cddaa3f 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c @@ -46,31 +46,23 @@ static loff_t udf_file_llseek(struct file *, loff_t, int); static ssize_t udf_file_read_adinicb (struct file *, char *, size_t, loff_t *); static ssize_t udf_file_write (struct file *, const char *, size_t, loff_t *); -#if BITS_PER_LONG < 64 static int udf_open_file(struct inode *, struct file *); -#endif static int udf_release_file(struct inode *, struct file *); static struct file_operations udf_file_operations = { udf_file_llseek, /* llseek */ generic_file_read, /* read */ udf_file_write, /* write */ - NULL, /* readdir */ - NULL, /* poll */ - udf_ioctl, /* ioctl */ + NULL, /* readdir */ + NULL, /* poll */ + udf_ioctl, /* ioctl */ generic_file_mmap, /* mmap */ -#if BITS_PER_LONG == 64 - NULL, /* open */ -#else udf_open_file, /* open */ -#endif - NULL, /* flush */ + NULL, /* flush */ udf_release_file, /* release */ udf_sync_file, /* fsync */ - NULL, /* fasync */ - NULL, /* check_media_change */ - NULL, /* revalidate */ - NULL /* lock */ + NULL, /* fasync */ + NULL /* lock */ }; struct inode_operations udf_file_inode_operations = { @@ -111,8 +103,6 @@ static struct file_operations udf_file_operations_adinicb = { udf_release_file, /* release */ udf_sync_file, /* fsync */ NULL, /* fasync */ - NULL, /* check_media_change */ - NULL, /* revalidate */ NULL /* lock */ }; @@ -426,7 +416,6 @@ static int udf_release_file(struct inode * inode, struct file * filp) return 0; } -#if BITS_PER_LONG < 64 /* * udf_open_file * @@ -435,6 +424,7 @@ static int udf_release_file(struct inode * inode, struct file * filp) * * DESCRIPTION * Use this to disallow opening RW large files on 32 bit systems. + * On 64 bit systems we force on O_LARGEFILE in sys_open. * * HISTORY * @@ -445,4 +435,3 @@ static int udf_open_file(struct inode * inode, struct file * filp) return -EFBIG; return 0; } -#endif diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 05e03def5..e2e12df8e 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1147,19 +1147,18 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) } case FILE_TYPE_BLOCK: { - inode->i_op = &blkdev_inode_operations; inode->i_mode |= S_IFBLK; break; } case FILE_TYPE_CHAR: { - inode->i_op = &chrdev_inode_operations; inode->i_mode |= S_IFCHR; break; } case FILE_TYPE_FIFO: { - init_fifo(inode); + init_special_inode(inode, inode->i_mode | S_IFIFO, 0); + break; } case FILE_TYPE_SYMLINK: { @@ -1185,9 +1184,9 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) if (dsea) { - inode->i_rdev = to_kdev_t( - (le32_to_cpu(dsea->majorDeviceIdent)) << 8) | - (le32_to_cpu(dsea->minorDeviceIdent) & 0xFF); + init_special_inode(inode, inode->i_mode, + ((le32_to_cpu(dsea->majorDeviceIdent)) << 8) | + (le32_to_cpu(dsea->minorDeviceIdent) & 0xFF)); /* Developer ID ??? */ udf_release_data(tbh); } diff --git a/fs/udf/lowlevel.c b/fs/udf/lowlevel.c index 0f763b5d1..dee98ad71 100644 --- a/fs/udf/lowlevel.c +++ b/fs/udf/lowlevel.c @@ -38,60 +38,36 @@ typedef struct scsi_cmnd Scsi_Cmnd; #include "udf_sb.h" unsigned int -udf_get_last_session(kdev_t dev) +udf_get_last_session(struct super_block *sb) { struct cdrom_multisession ms_info; unsigned int vol_desc_start; - struct inode inode_fake; - extern struct file_operations * get_blkfops(unsigned int); + struct block_device *bdev = sb->s_bdev; int i; vol_desc_start=0; - if (get_blkfops(MAJOR(dev))->ioctl!=NULL) - { - /* Whoops. We must save the old FS, since otherwise - * we would destroy the kernels idea about FS on root - * mount in read_super... [chexum] - */ - mm_segment_t old_fs=get_fs(); - inode_fake.i_rdev=dev; - ms_info.addr_format=CDROM_LBA; - set_fs(KERNEL_DS); - i=get_blkfops(MAJOR(dev))->ioctl(&inode_fake, - NULL, - CDROMMULTISESSION, - (unsigned long) &ms_info); - set_fs(old_fs); - + ms_info.addr_format=CDROM_LBA; + i=ioctl_by_bdev(bdev, CDROMMULTISESSION, (unsigned long) &ms_info); #define WE_OBEY_THE_WRITTEN_STANDARDS 1 - - if (i == 0) - { - udf_debug("XA disk: %s, vol_desc_start=%d\n", - (ms_info.xa_flag ? "yes" : "no"), ms_info.addr.lba); + if (i == 0) { + udf_debug("XA disk: %s, vol_desc_start=%d\n", + (ms_info.xa_flag ? "yes" : "no"), ms_info.addr.lba); #if WE_OBEY_THE_WRITTEN_STANDARDS - if (ms_info.xa_flag) /* necessary for a valid ms_info.addr */ + if (ms_info.xa_flag) /* necessary for a valid ms_info.addr */ #endif - vol_desc_start = ms_info.addr.lba; - } - else - { - udf_debug("CDROMMULTISESSION not supported: rc=%d\n", i); - } - } - else - { - udf_debug("Device doesn't know how to ioctl?\n"); + vol_desc_start = ms_info.addr.lba; + } else { + udf_debug("CDROMMULTISESSION not supported: rc=%d\n", i); } return vol_desc_start; } unsigned int -udf_get_last_block(kdev_t dev, int *flags) +udf_get_last_block(struct super_block *sb, int *flags) { extern int *blksize_size[]; - struct inode inode_fake; - extern struct file_operations * get_blkfops(unsigned int); + kdev_t dev = sb->s_dev; + struct block_device *bdev = sb->s_bdev; int ret; unsigned long lblock; unsigned int hbsize = get_hardblocksize(dev); @@ -107,44 +83,20 @@ udf_get_last_block(kdev_t dev, int *flags) else if (hbsize > secsize) div = hbsize / secsize; - if (get_blkfops(MAJOR(dev))->ioctl!=NULL) - { - /* Whoops. We must save the old FS, since otherwise - * we would destroy the kernels idea about FS on root - * mount in read_super... [chexum] - */ - mm_segment_t old_fs=get_fs(); - inode_fake.i_rdev=dev; - set_fs(KERNEL_DS); - - lblock = 0; - ret = get_blkfops(MAJOR(dev))->ioctl(&inode_fake, - NULL, - BLKGETSIZE, - (unsigned long) &lblock); - - if (!ret && lblock != 0x7FFFFFFF) /* Hard Disk */ - { - if (mult) - lblock *= mult; - else if (div) - lblock /= div; - } - else /* CDROM */ - { - ret = get_blkfops(MAJOR(dev))->ioctl(&inode_fake, - NULL, - CDROM_LAST_WRITTEN, - (unsigned long) &lblock); - } - - set_fs(old_fs); - if (!ret && lblock) - return lblock - 1; - } - else - { - udf_debug("Device doesn't know how to ioctl?\n"); + lblock = 0; + ret = ioctl_by_bdev(bdev, BLKGETSIZE, (unsigned long) &lblock); + + if (!ret && lblock != 0x7FFFFFFF) { + /* Hard Disk */ + if (mult) + lblock *= mult; + else if (div) + lblock /= div; + } else { + /* CDROM */ + ret = ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock); } + if (!ret && lblock) + return lblock - 1; return 0; } diff --git a/fs/udf/namei.c b/fs/udf/namei.c index ea921eeb3..ebf344832 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -702,24 +702,7 @@ int udf_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev) mark_inode_dirty(dir); dir->i_version = ++event; } - if (S_ISREG(inode->i_mode)) - { - inode->i_op = &udf_file_inode_operations; - } - else if (S_ISCHR(inode->i_mode)) - { - inode->i_op = &chrdev_inode_operations; - } - else if (S_ISBLK(inode->i_mode)) - { - inode->i_op = &blkdev_inode_operations; - } - else if (S_ISFIFO(inode->i_mode)) - { - init_fifo(inode); - } - if (S_ISBLK(mode) || S_ISCHR(mode)) - inode->i_rdev = to_kdev_t(rdev); + init_special_inode(inode, mode, rdev); mark_inode_dirty(inode); if (fibh.sbh != fibh.ebh) diff --git a/fs/udf/super.c b/fs/udf/super.c index 31fecbde2..aba702b57 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1335,14 +1335,14 @@ udf_read_super(struct super_block *sb, void *options, int silent) goto error_out; if ( uopt.session == 0xFFFFFFFF ) - UDF_SB_SESSION(sb) = udf_get_last_session(sb->s_dev); + UDF_SB_SESSION(sb) = udf_get_last_session(sb); else UDF_SB_SESSION(sb) = uopt.session; udf_debug("Multi-session=%d\n", UDF_SB_SESSION(sb)); if ( uopt.lastblock == 0xFFFFFFFF ) - UDF_SB_LASTBLOCK(sb) = udf_get_last_block(sb->s_dev, &(UDF_SB(sb)->s_flags)); + UDF_SB_LASTBLOCK(sb) = udf_get_last_block(sb, &(UDF_SB(sb)->s_flags)); else UDF_SB_LASTBLOCK(sb) = uopt.lastblock; diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index 48dec10c5..f50ca705c 100644 --- a/fs/udf/udfdecl.h +++ b/fs/udf/udfdecl.h @@ -158,8 +158,8 @@ extern struct buffer_head *udf_read_untagged(struct super_block *, Uint32, Uint3 extern void udf_release_data(struct buffer_head *); /* lowlevel.c */ -extern unsigned int udf_get_last_session(kdev_t); -extern unsigned int udf_get_last_block(kdev_t, int *); +extern unsigned int udf_get_last_session(struct super_block *); +extern unsigned int udf_get_last_block(struct super_block *, int *); /* partition.c */ extern Uint32 udf_get_pblock(struct super_block *, Uint32, Uint16, Uint32); |