Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / udf / super.c
index 15bd4f2..e45789f 100644 (file)
  *    http://www.ecma.ch/
  *    http://www.iso.org/
  *
- * CONTACTS
- *  E-mail regarding any portion of the Linux UDF file system should be
- *  directed to the development team mailing list (run by majordomo):
- *       linux_udf@hpesjro.fc.hp.com
- *
  * COPYRIGHT
  *  This file is distributed under the terms of the GNU General Public
  *  License (GPL). Copies of the GPL can be obtained from:
@@ -145,7 +140,8 @@ static int init_inodecache(void)
 {
        udf_inode_cachep = kmem_cache_create("udf_inode_cache",
                                             sizeof(struct udf_inode_info),
-                                            0, SLAB_RECLAIM_ACCOUNT,
+                                            0, (SLAB_RECLAIM_ACCOUNT|
+                                               SLAB_MEM_SPREAD),
                                             init_once, NULL);
        if (udf_inode_cachep == NULL)
                return -ENOMEM;
@@ -274,7 +270,7 @@ enum {
        Opt_gid, Opt_uid, Opt_umask, Opt_session, Opt_lastblock,
        Opt_anchor, Opt_volume, Opt_partition, Opt_fileset,
        Opt_rootdir, Opt_utf8, Opt_iocharset,
-       Opt_err
+       Opt_err, Opt_uforget, Opt_uignore, Opt_gforget, Opt_gignore
 };
 
 static match_table_t tokens = {
@@ -287,6 +283,10 @@ static match_table_t tokens = {
        {Opt_adinicb, "adinicb"},
        {Opt_shortad, "shortad"},
        {Opt_longad, "longad"},
+       {Opt_uforget, "uid=forget"},
+       {Opt_uignore, "uid=ignore"},
+       {Opt_gforget, "gid=forget"},
+       {Opt_gignore, "gid=ignore"},
        {Opt_gid, "gid=%u"},
        {Opt_uid, "uid=%u"},
        {Opt_umask, "umask=%o"},
@@ -419,6 +419,18 @@ udf_parse_options(char *options, struct udf_options *uopt)
                                uopt->flags |= (1 << UDF_FLAG_NLS_MAP);
                                break;
 #endif
+                       case Opt_uignore:
+                               uopt->flags |= (1 << UDF_FLAG_UID_IGNORE);
+                               break;
+                       case Opt_uforget:
+                               uopt->flags |= (1 << UDF_FLAG_UID_FORGET);
+                               break;
+                       case Opt_gignore:
+                           uopt->flags |= (1 << UDF_FLAG_GID_IGNORE);
+                               break;
+                       case Opt_gforget:
+                           uopt->flags |= (1 << UDF_FLAG_GID_FORGET);
+                               break;
                        default:
                                printk(KERN_ERR "udf: bad mount option \"%s\" "
                                                "or missing value\n", p);
@@ -649,8 +661,7 @@ udf_find_anchor(struct super_block *sb)
                 *     lastblock
                 *  however, if the disc isn't closed, it could be 512 */
 
-               for (i=0; (!lastblock && i<sizeof(last)/sizeof(int)); i++)
-               {
+               for (i = 0; !lastblock && i < ARRAY_SIZE(last); i++) {
                        if (last[i] < 0 || !(bh = sb_bread(sb, last[i])))
                        {
                                ident = location = 0;
@@ -661,7 +672,7 @@ udf_find_anchor(struct super_block *sb)
                                location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
                                udf_release_data(bh);
                        }
-       
+
                        if (ident == TAG_IDENT_AVDP)
                        {
                                if (location == last[i] - UDF_SB_SESSION(sb))
@@ -742,8 +753,7 @@ udf_find_anchor(struct super_block *sb)
                }
        }
 
-       for (i=0; i<sizeof(UDF_SB_ANCHOR(sb))/sizeof(int); i++)
-       {
+       for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
                if (UDF_SB_ANCHOR(sb)[i])
                {
                        if (!(bh = udf_read_tagged(sb,
@@ -1302,8 +1312,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
        if (!sb)
                return 1;
 
-       for (i=0; i<sizeof(UDF_SB_ANCHOR(sb))/sizeof(int); i++)
-       {
+       for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
                if (UDF_SB_ANCHOR(sb)[i] && (bh = udf_read_tagged(sb,
                        UDF_SB_ANCHOR(sb)[i], UDF_SB_ANCHOR(sb)[i], &ident)))
                {
@@ -1314,7 +1323,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
                        main_e = le32_to_cpu( anchor->mainVolDescSeqExt.extLength );
                        main_e = main_e >> sb->s_blocksize_bits;
                        main_e += main_s;
-       
+
                        /* Locate the reserve sequence */
                        reserve_s = le32_to_cpu(anchor->reserveVolDescSeqExt.extLocation);
                        reserve_e = le32_to_cpu(anchor->reserveVolDescSeqExt.extLength);
@@ -1333,12 +1342,10 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
                }
        }
 
-       if (i == sizeof(UDF_SB_ANCHOR(sb))/sizeof(int))
-       {
+       if (i == ARRAY_SIZE(UDF_SB_ANCHOR(sb))) {
                udf_debug("No Anchor block found\n");
                return 1;
-       }
-       else
+       } else
                udf_debug("Using anchor in block %d\n", UDF_SB_ANCHOR(sb)[i]);
 
        for (i=0; i<UDF_SB_NUMPARTS(sb); i++)
@@ -1504,7 +1511,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
        sb->s_fs_info = sbi;
        memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info));
 
-       init_MUTEX(&sbi->s_alloc_sem);
+       mutex_init(&sbi->s_alloc_mutex);
 
        if (!udf_parse_options((char *)options, &uopt))
                goto error_out;