root/fs/super.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. register_filesystem
  2. unregister_filesystem
  3. fs_index
  4. fs_name
  5. fs_maxindex
  6. sys_sysfs
  7. get_filesystem_list
  8. get_fs_type
  9. __wait_on_super
  10. sync_supers
  11. get_super
  12. put_super
  13. read_super
  14. get_unnamed_dev
  15. put_unnamed_dev
  16. do_umount
  17. sys_umount
  18. do_mount
  19. do_remount_sb
  20. do_remount
  21. copy_mount_options
  22. sys_mount
  23. mount_root

   1 /*
   2  *  linux/fs/super.c
   3  *
   4  *  Copyright (C) 1991, 1992  Linus Torvalds
   5  */
   6 
   7 /*
   8  * super.c contains code to handle the super-block tables.
   9  */
  10 #include <stdarg.h>
  11 
  12 #include <linux/config.h>
  13 #include <linux/sched.h>
  14 #include <linux/kernel.h>
  15 #include <linux/major.h>
  16 #include <linux/stat.h>
  17 #include <linux/errno.h>
  18 #include <linux/string.h>
  19 #include <linux/locks.h>
  20 
  21 #include <asm/system.h>
  22 #include <asm/segment.h>
  23 #include <asm/bitops.h>
  24  
  25 extern struct file_operations * get_blkfops(unsigned int);
  26 extern struct file_operations * get_chrfops(unsigned int);
  27 
  28 extern void wait_for_keypress(void);
  29 extern void fcntl_init_locks(void);
  30 
  31 extern int root_mountflags;
  32 
  33 struct super_block super_blocks[NR_SUPER];
  34 
  35 static int do_remount_sb(struct super_block *sb, int flags, char * data);
  36 
  37 /* this is initialized in init/main.c */
  38 dev_t ROOT_DEV = 0;
  39 
  40 static struct file_system_type * file_systems = NULL;
  41 
  42 int register_filesystem(struct file_system_type * fs)
     /* [previous][next][first][last][top][bottom][index][help] */
  43 {
  44         struct file_system_type ** tmp;
  45 
  46         if (!fs)
  47                 return -EINVAL;
  48         if (fs->next)
  49                 return -EBUSY;
  50         tmp = &file_systems;
  51         while (*tmp) {
  52                 if (strcmp((*tmp)->name, fs->name) == 0)
  53                         return -EBUSY;
  54                 tmp = &(*tmp)->next;
  55         }
  56         *tmp = fs;
  57         return 0;
  58 }
  59 
  60 int unregister_filesystem(struct file_system_type * fs)
     /* [previous][next][first][last][top][bottom][index][help] */
  61 {
  62         struct file_system_type ** tmp;
  63 
  64         tmp = &file_systems;
  65         while (*tmp) {
  66                 if (fs == *tmp) {
  67                         *tmp = fs->next;
  68                         fs->next = NULL;
  69                         return 0;
  70                 }
  71                 tmp = &(*tmp)->next;
  72         }
  73         return -EINVAL;
  74 }
  75 
  76 static int fs_index(const char * __name)
     /* [previous][next][first][last][top][bottom][index][help] */
  77 {
  78         struct file_system_type * tmp;
  79         char * name;
  80         int err, index;
  81 
  82         err = getname(__name, &name);
  83         if (err)
  84                 return err;
  85         index = 0;
  86         for (tmp = file_systems ; tmp ; tmp = tmp->next) {
  87                 if (strcmp(tmp->name, name) == 0) {
  88                         putname(name);
  89                         return index;
  90                 }
  91                 index++;
  92         }
  93         putname(name);
  94         return -EINVAL;
  95 }
  96 
  97 static int fs_name(unsigned int index, char * buf)
     /* [previous][next][first][last][top][bottom][index][help] */
  98 {
  99         struct file_system_type * tmp;
 100         int err, len;
 101 
 102         tmp = file_systems;
 103         while (tmp && index > 0) {
 104                 tmp = tmp->next;
 105                 index--;
 106         }
 107         if (!tmp)
 108                 return -EINVAL;
 109         len = strlen(tmp->name) + 1;
 110         err = verify_area(VERIFY_WRITE, buf, len);
 111         if (err)
 112                 return err;
 113         memcpy_tofs(buf, tmp->name, len);
 114         return 0;
 115 }
 116 
 117 static int fs_maxindex(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 118 {
 119         struct file_system_type * tmp;
 120         int index;
 121 
 122         index = 0;
 123         for (tmp = file_systems ; tmp ; tmp = tmp->next)
 124                 index++;
 125         return index;
 126 }
 127 
 128 /*
 129  * Whee.. Weird sysv syscall. 
 130  */
 131 asmlinkage int sys_sysfs(int option, ...)
     /* [previous][next][first][last][top][bottom][index][help] */
 132 {
 133         va_list args;
 134         int retval = -EINVAL;
 135         unsigned int index;
 136 
 137         va_start(args, option);
 138         switch (option) {
 139                 case 1:
 140                         retval = fs_index(va_arg(args, const char *));
 141                         break;
 142 
 143                 case 2:
 144                         index = va_arg(args, unsigned int);
 145                         retval = fs_name(index, va_arg(args, char *));
 146                         break;
 147 
 148                 case 3:
 149                         retval = fs_maxindex();
 150                         break;
 151         }
 152         va_end(args);
 153         return retval;
 154 }
 155 
 156 int get_filesystem_list(char * buf)
     /* [previous][next][first][last][top][bottom][index][help] */
 157 {
 158         int len = 0;
 159         struct file_system_type * tmp;
 160 
 161         tmp = file_systems;
 162         while (tmp && len < PAGE_SIZE - 80) {
 163                 len += sprintf(buf+len, "%s\t%s\n",
 164                         tmp->requires_dev ? "" : "nodev",
 165                         tmp->name);
 166                 tmp = tmp->next;
 167         }
 168         return len;
 169 }
 170 
 171 struct file_system_type *get_fs_type(char *name)
     /* [previous][next][first][last][top][bottom][index][help] */
 172 {
 173         struct file_system_type * fs = file_systems;
 174         
 175         if (!name)
 176                 return fs;
 177         while (fs) {
 178                 if (!strcmp(name,fs->name))
 179                         break;
 180                 fs = fs->next;
 181         }
 182         return fs;
 183 }
 184 
 185 void __wait_on_super(struct super_block * sb)
     /* [previous][next][first][last][top][bottom][index][help] */
 186 {
 187         struct wait_queue wait = { current, NULL };
 188 
 189         add_wait_queue(&sb->s_wait, &wait);
 190 repeat:
 191         current->state = TASK_UNINTERRUPTIBLE;
 192         if (sb->s_lock) {
 193                 schedule();
 194                 goto repeat;
 195         }
 196         remove_wait_queue(&sb->s_wait, &wait);
 197         current->state = TASK_RUNNING;
 198 }
 199 
 200 void sync_supers(dev_t dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 201 {
 202         struct super_block * sb;
 203 
 204         for (sb = super_blocks + 0 ; sb < super_blocks + NR_SUPER ; sb++) {
 205                 if (!sb->s_dev)
 206                         continue;
 207                 if (dev && sb->s_dev != dev)
 208                         continue;
 209                 wait_on_super(sb);
 210                 if (!sb->s_dev || !sb->s_dirt)
 211                         continue;
 212                 if (dev && (dev != sb->s_dev))
 213                         continue;
 214                 if (sb->s_op && sb->s_op->write_super)
 215                         sb->s_op->write_super(sb);
 216         }
 217 }
 218 
 219 static struct super_block * get_super(dev_t dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 220 {
 221         struct super_block * s;
 222 
 223         if (!dev)
 224                 return NULL;
 225         s = 0+super_blocks;
 226         while (s < NR_SUPER+super_blocks)
 227                 if (s->s_dev == dev) {
 228                         wait_on_super(s);
 229                         if (s->s_dev == dev)
 230                                 return s;
 231                         s = 0+super_blocks;
 232                 } else
 233                         s++;
 234         return NULL;
 235 }
 236 
 237 void put_super(dev_t dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 238 {
 239         struct super_block * sb;
 240 
 241         if (dev == ROOT_DEV) {
 242                 printk("VFS: Root device %d/%d: prepare for armageddon\n",
 243                                                         MAJOR(dev), MINOR(dev));
 244                 return;
 245         }
 246         if (!(sb = get_super(dev)))
 247                 return;
 248         if (sb->s_covered) {
 249                 printk("VFS: Mounted device %d/%d - tssk, tssk\n",
 250                                                 MAJOR(dev), MINOR(dev));
 251                 return;
 252         }
 253         if (sb->s_op && sb->s_op->put_super)
 254                 sb->s_op->put_super(sb);
 255 }
 256 
 257 static struct super_block * read_super(dev_t dev,char *name,int flags,
     /* [previous][next][first][last][top][bottom][index][help] */
 258                                        void *data, int silent)
 259 {
 260         struct super_block * s;
 261         struct file_system_type *type;
 262 
 263         if (!dev)
 264                 return NULL;
 265         check_disk_change(dev);
 266         s = get_super(dev);
 267         if (s)
 268                 return s;
 269         if (!(type = get_fs_type(name))) {
 270                 printk("VFS: on device %d/%d: get_fs_type(%s) failed\n",
 271                                                 MAJOR(dev), MINOR(dev), name);
 272                 return NULL;
 273         }
 274         for (s = 0+super_blocks ;; s++) {
 275                 if (s >= NR_SUPER+super_blocks)
 276                         return NULL;
 277                 if (!s->s_dev)
 278                         break;
 279         }
 280         s->s_dev = dev;
 281         s->s_flags = flags;
 282         if (!type->read_super(s,data, silent)) {
 283                 s->s_dev = 0;
 284                 return NULL;
 285         }
 286         s->s_dev = dev;
 287         s->s_covered = NULL;
 288         s->s_rd_only = 0;
 289         s->s_dirt = 0;
 290         return s;
 291 }
 292 
 293 /*
 294  * Unnamed block devices are dummy devices used by virtual
 295  * filesystems which don't use real block-devices.  -- jrs
 296  */
 297 
 298 static char unnamed_dev_in_use[256/8] = { 0, };
 299 
 300 static dev_t get_unnamed_dev(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 301 {
 302         int i;
 303 
 304         for (i = 1; i < 256; i++) {
 305                 if (!set_bit(i,unnamed_dev_in_use))
 306                         return (UNNAMED_MAJOR << 8) | i;
 307         }
 308         return 0;
 309 }
 310 
 311 static void put_unnamed_dev(dev_t dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 312 {
 313         if (!dev)
 314                 return;
 315         if (MAJOR(dev) == UNNAMED_MAJOR &&
 316             clear_bit(MINOR(dev), unnamed_dev_in_use))
 317                 return;
 318         printk("VFS: put_unnamed_dev: freeing unused device %d/%d\n",
 319                         MAJOR(dev), MINOR(dev));
 320 }
 321 
 322 static int do_umount(dev_t dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 323 {
 324         struct super_block * sb;
 325         int retval;
 326         
 327         if (dev==ROOT_DEV) {
 328                 /* Special case for "unmounting" root.  We just try to remount
 329                    it readonly, and sync() the device. */
 330                 if (!(sb=get_super(dev)))
 331                         return -ENOENT;
 332                 if (!(sb->s_flags & MS_RDONLY)) {
 333                         fsync_dev(dev);
 334                         retval = do_remount_sb(sb, MS_RDONLY, 0);
 335                         if (retval)
 336                                 return retval;
 337                 }
 338                 return 0;
 339         }
 340         if (!(sb=get_super(dev)) || !(sb->s_covered))
 341                 return -ENOENT;
 342         if (!sb->s_covered->i_mount)
 343                 printk("VFS: umount(%d/%d): mounted inode has i_mount=NULL\n",
 344                                                         MAJOR(dev), MINOR(dev));
 345         if (!fs_may_umount(dev, sb->s_mounted))
 346                 return -EBUSY;
 347         sb->s_covered->i_mount = NULL;
 348         iput(sb->s_covered);
 349         sb->s_covered = NULL;
 350         iput(sb->s_mounted);
 351         sb->s_mounted = NULL;
 352         if (sb->s_op && sb->s_op->write_super && sb->s_dirt)
 353                 sb->s_op->write_super(sb);
 354         put_super(dev);
 355         return 0;
 356 }
 357 
 358 /*
 359  * Now umount can handle mount points as well as block devices.
 360  * This is important for filesystems which use unnamed block devices.
 361  *
 362  * There is a little kludge here with the dummy_inode.  The current
 363  * vfs release functions only use the r_dev field in the inode so
 364  * we give them the info they need without using a real inode.
 365  * If any other fields are ever needed by any block device release
 366  * functions, they should be faked here.  -- jrs
 367  */
 368 
 369 asmlinkage int sys_umount(char * name)
     /* [previous][next][first][last][top][bottom][index][help] */
 370 {
 371         struct inode * inode;
 372         dev_t dev;
 373         int retval;
 374         struct inode dummy_inode;
 375         struct file_operations * fops;
 376 
 377         if (!suser())
 378                 return -EPERM;
 379         retval = namei(name,&inode);
 380         if (retval) {
 381                 retval = lnamei(name,&inode);
 382                 if (retval)
 383                         return retval;
 384         }
 385         if (S_ISBLK(inode->i_mode)) {
 386                 dev = inode->i_rdev;
 387                 if (IS_NODEV(inode)) {
 388                         iput(inode);
 389                         return -EACCES;
 390                 }
 391         } else {
 392                 if (!inode || !inode->i_sb || inode != inode->i_sb->s_mounted) {
 393                         iput(inode);
 394                         return -EINVAL;
 395                 }
 396                 dev = inode->i_sb->s_dev;
 397                 iput(inode);
 398                 memset(&dummy_inode, 0, sizeof(dummy_inode));
 399                 dummy_inode.i_rdev = dev;
 400                 inode = &dummy_inode;
 401         }
 402         if (MAJOR(dev) >= MAX_BLKDEV) {
 403                 iput(inode);
 404                 return -ENXIO;
 405         }
 406         if (!(retval = do_umount(dev)) && dev != ROOT_DEV) {
 407                 fops = get_blkfops(MAJOR(dev));
 408                 if (fops && fops->release)
 409                         fops->release(inode,NULL);
 410                 if (MAJOR(dev) == UNNAMED_MAJOR)
 411                         put_unnamed_dev(dev);
 412         }
 413         if (inode != &dummy_inode)
 414                 iput(inode);
 415         if (retval)
 416                 return retval;
 417         fsync_dev(dev);
 418         return 0;
 419 }
 420 
 421 /*
 422  * do_mount() does the actual mounting after sys_mount has done the ugly
 423  * parameter parsing. When enough time has gone by, and everything uses the
 424  * new mount() parameters, sys_mount() can then be cleaned up.
 425  *
 426  * We cannot mount a filesystem if it has active, used, or dirty inodes.
 427  * We also have to flush all inode-data for this device, as the new mount
 428  * might need new info.
 429  */
 430 static int do_mount(dev_t dev, const char * dir, char * type, int flags, void * data)
     /* [previous][next][first][last][top][bottom][index][help] */
 431 {
 432         struct inode * dir_i;
 433         struct super_block * sb;
 434         int error;
 435 
 436         error = namei(dir,&dir_i);
 437         if (error)
 438                 return error;
 439         if (dir_i->i_count != 1 || dir_i->i_mount) {
 440                 iput(dir_i);
 441                 return -EBUSY;
 442         }
 443         if (!S_ISDIR(dir_i->i_mode)) {
 444                 iput(dir_i);
 445                 return -EPERM;
 446         }
 447         if (!fs_may_mount(dev)) {
 448                 iput(dir_i);
 449                 return -EBUSY;
 450         }
 451         sb = read_super(dev,type,flags,data,0);
 452         if (!sb || sb->s_covered) {
 453                 iput(dir_i);
 454                 return -EBUSY;
 455         }
 456         sb->s_covered = dir_i;
 457         dir_i->i_mount = sb->s_mounted;
 458         return 0;               /* we don't iput(dir_i) - see umount */
 459 }
 460 
 461 
 462 /*
 463  * Alters the mount flags of a mounted file system. Only the mount point
 464  * is used as a reference - file system type and the device are ignored.
 465  * FS-specific mount options can't be altered by remounting.
 466  */
 467 
 468 static int do_remount_sb(struct super_block *sb, int flags, char *data)
     /* [previous][next][first][last][top][bottom][index][help] */
 469 {
 470         int retval;
 471         
 472         if (!(flags & MS_RDONLY ) && sb->s_dev && is_read_only(sb->s_dev))
 473                 return -EACCES;
 474                 /*flags |= MS_RDONLY;*/
 475         /* If we are remounting RDONLY, make sure there are no rw files open */
 476         if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY))
 477                 if (!fs_may_remount_ro(sb->s_dev))
 478                         return -EBUSY;
 479         if (sb->s_op && sb->s_op->remount_fs) {
 480                 retval = sb->s_op->remount_fs(sb, &flags, data);
 481                 if (retval)
 482                         return retval;
 483         }
 484         sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) |
 485                 (flags & MS_RMT_MASK);
 486         return 0;
 487 }
 488 
 489 static int do_remount(const char *dir,int flags,char *data)
     /* [previous][next][first][last][top][bottom][index][help] */
 490 {
 491         struct inode *dir_i;
 492         int retval;
 493 
 494         retval = namei(dir,&dir_i);
 495         if (retval)
 496                 return retval;
 497         if (dir_i != dir_i->i_sb->s_mounted) {
 498                 iput(dir_i);
 499                 return -EINVAL;
 500         }
 501         retval = do_remount_sb(dir_i->i_sb, flags, data);
 502         iput(dir_i);
 503         return retval;
 504 }
 505 
 506 static int copy_mount_options (const void * data, unsigned long *where)
     /* [previous][next][first][last][top][bottom][index][help] */
 507 {
 508         int i;
 509         unsigned long page;
 510         struct vm_area_struct * vma;
 511 
 512         *where = 0;
 513         if (!data)
 514                 return 0;
 515 
 516         for (vma = current->mm->mmap ; ; ) {
 517                 if (!vma ||
 518                     (unsigned long) data < vma->vm_start) {
 519                         return -EFAULT;
 520                 }
 521                 if ((unsigned long) data < vma->vm_end)
 522                         break;
 523                 vma = vma->vm_next;
 524         }
 525         i = vma->vm_end - (unsigned long) data;
 526         if (PAGE_SIZE <= (unsigned long) i)
 527                 i = PAGE_SIZE-1;
 528         if (!(page = __get_free_page(GFP_KERNEL))) {
 529                 return -ENOMEM;
 530         }
 531         memcpy_fromfs((void *) page,data,i);
 532         *where = page;
 533         return 0;
 534 }
 535 
 536 /*
 537  * Flags is a 16-bit value that allows up to 16 non-fs dependent flags to
 538  * be given to the mount() call (ie: read-only, no-dev, no-suid etc).
 539  *
 540  * data is a (void *) that can point to any structure up to
 541  * PAGE_SIZE-1 bytes, which can contain arbitrary fs-dependent
 542  * information (or be NULL).
 543  *
 544  * NOTE! As old versions of mount() didn't use this setup, the flags
 545  * has to have a special 16-bit magic number in the hight word:
 546  * 0xC0ED. If this magic word isn't present, the flags and data info
 547  * isn't used, as the syscall assumes we are talking to an older
 548  * version that didn't understand them.
 549  */
 550 asmlinkage int sys_mount(char * dev_name, char * dir_name, char * type,
     /* [previous][next][first][last][top][bottom][index][help] */
 551         unsigned long new_flags, void * data)
 552 {
 553         struct file_system_type * fstype;
 554         struct inode * inode;
 555         struct file_operations * fops;
 556         dev_t dev;
 557         int retval;
 558         char * t;
 559         unsigned long flags = 0;
 560         unsigned long page = 0;
 561 
 562         if (!suser())
 563                 return -EPERM;
 564         if ((new_flags &
 565              (MS_MGC_MSK | MS_REMOUNT)) == (MS_MGC_VAL | MS_REMOUNT)) {
 566                 retval = copy_mount_options (data, &page);
 567                 if (retval < 0)
 568                         return retval;
 569                 retval = do_remount(dir_name,
 570                                     new_flags & ~MS_MGC_MSK & ~MS_REMOUNT,
 571                                     (char *) page);
 572                 free_page(page);
 573                 return retval;
 574         }
 575         retval = copy_mount_options (type, &page);
 576         if (retval < 0)
 577                 return retval;
 578         fstype = get_fs_type((char *) page);
 579         free_page(page);
 580         if (!fstype)            
 581                 return -ENODEV;
 582         t = fstype->name;
 583         if (fstype->requires_dev) {
 584                 retval = namei(dev_name,&inode);
 585                 if (retval)
 586                         return retval;
 587                 if (!S_ISBLK(inode->i_mode)) {
 588                         iput(inode);
 589                         return -ENOTBLK;
 590                 }
 591                 if (IS_NODEV(inode)) {
 592                         iput(inode);
 593                         return -EACCES;
 594                 }
 595                 dev = inode->i_rdev;
 596                 if (MAJOR(dev) >= MAX_BLKDEV) {
 597                         iput(inode);
 598                         return -ENXIO;
 599                 }
 600         } else {
 601                 if (!(dev = get_unnamed_dev()))
 602                         return -EMFILE;
 603                 inode = NULL;
 604         }
 605         fops = get_blkfops(MAJOR(dev));
 606         if (fops && fops->open) {
 607                 struct file dummy;      /* allows read-write or read-only flag */
 608                 memset(&dummy, 0, sizeof(dummy));
 609                 dummy.f_inode = inode;
 610                 dummy.f_mode = (new_flags & MS_RDONLY) ? 1 : 3;
 611                 retval = fops->open(inode, &dummy);
 612                 if (retval) {
 613                         iput(inode);
 614                         return retval;
 615                 }
 616         }
 617         page = 0;
 618         if ((new_flags & MS_MGC_MSK) == MS_MGC_VAL) {
 619                 flags = new_flags & ~MS_MGC_MSK;
 620                 retval = copy_mount_options(data, &page);
 621                 if (retval < 0) {
 622                         iput(inode);
 623                         return retval;
 624                 }
 625         }
 626         retval = do_mount(dev,dir_name,t,flags,(void *) page);
 627         free_page(page);
 628         if (retval && fops && fops->release)
 629                 fops->release(inode, NULL);
 630         iput(inode);
 631         return retval;
 632 }
 633 
 634 void mount_root(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 635 {
 636         struct file_system_type * fs_type;
 637         struct super_block * sb;
 638         struct inode * inode, d_inode;
 639         struct file filp;
 640         int retval;
 641 
 642         memset(super_blocks, 0, sizeof(super_blocks));
 643         fcntl_init_locks();
 644         if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) {
 645                 printk(KERN_NOTICE "VFS: Insert root floppy and press ENTER\n");
 646                 wait_for_keypress();
 647         }
 648 
 649         memset(&filp, 0, sizeof(filp));
 650         memset(&d_inode, 0, sizeof(d_inode));
 651         d_inode.i_rdev = ROOT_DEV;
 652         filp.f_inode = &d_inode;
 653         if ( root_mountflags & MS_RDONLY)
 654                 filp.f_mode = 1; /* read only */
 655         else
 656                 filp.f_mode = 3; /* read write */
 657         retval = blkdev_open(&d_inode, &filp);
 658         if(retval == -EROFS){
 659                 root_mountflags |= MS_RDONLY;
 660                 filp.f_mode = 1;
 661                 retval = blkdev_open(&d_inode, &filp);
 662         }
 663 
 664         for (fs_type = file_systems ; fs_type ; fs_type = fs_type->next) {
 665                 if(retval)
 666                         break;
 667                 if (!fs_type->requires_dev)
 668                         continue;
 669                 sb = read_super(ROOT_DEV,fs_type->name,root_mountflags,NULL,1);
 670                 if (sb) {
 671                         inode = sb->s_mounted;
 672                         inode->i_count += 3 ;   /* NOTE! it is logically used 4 times, not 1 */
 673                         sb->s_covered = inode;
 674                         sb->s_flags = root_mountflags;
 675                         current->fs->pwd = inode;
 676                         current->fs->root = inode;
 677                         printk ("VFS: Mounted root (%s filesystem)%s.\n",
 678                                 fs_type->name,
 679                                 (sb->s_flags & MS_RDONLY) ? " readonly" : "");
 680                         return;
 681                 }
 682         }
 683         panic("VFS: Unable to mount root fs on %02x:%02x",
 684                 MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
 685 }

/* [previous][next][first][last][top][bottom][index][help] */