~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

Viewing changes to fs/ocfs2/refcounttree.c

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
4368
4368
        return inode_permission(dir, MAY_WRITE | MAY_EXEC);
4369
4369
}
4370
4370
 
4371
 
/* copied from user_path_parent. */
4372
 
static int ocfs2_user_path_parent(const char __user *path,
4373
 
                                  struct nameidata *nd, char **name)
4374
 
{
4375
 
        char *s = getname(path);
4376
 
        int error;
4377
 
 
4378
 
        if (IS_ERR(s))
4379
 
                return PTR_ERR(s);
4380
 
 
4381
 
        error = kern_path_parent(s, nd);
4382
 
        if (error)
4383
 
                putname(s);
4384
 
        else
4385
 
                *name = s;
4386
 
 
4387
 
        return error;
4388
 
}
4389
 
 
4390
4371
/**
4391
4372
 * ocfs2_vfs_reflink - Create a reference-counted link
4392
4373
 *
4460
4441
                        bool preserve)
4461
4442
{
4462
4443
        struct dentry *new_dentry;
4463
 
        struct nameidata nd;
4464
 
        struct path old_path;
 
4444
        struct path old_path, new_path;
4465
4445
        int error;
4466
 
        char *to = NULL;
4467
4446
 
4468
4447
        if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb)))
4469
4448
                return -EOPNOTSUPP;
4474
4453
                return error;
4475
4454
        }
4476
4455
 
4477
 
        error = ocfs2_user_path_parent(newname, &nd, &to);
4478
 
        if (error) {
4479
 
                mlog_errno(error);
4480
 
                goto out;
4481
 
        }
4482
 
 
4483
 
        error = -EXDEV;
4484
 
        if (old_path.mnt != nd.path.mnt)
4485
 
                goto out_release;
4486
 
        new_dentry = lookup_create(&nd, 0);
 
4456
        new_dentry = user_path_create(AT_FDCWD, newname, &new_path, 0);
4487
4457
        error = PTR_ERR(new_dentry);
4488
4458
        if (IS_ERR(new_dentry)) {
4489
4459
                mlog_errno(error);
4490
 
                goto out_unlock;
4491
 
        }
4492
 
 
4493
 
        error = mnt_want_write(nd.path.mnt);
 
4460
                goto out;
 
4461
        }
 
4462
 
 
4463
        error = -EXDEV;
 
4464
        if (old_path.mnt != new_path.mnt) {
 
4465
                mlog_errno(error);
 
4466
                goto out_dput;
 
4467
        }
 
4468
 
 
4469
        error = mnt_want_write(new_path.mnt);
4494
4470
        if (error) {
4495
4471
                mlog_errno(error);
4496
4472
                goto out_dput;
4497
4473
        }
4498
4474
 
4499
4475
        error = ocfs2_vfs_reflink(old_path.dentry,
4500
 
                                  nd.path.dentry->d_inode,
 
4476
                                  new_path.dentry->d_inode,
4501
4477
                                  new_dentry, preserve);
4502
 
        mnt_drop_write(nd.path.mnt);
 
4478
        mnt_drop_write(new_path.mnt);
4503
4479
out_dput:
4504
4480
        dput(new_dentry);
4505
 
out_unlock:
4506
 
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
4507
 
out_release:
4508
 
        path_put(&nd.path);
4509
 
        putname(to);
 
4481
        mutex_unlock(&new_path.dentry->d_inode->i_mutex);
 
4482
        path_put(&new_path);
4510
4483
out:
4511
4484
        path_put(&old_path);
4512
4485