head	1.1;
access;
symbols
	LKML-branch:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2006.10.24.04.54.58;	author jsipek;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2006.10.24.04.54.58;	author jsipek;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2006.10.24.07.45.06;	author jsipek;	state dead;
branches;
next	;


desc
@@


1.1
log
@file unionfs was initially added on branch LKML-branch.
@
text
@@


1.1.2.1
log
@Fix remainder of the kernel's f_{dentry,vfsmnt} usage
@
text
@a0 302
diff -r ed8030e0f7d4 fs/unionfs/branchman.c
--- a/fs/unionfs/branchman.c	Mon Oct 23 15:11:02 2006 -0400
+++ b/fs/unionfs/branchman.c	Mon Oct 23 23:26:49 2006 -0400
@@@@ -23,7 +23,7 @@@@ int unionfs_ioctl_incgen(struct file *fi
 	struct super_block *sb;
 	int gen;
 
-	sb = file->f_dentry->d_sb;
+	sb = file->f_path.dentry->d_sb;
 
 	unionfs_write_lock(sb);
 
@@@@ -46,7 +46,7 @@@@ int unionfs_ioctl_queryfile(struct file 
 	int bstart = 0, bend = 0, bindex = 0;
 	struct dentry *dentry, *hidden_dentry;
 
-	dentry = file->f_dentry;
+	dentry = file->f_path.dentry;
 	lock_dentry(dentry);
 	if ((err = unionfs_partial_lookup(dentry)))
 		goto out;
diff -r ed8030e0f7d4 fs/unionfs/commonfops.c
--- a/fs/unionfs/commonfops.c	Mon Oct 23 15:11:02 2006 -0400
+++ b/fs/unionfs/commonfops.c	Mon Oct 23 23:26:49 2006 -0400
@@@@ -61,7 +61,7 @@@@ static int copyup_deleted_file(struct fi
 	} while (tmp_dentry->d_inode != NULL);	/* need negative dentry */
 
 	err = copyup_named_file(dentry->d_parent->d_inode, file, name, bstart,
-				bindex, file->f_dentry->d_inode->i_size);
+				bindex, file->f_path.dentry->d_inode->i_size);
 	if (err)
 		goto out;
 
@@@@ -132,7 +132,7 @@@@ static int open_highest_file(struct file
 	struct file *hidden_file;
 	struct dentry *hidden_dentry;
 	struct inode *parent_inode = dentry->d_parent->d_inode;
-	size_t inode_size = file->f_dentry->d_inode->i_size;
+	size_t inode_size = file->f_path.dentry->d_inode->i_size;
 	struct super_block *sb = dentry->d_sb;
 
 	bstart = dbstart(dentry);
@@@@ -176,15 +176,15 @@@@ static int do_delayed_copyup(struct file
 {
 	int bindex, bstart, bend, err = 0;
 	struct inode *parent_inode = dentry->d_parent->d_inode;
-	loff_t inode_size = file->f_dentry->d_inode->i_size;
+	loff_t inode_size = file->f_path.dentry->d_inode->i_size;
 
 	bstart = fbstart(file);
 	bend = fbend(file);
 
-	BUG_ON(!S_ISREG(file->f_dentry->d_inode->i_mode));
+	BUG_ON(!S_ISREG(file->f_path.dentry->d_inode->i_mode));
 
 	for (bindex = bstart - 1; bindex >= 0; bindex--) {
-		if (!d_deleted(file->f_dentry))
+		if (!d_deleted(file->f_path.dentry))
 			err = copyup_file(parent_inode, file, bstart,
 					bindex, inode_size);
 		else
@@@@ -217,7 +217,7 @@@@ int unionfs_file_revalidate(struct file 
 
 	int err = 0;
 
-	dentry = file->f_dentry;
+	dentry = file->f_path.dentry;
 	lock_dentry(dentry);
 	sb = dentry->d_sb;
 	unionfs_read_lock(sb);
@@@@ -289,18 +289,18 @@@@ static inline int __open_dir(struct inod
 	struct file *hidden_file;
 	int bindex, bstart, bend;
 
-	bstart = fbstart(file) = dbstart(file->f_dentry);
-	bend = fbend(file) = dbend(file->f_dentry);
+	bstart = fbstart(file) = dbstart(file->f_path.dentry);
+	bend = fbend(file) = dbend(file->f_path.dentry);
 
 	for (bindex = bstart; bindex <= bend; bindex++) {
-		hidden_dentry = dtohd_index(file->f_dentry, bindex);
+		hidden_dentry = dtohd_index(file->f_path.dentry, bindex);
 		if (!hidden_dentry)
 			continue;
 
 		dget(hidden_dentry);
-		mntget(dtohm_index(file->f_dentry, bindex));
+		mntget(dtohm_index(file->f_path.dentry, bindex));
 		hidden_file = dentry_open(hidden_dentry,
-					dtohm_index(file->f_dentry, bindex),
+					dtohm_index(file->f_path.dentry, bindex),
 					file->f_flags);
 		if (IS_ERR(hidden_file))
 			return PTR_ERR(hidden_file);
@@@@ -323,16 +323,16 @@@@ static inline int __open_file(struct ino
 	int hidden_flags;
 	int bindex, bstart, bend;
 
-	hidden_dentry = dtohd(file->f_dentry);
+	hidden_dentry = dtohd(file->f_path.dentry);
 	hidden_flags = file->f_flags;
 
-	bstart = fbstart(file) = dbstart(file->f_dentry);
-	bend = fbend(file) = dbend(file->f_dentry);
+	bstart = fbstart(file) = dbstart(file->f_path.dentry);
+	bend = fbend(file) = dbend(file->f_path.dentry);
 
 	/* check for the permission for hidden file.  If the error is COPYUP_ERR,
 	 * copyup the file.
 	 */
-	if (hidden_dentry->d_inode && is_robranch(file->f_dentry)) {
+	if (hidden_dentry->d_inode && is_robranch(file->f_path.dentry)) {
 		/* if the open will change the file, copy it up otherwise defer it. */
 		if (hidden_flags & O_TRUNC) {
 			int size = 0;
@@@@ -340,7 +340,7 @@@@ static inline int __open_file(struct ino
 
 			/* copyup the file */
 			for (bindex = bstart - 1; bindex >= 0; bindex--) {
-				err = copyup_file(file->f_dentry->d_parent->d_inode,
+				err = copyup_file(file->f_path.dentry->d_parent->d_inode,
 						file, bstart, bindex, size);
 				if (!err)
 					break;
@@@@ -355,9 +355,9 @@@@ static inline int __open_file(struct ino
 	/* dentry_open will decrement mnt refcnt if err.
 	 * otherwise fput() will do an mntput() for us upon file close.
 	 */
-	mntget(dtohm_index(file->f_dentry, bstart));
+	mntget(dtohm_index(file->f_path.dentry, bstart));
 	hidden_file = dentry_open(hidden_dentry,
-				  dtohm_index(file->f_dentry, bstart),
+				  dtohm_index(file->f_path.dentry, bstart),
 				  hidden_flags);
 	if (IS_ERR(hidden_file))
 		return PTR_ERR(hidden_file);
@@@@ -393,7 +393,7 @@@@ int unionfs_open(struct inode *inode, st
 		goto out;
 	}
 
-	dentry = file->f_dentry;
+	dentry = file->f_path.dentry;
 	lock_dentry(dentry);
 	unionfs_read_lock(inode->i_sb);
 
@@@@ -416,7 +416,7 @@@@ int unionfs_open(struct inode *inode, st
 			if (!hidden_file)
 				continue;
 
-			branchput(file->f_dentry->d_sb, bindex);
+			branchput(file->f_path.dentry->d_sb, bindex);
 			/* fput calls dput for hidden_dentry */
 			fput(hidden_file);
 		}
@@@@ -492,7 +492,7 @@@@ static inline long do_ioctl(struct file 
 		err = hidden_file->f_op->unlocked_ioctl(hidden_file, cmd, arg);
 	} else if (hidden_file->f_op->ioctl) {
 		lock_kernel();
-		err = hidden_file->f_op->ioctl(hidden_file->f_dentry->d_inode,
+		err = hidden_file->f_op->ioctl(hidden_file->f_path.dentry->d_inode,
 					       hidden_file, cmd, arg);
 		unlock_kernel();
 	}
@@@@ -540,10 +540,10 @@@@ int unionfs_flush(struct file *file, fl_
 	if ((err = unionfs_file_revalidate(file, 1)))
 		goto out;
 	if (!atomic_dec_and_test
-	    (&itopd(file->f_dentry->d_inode)->uii_totalopens))
-		goto out;
-
-	lock_dentry(file->f_dentry);
+	    (&itopd(file->f_path.dentry->d_inode)->uii_totalopens))
+		goto out;
+
+	lock_dentry(file->f_path.dentry);
 
 	bstart = fbstart(file);
 	bend = fbend(file);
@@@@ -557,17 +557,17 @@@@ int unionfs_flush(struct file *file, fl_
 				goto out_lock;
 
 			/* if there are no more references to the dentry, dput it */
-			if (d_deleted(file->f_dentry)) {
-				dput(dtohd_index(file->f_dentry, bindex));
-				set_dtohd_index(file->f_dentry, bindex, NULL);
+			if (d_deleted(file->f_path.dentry)) {
+				dput(dtohd_index(file->f_path.dentry, bindex));
+				set_dtohd_index(file->f_path.dentry, bindex, NULL);
 			}
 		}
 
 	}
 
 out_lock:
-	unlock_dentry(file->f_dentry);
-out:
-	return err;
-}
-
+	unlock_dentry(file->f_path.dentry);
+out:
+	return err;
+}
+
diff -r ed8030e0f7d4 fs/unionfs/copyup.c
--- a/fs/unionfs/copyup.c	Mon Oct 23 15:11:02 2006 -0400
+++ b/fs/unionfs/copyup.c	Mon Oct 23 23:26:49 2006 -0400
@@@@ -457,7 +457,7 @@@@ int copyup_named_file(struct inode *dir,
 	int err = 0;
 	struct file *output_file = NULL;
 
-	err = copyup_named_dentry(dir, file->f_dentry, bstart,
+	err = copyup_named_dentry(dir, file->f_path.dentry, bstart,
 				  new_bindex, name, strlen(name), &output_file,
 				  len);
 	if (!err) {
@@@@ -477,7 +477,7 @@@@ int copyup_file(struct inode *dir, struc
 	int err = 0;
 	struct file *output_file = NULL;
 
-	err = copyup_dentry(dir, file->f_dentry, bstart, new_bindex,
+	err = copyup_dentry(dir, file->f_path.dentry, bstart, new_bindex,
 			    &output_file, len);
 	if (!err) {
 		fbstart(file) = new_bindex;
diff -r ed8030e0f7d4 fs/unionfs/dirfops.c
--- a/fs/unionfs/dirfops.c	Mon Oct 23 15:11:02 2006 -0400
+++ b/fs/unionfs/dirfops.c	Mon Oct 23 23:26:49 2006 -0400
@@@@ -96,7 +96,7 @@@@ static int unionfs_readdir(struct file *
 	if ((err = unionfs_file_revalidate(file, 0)))
 		goto out;
 
-	inode = file->f_dentry->d_inode;
+	inode = file->f_path.dentry->d_inode;
 
 	uds = ftopd(file)->rdstate;
 	if (!uds) {
@@@@ -150,7 +150,7 @@@@ static int unionfs_readdir(struct file *
 		uds->uds_dirpos = offset;
 
 		/* Copy the atime. */
-		fist_copy_attr_atime(inode, hidden_file->f_dentry->d_inode);
+		fist_copy_attr_atime(inode, hidden_file->f_path.dentry->d_inode);
 
 		if (err < 0)
 			goto out;
@@@@ -228,7 +228,7 @@@@ static loff_t unionfs_dir_llseek(struct 
 				else
 					err = -EINVAL;
 			} else {
-				if ((rdstate = find_rdstate(file->f_dentry->d_inode,
+				if ((rdstate = find_rdstate(file->f_path.dentry->d_inode,
 							offset))) {
 					ftopd(file)->rdstate = rdstate;
 					err = rdstate->uds_offset;
diff -r ed8030e0f7d4 fs/unionfs/file.c
--- a/fs/unionfs/file.c	Mon Oct 23 15:11:02 2006 -0400
+++ b/fs/unionfs/file.c	Mon Oct 23 23:26:49 2006 -0400
@@@@ -99,7 +99,7 @@@@ ssize_t __unionfs_write(struct file * fi
 	loff_t pos = *ppos;
 	int bstart, bend;
 
-	inode = file->f_dentry->d_inode;
+	inode = file->f_path.dentry->d_inode;
 
 	bstart = fbstart(file);
 	bend = fbend(file);
@@@@ -107,7 +107,7 @@@@ ssize_t __unionfs_write(struct file * fi
 	BUG_ON(bstart == -1);
 
 	hidden_file = ftohf(file);
-	hidden_inode = hidden_file->f_dentry->d_inode;
+	hidden_inode = hidden_file->f_path.dentry->d_inode;
 
 	if (!hidden_file->f_op || !hidden_file->f_op->write)
 		goto out;
@@@@ -230,10 +230,10 @@@@ static int unionfs_fsync(struct file *fi
 	if (!hidden_file->f_op || !hidden_file->f_op->fsync)
 		goto out;
 
-	mutex_lock(&hidden_file->f_dentry->d_inode->i_mutex);
-	err = hidden_file->f_op->fsync(hidden_file, hidden_file->f_dentry,
+	mutex_lock(&hidden_file->f_path.dentry->d_inode->i_mutex);
+	err = hidden_file->f_op->fsync(hidden_file, hidden_file->f_path.dentry,
 				       datasync);
-	mutex_unlock(&hidden_file->f_dentry->d_inode->i_mutex);
+	mutex_unlock(&hidden_file->f_path.dentry->d_inode->i_mutex);
 
 out:
 	return err;
diff -r ed8030e0f7d4 fs/unionfs/rdstate.c
--- a/fs/unionfs/rdstate.c	Mon Oct 23 15:11:02 2006 -0400
+++ b/fs/unionfs/rdstate.c	Mon Oct 23 23:26:49 2006 -0400
@@@@ -87,7 +87,7 @@@@ int init_rdstate(struct file *file)
 	BUG_ON(ftopd(file)->rdstate != NULL);
 
 	ftopd(file)->rdstate =
-	    alloc_rdstate(file->f_dentry->d_inode, fbstart(file));
+	    alloc_rdstate(file->f_path.dentry->d_inode, fbstart(file));
 	if (!ftopd(file)->rdstate)
 		return -ENOMEM;
 	return 0;
@


1.1.2.2
log
@reorder, rename and add descriptions to the remainder of f_{dentry,vfsmnt}
patches
@
text
@@


