Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.4.17-rc2 /fs/super.c

Filename:/fs/super.c
Lines Added:6
Lines Deleted:2
Also changed in: (Previous) 2.4.16  2.4.16-pre1  2.4.15-greased-turkey  2.4.15-pre9  2.4.14  2.4.14-pre8 
(Following) 2.4.17  2.4.18-pre5  2.4.18-pre6  2.4.18-pre7  2.4.18-pre8  2.4.18-pre9 

Location
[  2.4.17-rc2
  [  fs
     o  super.c

Patch

diff -Naur -X /home/marcelo/lib/dontdiff linux-2.4.16/fs/super.c linux/fs/super.c
--- linux-2.4.16/fs/super.c   Mon Nov 26 13:29:17 2001
+++ linux/fs/super.c   Tue Dec 18 20:13:28 2001
@@ -537,6 +537,7 @@
    struct inode *inode;
    struct block_device *bdev;
    struct block_device_operations *bdops;
+   devfs_handle_t de;
    struct super_block * s;
    struct nameidata nd;
    struct list_head *p;
@@ -560,13 +561,15 @@
       goto out;
    bd_acquire(inode);
    bdev = inode->i_bdev;
-   bdops = devfs_get_ops ( devfs_get_handle_from_inode (inode) );
+   de = devfs_get_handle_from_inode (inode);
+   bdops = devfs_get_ops (de);         /*  Increments module use count  */
    if (bdops) bdev->bd_op = bdops;
    /* Done with lookups, semaphore down */
    dev = to_kdev_t(bdev->bd_dev);
    if (!(flags & MS_RDONLY))
       mode |= FMODE_WRITE;
    error = blkdev_get(bdev, mode, 0, BDEV_FS);
+   devfs_put_ops (de);   /*  Decrement module use count now we're safe  */
    if (error)
       goto out;
    check_disk_change(dev);
@@ -999,12 +1002,13 @@
    bdev = bdget(kdev_t_to_nr(ROOT_DEV));
    if (!bdev)
       panic(__FUNCTION__ ": unable to allocate root device");
-   bdev->bd_op = devfs_get_ops (handle);
+   bdev->bd_op = devfs_get_ops (handle); /* Increments module use count */
    path_start = devfs_generate_path (handle, path + 5, sizeof (path) - 5);
    mode = FMODE_READ;
    if (!(root_mountflags & MS_RDONLY))
       mode |= FMODE_WRITE;
    retval = blkdev_get(bdev, mode, 0, BDEV_FS);
+   devfs_put_ops (handle); /* Decrement module use count now we're safe */
    if (retval == -EROFS) {
       root_mountflags |= MS_RDONLY;
       goto retry;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.