[Btrfs-devel] [PATCH 1/2] set the root inode's operations properly

Josef Bacik jwhiter at redhat.com
Thu Jun 28 20:40:10 PDT 2007


Hello,

This patch sets the root inode's inode operations to the normal dir inode
operations so you can write to it and such.  Thank you,

Josef

diff -r 080c0640a527 inode.c
--- a/inode.c	Thu Jun 28 15:57:36 2007 -0400
+++ b/inode.c	Thu Jun 28 17:13:00 2007 -0400
@@ -46,7 +46,6 @@ struct btrfs_iget_args {
 
 static struct inode_operations btrfs_dir_inode_operations;
 static struct inode_operations btrfs_symlink_inode_operations;
-static struct inode_operations btrfs_dir_ro_inode_operations;
 static struct inode_operations btrfs_file_inode_operations;
 static struct address_space_operations btrfs_aops;
 static struct address_space_operations btrfs_symlink_aops;
@@ -128,10 +127,7 @@ void btrfs_read_locked_inode(struct inod
 		break;
 	case S_IFDIR:
 		inode->i_fop = &btrfs_dir_file_operations;
-		if (root == root->fs_info->tree_root)
-			inode->i_op = &btrfs_dir_ro_inode_operations;
-		else
-			inode->i_op = &btrfs_dir_inode_operations;
+		inode->i_op = &btrfs_dir_inode_operations;
 		break;
 	case S_IFLNK:
 		inode->i_op = &btrfs_symlink_inode_operations;
@@ -2529,10 +2525,6 @@ static struct inode_operations btrfs_dir
 	.setattr	= btrfs_setattr,
 };
 
-static struct inode_operations btrfs_dir_ro_inode_operations = {
-	.lookup		= btrfs_lookup,
-};
-
 static struct file_operations btrfs_dir_file_operations = {
 	.llseek		= generic_file_llseek,
 	.read		= generic_read_dir,



More information about the Btrfs-devel mailing list