5 #include <linux/dcache.h>
6 #include <linux/namei.h>
8 extern struct dentry *cow_break_link(const char *pathname);
10 static inline int cow_check_and_break(struct nameidata *nd)
12 struct inode *inode = nd->dentry->d_inode;
14 if (IS_RDONLY(inode) || MNT_IS_RDONLY(nd->mnt))
17 if (IS_COW_LINK(inode)) {
18 struct dentry *new_dentry, *old_dentry = nd->dentry;
21 buf = kmalloc(PATH_MAX, GFP_KERNEL);
25 path = d_path(nd->dentry, nd->mnt, buf, PATH_MAX);
26 new_dentry = cow_break_link(path);
28 if (!IS_ERR(new_dentry)) {
29 nd->dentry = new_dentry;
32 error = PTR_ERR(new_dentry);
34 inode->i_flags &= ~(S_IUNLINK|S_IMMUTABLE);
35 inode->i_ctime = CURRENT_TIME;
36 mark_inode_dirty(inode);
43 #warning duplicate inclusion