~ubuntu-branches/ubuntu/utopic/aufs/utopic

« back to all changes in this revision

Viewing changes to fs/aufs/file.c

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-01-30 15:27:04 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080130152704-uvd64xgdg17ro2s8
Tags: 0+20080129-1
* New upstream snapshot
* 01_vserver_apparmor: Combined patch for vServer and AppArmor Kernels
  - AppArmor kernels have no ia_file, do not use it (LP: #182481)
  - AppArmor patch written by Joerg Schirottke for Kanotix (thank you!)
  - Replaces 01_vserver and 06_ubuntu
* 03_missing_headers: Define the magic numbers for XFS and TMPFS
* 04_sec_perm: Do not use security_inode_permission with kernel >= 2.6.24
* Inform about available pre-compiled modules in aufs-source description
* conf.mk:
  - Rewrite automatic configuration part, define a function and call it
  - Activate the AUFS_FAKE_DM only if the lhash patch has not been applied

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 */
18
18
 
19
 
/* $Id: file.c,v 1.62 2007/11/12 01:43:10 sfjro Exp $ */
 
19
/* $Id: file.c,v 1.64 2008/01/28 05:01:42 sfjro Exp $ */
20
20
 
21
21
//#include <linux/fsnotify.h>
22
22
#include <linux/pagemap.h>
131
131
static int do_coo(struct dentry *dentry, aufs_bindex_t bstart)
132
132
{
133
133
        int err;
134
 
        struct dentry *parent, *h_parent, *h_dentry;
 
134
        struct dentry *parent, *h_parent, *h_dentry, *gparent;
135
135
        aufs_bindex_t bcpup;
136
136
        struct inode *h_dir, *h_inode, *dir;
137
137
        struct au_cpup_flags cflags = {
164
164
        h_dentry = au_h_dptr_i(dentry, bstart);
165
165
        h_inode = h_dentry->d_inode;
166
166
        dir = parent->d_inode;
 
167
        //todo: meaningless lock if CONFIG_AUFS_DEBUG is disabled.
 
168
        gparent = NULL;
 
169
        if (unlikely(au_flag_test_udba_inotify(dentry->d_sb)
 
170
                     && !IS_ROOT(parent))) {
 
171
                gparent = dget_parent(parent);
 
172
                ii_read_lock_parent2(gparent->d_inode);
 
173
        }
167
174
        hdir_lock(h_dir, dir, bcpup);
 
175
        //todo: test parent-gparent relationship
168
176
        vfsub_i_lock_nested(h_inode, AuLsc_I_CHILD);
169
177
        AuDebugOn(au_h_dptr_i(dentry, bcpup));
170
178
        err = au_sio_cpup_simple(dentry, bcpup, -1, &cflags);
171
179
        AuTraceErr(err);
172
180
        vfsub_i_unlock(h_inode);
173
181
        hdir_unlock(h_dir, dir, bcpup);
 
182
        if (unlikely(gparent)) {
 
183
                ii_read_unlock(gparent->d_inode);
 
184
                dput(gparent);
 
185
        }
174
186
 
175
187
 out:
176
188
        di_write_unlock(parent);
298
310
{
299
311
        int err;
300
312
        struct dentry *dentry, *parent, *h_dentry, *h_parent, *hi_wh,
301
 
                *old_h_dentry;
 
313
                *old_h_dentry, *gparent;
302
314
        struct inode *h_inode, *h_dir, *inode, *dir;
303
315
        struct super_block *sb;
304
316
        aufs_bindex_t bstart, bcpup, old_bstart;
342
354
                h_parent = au_h_dptr_i(parent, bcpup);
343
355
        }
344
356
 
 
357
        //todo: meaningless lock if CONFIG_AUFS_DEBUG is disabled.
 
358
        gparent = NULL;
 
359
        if (unlikely(au_flag_test_udba_inotify(sb) && !IS_ROOT(parent))) {
 
360
                gparent = dget_parent(parent);
 
361
                ii_read_lock_parent2(gparent->d_inode);
 
362
        }
345
363
        h_dir = h_parent->d_inode;
346
364
        h_dentry = au_h_fptr(file)->f_dentry;
347
365
        h_inode = h_dentry->d_inode;
348
366
        dir = parent->d_inode;
349
367
        hdir_lock(h_dir, dir, bcpup);
 
368
        //todo: test parent-gparent relationship
350
369
        vfsub_i_lock_nested(h_inode, AuLsc_I_CHILD);
351
370
        if (d_unhashed(dentry) /* || d_unhashed(h_dentry) */
352
371
            /* || !h_inode->i_nlink */) {
380
399
        }
381
400
        vfsub_i_unlock(h_inode);
382
401
        hdir_unlock(h_dir, dir, bcpup);
 
402
        if (unlikely(gparent)) {
 
403
                ii_read_unlock(gparent->d_inode);
 
404
                dput(gparent);
 
405
        }
383
406
 
384
407
 out_unlock:
385
408
        di_write_unlock(parent);