*/
/* forward definitions */
-static int copyup_named_dentry(struct inode *dir, struct dentry *dentry,
- int bstart, int new_bindex, const char *name,
- int namelen, struct file **copyup_file,
- loff_t len);
static struct dentry *create_parents_named(struct inode *dir,
struct dentry *dentry,
const char *name, int bindex);
return err;
}
-int copyup_dentry(struct inode *dir, struct dentry *dentry,
- int bstart, int new_bindex,
- struct file **copyup_file, loff_t len)
-{
- return copyup_named_dentry(dir, dentry, bstart, new_bindex,
- dentry->d_name.name,
- dentry->d_name.len, copyup_file, len);
-}
-
/*
* create the new device/file/directory - use copyup_permission to copyup
* times, and mode
* @copyup_file: the "struct file" to return (optional)
* @len: how many bytes to copy-up?
*/
-static int copyup_named_dentry(struct inode *dir, struct dentry *dentry,
- int bstart, int new_bindex, const char *name,
- int namelen, struct file **copyup_file,
- loff_t len)
+int copyup_dentry(struct inode *dir, struct dentry *dentry, int bstart,
+ int new_bindex, const char *name, int namelen,
+ struct file **copyup_file, loff_t len)
{
struct dentry *new_hidden_dentry;
struct dentry *old_hidden_dentry = NULL;
int err = 0;
struct file *output_file = NULL;
- err = copyup_named_dentry(dir, file->f_dentry, bstart,
- new_bindex, name, strlen(name), &output_file,
- len);
+ err = copyup_dentry(dir, file->f_dentry, bstart, new_bindex,
+ name, strlen(name), &output_file, len);
if (!err) {
fbstart(file) = new_bindex;
unionfs_set_lower_file_idx(file, new_bindex, output_file);
{
int err = 0;
struct file *output_file = NULL;
+ struct dentry *dentry = file->f_dentry;
- err = copyup_dentry(dir, file->f_dentry, bstart, new_bindex,
+ err = copyup_dentry(dir, dentry, bstart, new_bindex,
+ dentry->d_name.name, dentry->d_name.len,
&output_file, len);
if (!err) {
fbstart(file) = new_bindex;
for (bindex = old_bstart - 1; bindex >= 0; bindex--) {
err = copyup_dentry(old_dentry->d_parent->d_inode,
old_dentry, old_bstart,
- bindex, NULL,
+ bindex, old_dentry->d_name.name,
+ old_dentry->d_name.len, NULL,
old_dentry->d_inode->i_size);
if (!err) {
hidden_new_dentry =
if (ia->ia_valid & ATTR_SIZE)
size = ia->ia_size;
err = copyup_dentry(dentry->d_parent->d_inode,
- dentry, bstart, i, NULL,
- size);
+ dentry, bstart, i,
+ dentry->d_name.name,
+ dentry->d_name.len,
+ NULL, size);
if (!err) {
copyup = 1;
char *name, int bstart, int new_bindex,
loff_t len);
/* copies a dentry from dbstart to newbindex branch */
-extern int copyup_dentry(struct inode *dir, struct dentry *dentry, int bstart,
- int new_bindex, struct file **copyup_file,
- loff_t len);
+extern int copyup_dentry(struct inode *dir, struct dentry *dentry,
+ int bstart, int new_bindex, const char *name,
+ int namelen, struct file **copyup_file, loff_t len);
/* helper functions for post-copyup cleanup */
extern void unionfs_inherit_mnt(struct dentry *dentry);
extern void unionfs_purge_extras(struct dentry *dentry);