inode.c (818a23e3882b1bf65d1719e407be04716e69a4d5) inode.c (e6d2ebddbc5205635a021a910f2f0e93bc2aa534)
1/*
2 *
3 * Copyright (C) 2011 Novell Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 */

--- 448 unchanged lines hidden (view full) ---

457}
458
459static int ovl_inode_set(struct inode *inode, void *data)
460{
461 inode->i_private = (void *) (((unsigned long) data) | OVL_ISUPPER_MASK);
462 return 0;
463}
464
1/*
2 *
3 * Copyright (C) 2011 Novell Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 */

--- 448 unchanged lines hidden (view full) ---

457}
458
459static int ovl_inode_set(struct inode *inode, void *data)
460{
461 inode->i_private = (void *) (((unsigned long) data) | OVL_ISUPPER_MASK);
462 return 0;
463}
464
465struct inode *ovl_get_inode(struct super_block *sb, struct inode *realinode)
466
465struct inode *ovl_get_inode(struct dentry *dentry)
467{
466{
467 struct dentry *upperdentry = ovl_dentry_upper(dentry);
468 struct inode *realinode = d_inode(ovl_dentry_real(dentry));
468 struct inode *inode;
469
469 struct inode *inode;
470
470 inode = iget5_locked(sb, (unsigned long) realinode,
471 ovl_inode_test, ovl_inode_set, realinode);
472 if (inode && inode->i_state & I_NEW) {
473 ovl_fill_inode(inode, realinode->i_mode, realinode->i_rdev);
471 if (upperdentry && !d_is_dir(upperdentry)) {
472 inode = iget5_locked(dentry->d_sb, (unsigned long) realinode,
473 ovl_inode_test, ovl_inode_set, realinode);
474 if (!inode || !(inode->i_state & I_NEW))
475 goto out;
476
474 set_nlink(inode, realinode->i_nlink);
477 set_nlink(inode, realinode->i_nlink);
475 unlock_new_inode(inode);
478 } else {
479 inode = new_inode(dentry->d_sb);
480 if (!inode)
481 goto out;
476 }
482 }
477
483 ovl_fill_inode(inode, realinode->i_mode, realinode->i_rdev);
484 ovl_inode_init(inode, dentry);
485 if (inode->i_state & I_NEW)
486 unlock_new_inode(inode);
487out:
478 return inode;
479}
488 return inode;
489}