~ubuntu-branches/ubuntu/quantal/aufs/quantal

« back to all changes in this revision

Viewing changes to fs/aufs/dinfo.c

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-04-01 18:26:37 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080401182637-ujuqq47eiggw4y5w
Tags: 0+20080401-1
* New upstream snapshot
  - Remove bashisms in script (Closes: #471288)
* debian/conf.mk, linux-patch-aufs.kpatches.sysfs_get_dentry:
  - Remove support for this patch, no longer used
* debian/conf.mk:
  - Add hacks for arm to armel (Closes: #473767)
* debian/control:
  - Add Dm-Upload-Allowed
* debian/copyright:
  - Use http://wiki.debian.org/Proposals/CopyrightFormat
* debian/linux-patch-aufs.kpatches.{splice,put_filp}:
  - Add support for Kernel 2.6.24 (and 2.6.25)
* debian/patches:
  - 01_vserver_apparmor: Update patch
  - 06_rt: Add patch for realtime kernel
  - 07_splice_hack: Add hack to support splice operations (Closes: #473430)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2005, 2006, 2007 Junjiro Okajima
 
2
 * Copyright (C) 2005, 2006, 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: dinfo.c,v 1.37 2007/11/05 01:37:14 sfjro Exp $ */
 
19
/* $Id: dinfo.c,v 1.39 2008/03/16 23:46:30 sfjro Exp $ */
20
20
 
21
21
#include "aufs.h"
22
22
 
141
141
        // todo: always nested?
142
142
        rw_read_lock_nested(&dtodi(d)->di_rwsem, lsc);
143
143
        if (d->d_inode) {
144
 
                if (flags & AuLock_IW)
 
144
                if (au_ftest_lock(flags, IW))
145
145
                        do_ii_write_lock(d->d_inode, lsc);
146
 
                else if (flags & AuLock_IR)
 
146
                else if (au_ftest_lock(flags, IR))
147
147
                        do_ii_read_lock(d->d_inode, lsc);
148
148
        }
149
149
}
152
152
{
153
153
        SiMustAnyLock(d->d_sb);
154
154
        if (d->d_inode) {
155
 
                if (flags & AuLock_IW)
 
155
                if (au_ftest_lock(flags, IW))
156
156
                        ii_write_unlock(d->d_inode);
157
 
                else if (flags & AuLock_IR)
 
157
                else if (au_ftest_lock(flags, IR))
158
158
                        ii_read_unlock(d->d_inode);
159
159
        }
160
160
        rw_read_unlock(&dtodi(d)->di_rwsem);
164
164
{
165
165
        SiMustAnyLock(d->d_sb);
166
166
        rw_dgrade_lock(&dtodi(d)->di_rwsem);
167
 
        if (d->d_inode && (flags & AuLock_IR))
 
167
        if (d->d_inode && au_ftest_lock(flags, IR))
168
168
                ii_downgrade_lock(d->d_inode);
169
169
}
170
170
 
360
360
        dtodi(dentry)->di_bdiropq = bindex;
361
361
}
362
362
 
363
 
static void hintent_put(struct aufs_hdentry *hd)
 
363
static void hintent_put(struct aufs_hdentry *hd, int do_free)
364
364
{
365
365
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) \
366
366
        && !defined(AuNoNfsBranch)
378
378
                        //list_del(&hdi->hdi_list);
379
379
                        kfree(hdi);
380
380
                }
381
 
                kfree(hd->hd_intent_list);
 
381
                if (do_free)
 
382
                        kfree(hd->hd_intent_list);
382
383
        }
383
384
#endif
384
385
}
385
386
 
386
 
void hdput(struct aufs_hdentry *hd)
 
387
void hdput(struct aufs_hdentry *hd, int do_free)
387
388
{
388
 
        hintent_put(hd);
 
389
        hintent_put(hd, do_free);
389
390
        dput(hd->hd_dentry);
390
391
}
391
392
 
400
401
                  || (h_dentry && hd->hd_dentry)
401
402
                );
402
403
        if (hd->hd_dentry)
403
 
                hdput(hd);
 
404
                hdput(hd, /*do_free*/0);
404
405
        hd->hd_dentry = h_dentry;
405
406
}
406
407