static int proc_sys_compare(struct dentry *dir, struct qstr *qstr, struct qstr *name) { struct dentry *dentry = container_of(qstr, struct dentry, d_name); if (qstr->len != name->len) return 1; if (memcmp(qstr->name, name->name, name->len)) return 1; return !sysctl_is_seen(PROC_I(dentry->d_inode)->sysctl); }
static int proc_sys_compare(const struct dentry *parent, const struct inode *pinode, const struct dentry *dentry, const struct inode *inode, unsigned int len, const char *str, const struct qstr *name) { struct ctl_table_header *head; /* Although proc doesn't have negative dentries, rcu-walk means * that inode here can be NULL */ /* AV: can it, indeed? */ if (!inode) return 1; if (name->len != len) return 1; if (memcmp(name->name, str, len)) return 1; head = rcu_dereference(PROC_I(inode)->sysctl); return !head || !sysctl_is_seen(head); }