~ubuntu-branches/ubuntu/raring/aufs/raring

« back to all changes in this revision

Viewing changes to fs/aufs/export.c

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-05-06 18:35:50 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080506183550-0b6c974kkgc46oeh
Tags: 0+20080506-1
* New upstream release, supports Kernel 2.6.25 (Closes: #479717)
* Fix building with older Kernels (Closes: #475042)
* Update the patches 01, 04 and 07 to also patch fs/aufs25

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2007, 2008 Junjiro Okajima
 
2
 * Copyright (C) 2007-2008 Junjiro Okajima
3
3
 *
4
4
 * This program, aufs is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
16
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 */
18
18
 
19
 
/* $Id: export.c,v 1.26 2008/03/24 02:15:34 sfjro Exp $ */
 
19
/*
 
20
 * export via nfs
 
21
 *
 
22
 * $Id: export.c,v 1.28 2008/04/13 23:40:19 sfjro Exp $
 
23
 */
20
24
 
21
25
#include <linux/version.h>
22
26
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
316
320
        int len, err;
317
321
        struct file *h_file;
318
322
        struct nameidata nd;
319
 
        struct aufs_branch *br;
 
323
        struct au_branch *br;
320
324
 
321
325
        LKTRTrace("b%d\n", bindex);
322
326
        SiMustAnyLock(sb);
323
327
 
324
 
        br = stobr(sb, bindex);
325
 
        /* br_get(br); */
 
328
        br = au_sbr(sb, bindex);
 
329
        /* au_br_get(br); */
326
330
        h_mnt = br->br_mnt;
327
331
        h_sb = h_mnt->mnt_sb;
328
332
        LKTRTrace("%s, h_decode_fh\n", au_sbtype(h_sb));
382
386
        } while (!err && !arg.found && arg.called);
383
387
        LKTRTrace("%p, %s, %d\n", arg.h_path, arg.h_path, arg.len);
384
388
 
385
 
        p = d_path(root, stosi(sb)->si_mnt, path, PATH_MAX - arg.len);
 
389
        p = d_path(root, au_sbi(sb)->si_mnt, path, PATH_MAX - arg.len);
386
390
        dentry = (void *)p;
387
391
        if (unlikely(!p || IS_ERR(p)))
388
392
                goto out_fput;
405
409
 out_putname:
406
410
        __putname(path);
407
411
 out:
408
 
        /* br_put(br); */
 
412
        /* au_br_put(br); */
409
413
        AuTraceErrPtr(dentry);
410
414
        return dentry;
411
415
}
436
440
        dentry = ERR_PTR(-ESTALE);
437
441
        br_id = fh[Fh_br_id];
438
442
        sigen = fh[Fh_sigen];
439
 
        bindex = find_brindex(sb, br_id);
 
443
        bindex = au_br_index(sb, br_id);
440
444
        if (unlikely(bindex < 0 || sigen + AUFS_BRANCH_MAX <= au_sigen(sb)))
441
445
                goto out;
442
446
 
469
473
        inode = dentry->d_inode;
470
474
        h_inode = NULL;
471
475
        ii_read_lock_child(inode);
472
 
        if (ibstart(inode) <= bindex && bindex <= ibend(inode))
 
476
        if (au_ibstart(inode) <= bindex && bindex <= au_ibend(inode))
473
477
                h_inode = au_h_iptr_i(inode, bindex);
474
478
        ii_read_unlock(inode);
475
479
        if (h_inode
531
535
        di_read_lock_child(dentry, AuLock_IR);
532
536
        di_read_lock_parent(parent, AuLock_IR);
533
537
#ifdef CONFIG_AUFS_DEBUG
534
 
        if (unlikely(AuFlag(stosi(sb), f_xino) == AuXino_NONE))
 
538
        if (unlikely(!au_opt_test(au_mntflags(sb), XINO)))
535
539
                AuWarn1("NFS-exporting requires xino\n");
536
540
#if 0 // temp
537
 
        if (unlikely(au_flag_test_udba_inotify(sb)))
 
541
        if (unlikely(au_opt_test(au_mntflags(sb), UDBA_INOTIFY)))
538
542
                AuWarn1("udba=inotify is not recommended when exporting\n");
539
543
#endif
540
544
#endif
541
545
 
542
546
        err = -EPERM;
543
 
        bindex = dbstart(dentry);
544
 
        h_sb = sbr_sb(sb, bindex);
 
547
        bindex = au_dbstart(dentry);
 
548
        h_sb = au_sbr_sb(sb, bindex);
545
549
        if (unlikely(!h_sb->s_export_op)) {
546
550
                AuErr1("%s branch is not exportable\n", au_sbtype(h_sb));
547
551
                goto out_unlock;
554
558
        }
555
559
#endif
556
560
 
557
 
        fh[Fh_br_id] = sbr_id(sb, bindex);
 
561
        fh[Fh_br_id] = au_sbr_id(sb, bindex);
558
562
        fh[Fh_sigen] = au_sigen(sb);
559
563
        encode_ino(fh + Fh_ino, inode->i_ino);
560
564
        dir = parent->d_inode;