procfs: new helper - PDE_DATA(inode)
The only part of proc_dir_entry the code outside of fs/proc really cares about is PDE(inode)->data. Provide a helper for that; static inline for now, eventually will be moved to fs/proc, along with the knowledge of struct proc_dir_entry layout. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -469,7 +469,7 @@ static int hycapi_proc_show(struct seq_file *m, void *v)
|
||||
|
||||
static int hycapi_proc_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return single_open(file, hycapi_proc_show, PDE(inode)->data);
|
||||
return single_open(file, hycapi_proc_show, PDE_DATA(inode));
|
||||
}
|
||||
|
||||
static const struct file_operations hycapi_proc_fops = {
|
||||
|
@@ -234,7 +234,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
|
||||
|
||||
/* now search the addressed card */
|
||||
mutex_lock(&hysdn_conf_mutex);
|
||||
card = PDE(ino)->data;
|
||||
card = PDE_DATA(ino);
|
||||
if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
|
||||
hysdn_addlog(card, "config open for uid=%d gid=%d mode=0x%x",
|
||||
filep->f_cred->fsuid, filep->f_cred->fsgid,
|
||||
@@ -308,7 +308,7 @@ hysdn_conf_close(struct inode *ino, struct file *filep)
|
||||
int retval = 0;
|
||||
|
||||
mutex_lock(&hysdn_conf_mutex);
|
||||
card = PDE(ino)->data;
|
||||
card = PDE_DATA(ino);
|
||||
if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
|
||||
hysdn_addlog(card, "config close for uid=%d gid=%d mode=0x%x",
|
||||
filep->f_cred->fsuid, filep->f_cred->fsgid,
|
||||
|
@@ -173,7 +173,7 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t *off)
|
||||
{
|
||||
struct log_data *inf;
|
||||
int len;
|
||||
hysdn_card *card = PDE(file_inode(file))->data;
|
||||
hysdn_card *card = PDE_DATA(file_inode(file));
|
||||
|
||||
if (!*((struct log_data **) file->private_data)) {
|
||||
struct procdata *pd = card->proclog;
|
||||
@@ -202,7 +202,7 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t *off)
|
||||
static int
|
||||
hysdn_log_open(struct inode *ino, struct file *filep)
|
||||
{
|
||||
hysdn_card *card = PDE(ino)->data;
|
||||
hysdn_card *card = PDE_DATA(ino);
|
||||
|
||||
mutex_lock(&hysdn_log_mutex);
|
||||
if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
|
||||
@@ -255,7 +255,7 @@ hysdn_log_close(struct inode *ino, struct file *filep)
|
||||
pd = (struct procdata *) inf->proc_ctrl; /* still entries there */
|
||||
else {
|
||||
/* no info available -> search card */
|
||||
card = PDE(file_inode(filep))->data;
|
||||
card = PDE_DATA(file_inode(filep));
|
||||
pd = card->proclog; /* pointer to procfs log */
|
||||
}
|
||||
if (pd)
|
||||
@@ -286,7 +286,7 @@ static unsigned int
|
||||
hysdn_log_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
unsigned int mask = 0;
|
||||
hysdn_card *card = PDE(file_inode(file))->data;
|
||||
hysdn_card *card = PDE_DATA(file_inode(file));
|
||||
struct procdata *pd = card->proclog;
|
||||
|
||||
if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE)
|
||||
|
Fai riferimento in un nuovo problema
Block a user