Since we use containers and the struct inode is _inside_ the
unionfs_inode_info structure, UNIONFS_I will always (given a non-NULL inode
pointer), return a valid non-NULL pointer.
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Conflicts:
fs/unionfs/super.c
#ifndef _FANOUT_H_
#define _FANOUT_H_
-/* Inode to private data */
+/*
+ * Inode to private data
+ *
+ * Since we use containers and the struct inode is _inside_ the
+ * unionfs_inode_info structure, UNIONFS_I will always (given a non-NULL
+ * inode pointer), return a valid non-NULL pointer.
+ */
static inline struct unionfs_inode_info *UNIONFS_I(const struct inode *inode)
{
return container_of(inode, struct unionfs_inode_info, vfs_inode);
int size;
struct unionfs_inode_info *info = UNIONFS_I(inode);
- if (!info) {
- printk(KERN_ERR "unionfs: no kernel memory when allocating "
- "inode private data!\n");
- BUG();
- }
+ unionfs_read_lock(inode->i_sb);
memset(info, 0, offsetof(struct unionfs_inode_info, vfs_inode));
info->bstart = -1;
inode->i_fop = &unionfs_main_fops;
inode->i_mapping->a_ops = &unionfs_aops;
+
+ unionfs_read_unlock(inode->i_sb);
}
/*