ocfs2: set gap to seperate entry and value when xattr in bucket
[safe/jmp/linux-2.6] / fs / isofs / inode.c
index 875d37f..6147ec3 100644 (file)
@@ -73,7 +73,7 @@ static void isofs_destroy_inode(struct inode *inode)
        kmem_cache_free(isofs_inode_cachep, ISOFS_I(inode));
 }
 
-static void init_once(struct kmem_cache *cachep, void *foo)
+static void init_once(void *foo)
 {
        struct iso_inode_info *ei = foo;
 
@@ -110,6 +110,7 @@ static const struct super_operations isofs_sops = {
        .put_super      = isofs_put_super,
        .statfs         = isofs_statfs,
        .remount_fs     = isofs_remount,
+       .show_options   = generic_show_options,
 };
 
 
@@ -144,7 +145,8 @@ struct iso9660_options{
        char nocompress;
        unsigned char check;
        unsigned int blocksize;
-       mode_t mode;
+       mode_t fmode;
+       mode_t dmode;
        gid_t gid;
        uid_t uid;
        char *iocharset;
@@ -305,10 +307,10 @@ enum {
        Opt_block, Opt_check_r, Opt_check_s, Opt_cruft, Opt_gid, Opt_ignore,
        Opt_iocharset, Opt_map_a, Opt_map_n, Opt_map_o, Opt_mode, Opt_nojoliet,
        Opt_norock, Opt_sb, Opt_session, Opt_uid, Opt_unhide, Opt_utf8, Opt_err,
-       Opt_nocompress, Opt_hide, Opt_showassoc,
+       Opt_nocompress, Opt_hide, Opt_showassoc, Opt_dmode,
 };
 
-static match_table_t tokens = {
+static const match_table_t tokens = {
        {Opt_norock, "norock"},
        {Opt_nojoliet, "nojoliet"},
        {Opt_unhide, "unhide"},
@@ -332,6 +334,7 @@ static match_table_t tokens = {
        {Opt_uid, "uid=%u"},
        {Opt_gid, "gid=%u"},
        {Opt_mode, "mode=%u"},
+       {Opt_dmode, "dmode=%u"},
        {Opt_block, "block=%u"},
        {Opt_ignore, "conv=binary"},
        {Opt_ignore, "conv=b"},
@@ -359,7 +362,7 @@ static int parse_options(char *options, struct iso9660_options *popt)
        popt->check = 'u';              /* unset */
        popt->nocompress = 0;
        popt->blocksize = 1024;
-       popt->mode = S_IRUGO | S_IXUGO; /*
+       popt->fmode = popt->dmode = S_IRUGO | S_IXUGO; /*
                                         * r-x for all.  The disc could
                                         * be shared with DOS machines so
                                         * virtually anything could be
@@ -451,7 +454,12 @@ static int parse_options(char *options, struct iso9660_options *popt)
                case Opt_mode:
                        if (match_int(&args[0], &option))
                                return 0;
-                       popt->mode = option;
+                       popt->fmode = option;
+                       break;
+               case Opt_dmode:
+                       if (match_int(&args[0], &option))
+                               return 0;
+                       popt->dmode = option;
                        break;
                case Opt_block:
                        if (match_int(&args[0], &option))
@@ -554,6 +562,8 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
        int table, error = -EINVAL;
        unsigned int vol_desc_start;
 
+       save_mount_options(s, data);
+
        sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
        if (!sbi)
                return -ENOMEM;
@@ -801,7 +811,8 @@ root_found:
         * on the disk as suid, so we merely allow them to set the default
         * permissions.
         */
-       sbi->s_mode = opt.mode & 0777;
+       sbi->s_fmode = opt.fmode & 0777;
+       sbi->s_dmode = opt.dmode & 0777;
 
        /*
         * Read the root inode, which _may_ result in changing
@@ -844,10 +855,6 @@ root_found:
        }
        sbi->s_joliet_level = joliet_level;
 
-       /* check the root inode */
-       if (!inode->i_op)
-               goto out_bad_root;
-
        /* Make sure the root inode is a directory */
        if (!S_ISDIR(inode->i_mode)) {
                printk(KERN_WARNING
@@ -875,8 +882,6 @@ root_found:
        /*
         * Display error messages and free resources.
         */
-out_bad_root:
-       printk(KERN_WARNING "%s: root inode not initialized\n", __func__);
 out_iput:
        iput(inode);
        goto out_no_inode;
@@ -1248,7 +1253,7 @@ static int isofs_read_inode(struct inode *inode)
        ei->i_file_format = isofs_file_normal;
 
        if (de->flags[-high_sierra] & 2) {
-               inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
+               inode->i_mode = sbi->s_dmode | S_IFDIR;
                inode->i_nlink = 1;     /*
                                         * Set to 1.  We know there are 2, but
                                         * the find utility tries to optimize
@@ -1258,9 +1263,8 @@ static int isofs_read_inode(struct inode *inode)
                                         */
        } else {
                /* Everybody gets to read the file. */
-               inode->i_mode = sbi->s_mode;
+               inode->i_mode = sbi->s_fmode | S_IFREG;
                inode->i_nlink = 1;
-               inode->i_mode |= S_IFREG;
        }
        inode->i_uid = sbi->s_uid;
        inode->i_gid = sbi->s_gid;