+/* This is a copy from fs/readdir.c */This should go into a header file.
+struct getdents_callback {
+ struct linux_dirent __user *current_dir;
+ struct linux_dirent __user *previous;
+ int count;
+ int error;
+};
+static int union_cache_find_entry(struct list_head *uc_list,Why not use strlen instead of having both string and length as parameter?
+ const char *name, int namelen)
+{
+ struct union_cache_entry *p;
+ int ret = 0;
+
+ list_for_each_entry(p, uc_list, list) {
+ if (p->name.len != namelen)
+ continue;
+ if (strncmp(p->name.name, name, namelen) == 0) {
+ ret = 1;
+ break;
+ }
+ }
+ return ret;
+}
+static struct file * __dentry_open_read(struct dentry *dentry,This is the only case where error is not explicitly set to a different
+ struct vfsmount *mnt, int flags)
+{
+ struct file *f;
+ struct inode *inode;
+ int error;
+
+ error = -ENFILE;
+ f = get_empty_filp();
+ if (!f)
+ goto out;