~ubuntu-branches/ubuntu/vivid/aufs/vivid

« back to all changes in this revision

Viewing changes to fs/aufs/branch.c

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-08-21 14:58:54 UTC
  • mfrom: (1.1.8 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080821145854-4b49x09r4zmvlk5o
Tags: 0+20080719-4
01_vserver_apparmor.dpatch: [UPDATE] Disable vserver patches on kernel 
2.6.26, because they are not needed anymore. (Closes: #495921)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
/*
20
20
 * branch management
21
21
 *
22
 
 * $Id: branch.c,v 1.75 2008/04/13 23:37:42 sfjro Exp $
 
22
 * $Id: branch.c,v 1.77 2008/06/30 03:50:43 sfjro Exp $
23
23
 */
24
24
 
25
25
#include <linux/iso_fs.h>
220
220
        inode = root->d_inode;
221
221
        IiMustWriteLock(inode);
222
222
 
223
 
        add_branch = kmalloc(sizeof(*add_branch), GFP_KERNEL);
 
223
        add_branch = kmalloc(sizeof(*add_branch), GFP_NOFS);
224
224
        //if (LktrCond) {kfree(add_branch); add_branch = NULL;}
225
225
        if (unlikely(!add_branch))
226
226
                goto out;
232
232
        if (unlikely(!sz))
233
233
                sz = sizeof(*branchp);
234
234
        p = au_sbi(sb)->si_branch;
235
 
        branchp = au_kzrealloc(p, sz, sizeof(*branchp) * new_nbranch,
236
 
                               GFP_KERNEL);
 
235
        branchp = au_kzrealloc(p, sz, sizeof(*branchp) * new_nbranch, GFP_NOFS);
237
236
        //if (LktrCond) branchp = NULL;
238
237
        if (unlikely(!branchp))
239
238
                goto out_sabr;
244
243
                sz = sizeof(*hdentryp);
245
244
        p = au_di(root)->di_hdentry;
246
245
        hdentryp = au_kzrealloc(p, sz, sizeof(*hdentryp) * new_nbranch,
247
 
                                GFP_KERNEL);
 
246
                                GFP_NOFS);
248
247
        //if (LktrCond) hdentryp = NULL;
249
248
        if (unlikely(!hdentryp))
250
249
                goto out_sabr;
254
253
        if (unlikely(!sz))
255
254
                sz = sizeof(*hinodep);
256
255
        p = au_ii(inode)->ii_hinode;
257
 
        hinodep = au_kzrealloc(p, sz, sizeof(*hinodep) * new_nbranch,
258
 
                               GFP_KERNEL);
 
256
        hinodep = au_kzrealloc(p, sz, sizeof(*hinodep) * new_nbranch, GFP_NOFS);
259
257
        //if (LktrCond) hinodep = NULL; // unavailable test
260
258
        if (unlikely(!hinodep))
261
259
                goto out_sabr;
288
286
        return err;
289
287
}
290
288
 
 
289
static int au_unsupported_fs(struct super_block *sb)
 
290
{
 
291
        return (sb->s_magic == PROC_SUPER_MAGIC
 
292
#ifdef SYSFS_MAGIC
 
293
                || sb->s_magic == SYSFS_MAGIC
 
294
#endif
 
295
                || !strcmp(au_sbtype(sb), "unionfs"));
 
296
}
 
297
 
291
298
/*
292
299
 * returns:
293
300
 * 0: success, the caller will add it
347
354
                goto out;
348
355
        }
349
356
 
350
 
        if (unlikely(!strcmp(au_sbtype(inode->i_sb), "unionfs"))) {
 
357
        if (unlikely(au_unsupported_fs(inode->i_sb))) {
351
358
                AuErr("unsupported filesystem, %s\n", add->path);
352
359
                goto out;
353
360
        }
438
445
                }
439
446
        }
440
447
        add_branch->br_xino = NULL;
 
448
        mutex_init(&add_branch->br_xino_nondir_mtx);
441
449
        add_branch->br_mnt = mntget(add->nd.mnt);
442
450
        atomic_set(&add_branch->br_wh_running, 0);
443
451
        add_branch->br_id = au_new_br_id(sb);
538
546
        LKTRTrace("b%d, gen%d\n", bindex, sigen);
539
547
        SiMustWriteLock(root->d_sb);
540
548
 
541
 
        err = au_dpages_init(&dpages, GFP_TEMPORARY);
 
549
        err = au_dpages_init(&dpages, GFP_NOFS);
542
550
        if (unlikely(err))
543
551
                goto out;
544
552
        err = au_dcsub_pages(&dpages, root, NULL, NULL);