diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-07-27 06:30:08 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-07-27 06:30:08 -0700 |
| commit | d45db7c22033a7042cabab3cd2f2d72ac53e69b2 (patch) | |
| tree | 0ad8dd14702943aa50bd287142918eb12cfb617c /fs | |
| parent | ddef8ca8d041eb43a20ead6ae500a5e84aa847f3 (diff) | |
| parent | 13243cc58d33a0db19ca8e846fdb66e5ad527e1f (diff) | |
Merge bk://bkbits.ras.ucalgary.ca/rgooch-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/locks.c | 12 | ||||
| -rw-r--r-- | fs/partitions/Config.in | 2 | ||||
| -rw-r--r-- | fs/partitions/msdos.c | 102 |
3 files changed, 8 insertions, 108 deletions
diff --git a/fs/locks.c b/fs/locks.c index cb801127400a..3b606b44e7df 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1242,6 +1242,9 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg) return -EACCES; if (!S_ISREG(inode->i_mode)) return -EINVAL; + error = security_ops->file_lock(filp, arg); + if (error) + return error; lock_kernel(); @@ -1359,8 +1362,7 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd) if (error < 0) goto out_putf; - error = security_ops->file_lock(filp, cmd, - (cmd & LOCK_NB) ? 0 : 1); + error = security_ops->file_lock(filp, lock->fl_type); if (error) goto out_putf; @@ -1494,8 +1496,7 @@ int fcntl_setlk(struct file *filp, unsigned int cmd, struct flock *l) goto out; } - error = security_ops->file_lock(filp, file_lock->fl_type, - cmd == F_SETLKW); + error = security_ops->file_lock(filp, file_lock->fl_type); if (error) goto out; @@ -1618,8 +1619,7 @@ int fcntl_setlk64(struct file *filp, unsigned int cmd, struct flock64 *l) goto out; } - error = security_ops->file_lock(filp, file_lock->fl_type, - cmd == F_SETLKW64); + error = security_ops->file_lock(filp, file_lock->fl_type); if (error) goto out; diff --git a/fs/partitions/Config.in b/fs/partitions/Config.in index eff56b137b0a..415ac1a6c45c 100644 --- a/fs/partitions/Config.in +++ b/fs/partitions/Config.in @@ -25,7 +25,7 @@ if [ "$CONFIG_PARTITION_ADVANCED" = "y" ]; then bool ' Solaris (x86) partition table support' CONFIG_SOLARIS_X86_PARTITION bool ' Unixware slices support' CONFIG_UNIXWARE_DISKLABEL fi - dep_bool ' Windows Logical Disk Manager (Dynamic Disk) support' CONFIG_LDM_PARTITION + bool ' Windows Logical Disk Manager (Dynamic Disk) support' CONFIG_LDM_PARTITION if [ "$CONFIG_LDM_PARTITION" = "y" ]; then bool ' Windows LDM extra logging' CONFIG_LDM_DEBUG fi diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index 5d0bb6074fe4..61b0bc9bc02b 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c @@ -385,87 +385,6 @@ static struct { {SOLARIS_X86_PARTITION, parse_solaris_x86}, {0, NULL}, }; -/* - * Look for various forms of IDE disk geometry translation - */ -static int handle_ide_mess(struct block_device *bdev) -{ -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) - Sector sect; - unsigned char *data; - kdev_t dev = to_kdev_t(bdev->bd_dev); - unsigned int sig; - int heads = 0; - struct partition *p; - int i; -#ifdef CONFIG_BLK_DEV_IDE_MODULE - if (!ide_xlate_1024) - return 1; -#endif - /* - * The i386 partition handling programs very often - * make partitions end on cylinder boundaries. - * There is no need to do so, and Linux fdisk doesn't always - * do this, and Windows NT on Alpha doesn't do this either, - * but still, this helps to guess #heads. - */ - data = read_dev_sector(bdev, 0, §); - if (!data) - return -1; - if (!msdos_magic_present(data + 510)) { - put_dev_sector(sect); - return 0; - } - sig = le16_to_cpu(*(unsigned short *)(data + 2)); - p = (struct partition *) (data + 0x1be); - for (i = 0; i < 4; i++) { - struct partition *q = &p[i]; - if (NR_SECTS(q)) { - if ((q->sector & 63) == 1 && - (q->end_sector & 63) == 63) - heads = q->end_head + 1; - break; - } - } - if (SYS_IND(p) == EZD_PARTITION) { - /* - * Accesses to sector 0 must go to sector 1 instead. - */ - if (ide_xlate_1024(dev, -1, heads, " [EZD]")) - goto reread; - } else if (SYS_IND(p) == DM6_PARTITION) { - - /* - * Everything on the disk is offset by 63 sectors, - * including a "new" MBR with its own partition table. - */ - if (ide_xlate_1024(dev, 1, heads, " [DM6:DDO]")) - goto reread; - } else if (sig <= 0x1ae && - data[sig] == 0xAA && data[sig+1] == 0x55 && - (data[sig+2] & 1)) { - /* DM6 signature in MBR, courtesy of OnTrack */ - (void) ide_xlate_1024 (dev, 0, heads, " [DM6:MBR]"); - } else if (SYS_IND(p) == DM6_AUX1PARTITION || - SYS_IND(p) == DM6_AUX3PARTITION) { - /* - * DM6 on other than the first (boot) drive - */ - (void) ide_xlate_1024(dev, 0, heads, " [DM6:AUX]"); - } else { - (void) ide_xlate_1024(dev, 2, heads, " [PTBL]"); - } - put_dev_sector(sect); - return 1; - -reread: - put_dev_sector(sect); - /* Flush the cache */ - invalidate_bdev(bdev, 1); - truncate_inode_pages(bdev->bd_inode->i_mapping, 0); -#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */ - return 1; -} int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) { @@ -474,11 +393,7 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) unsigned char *data; struct partition *p; int slot; - int err; - err = handle_ide_mess(bdev); - if (err <= 0) - return err; data = read_dev_sector(bdev, 0, §); if (!data) return -1; @@ -524,21 +439,6 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) state->parts[slot].flags = 1; } - /* - * Check for old-style Disk Manager partition table - */ - if (msdos_magic_present(data + 0xfc)) { - p = (struct partition *) (0x1be + data); - for (slot = 4 ; slot < 16 ; slot++, state->next++) { - p--; - if (state->next == state->limit) - break; - if (!(START_SECT(p) && NR_SECTS(p))) - continue; - put_partition(state, state->next, - START_SECT(p), NR_SECTS(p)); - } - } printk("\n"); /* second pass - output for each on a separate line */ @@ -556,7 +456,7 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) if (!subtypes[n].parse) continue; subtypes[n].parse(state, bdev, START_SECT(p)*sector_size, - NR_SECTS(p)*sector_size, n); + NR_SECTS(p)*sector_size, slot); } put_dev_sector(sect); return 1; |
