]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/ia64/kernel/perfmon.c
ia64: perfmon: add d_dname method
[mirror_ubuntu-bionic-kernel.git] / arch / ia64 / kernel / perfmon.c
index ab985f785c140830d1a9b781685696f93ac8909a..cce050e85c73558040fe7c4970e3beb69d7ee2a1 100644 (file)
@@ -1696,8 +1696,8 @@ pfm_poll(struct file *filp, poll_table * wait)
        return mask;
 }
 
-static int
-pfm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long
+pfm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        DPRINT(("pfm_ioctl called\n"));
        return -EINVAL;
@@ -2174,15 +2174,15 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare)
 
 
 static const struct file_operations pfm_file_ops = {
-       .llseek   = no_llseek,
-       .read     = pfm_read,
-       .write    = pfm_write,
-       .poll     = pfm_poll,
-       .ioctl    = pfm_ioctl,
-       .open     = pfm_no_open,        /* special open code to disallow open via /proc */
-       .fasync   = pfm_fasync,
-       .release  = pfm_close,
-       .flush    = pfm_flush
+       .llseek         = no_llseek,
+       .read           = pfm_read,
+       .write          = pfm_write,
+       .poll           = pfm_poll,
+       .unlocked_ioctl = pfm_ioctl,
+       .open           = pfm_no_open,  /* special open code to disallow open via /proc */
+       .fasync         = pfm_fasync,
+       .release        = pfm_close,
+       .flush          = pfm_flush
 };
 
 static int
@@ -2191,8 +2191,15 @@ pfmfs_delete_dentry(struct dentry *dentry)
        return 1;
 }
 
+static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen)
+{
+       return dynamic_dname(dentry, buffer, buflen, "pfm:[%lu]",
+                            dentry->d_inode->i_ino);
+}
+
 static const struct dentry_operations pfmfs_dentry_operations = {
        .d_delete = pfmfs_delete_dentry,
+       .d_dname = pfmfs_dname,
 };
 
 
@@ -2202,8 +2209,7 @@ pfm_alloc_file(pfm_context_t *ctx)
        struct file *file;
        struct inode *inode;
        struct path path;
-       char name[32];
-       struct qstr this;
+       struct qstr this = { .name = "" };
 
        /*
         * allocate a new inode
@@ -2218,11 +2224,6 @@ pfm_alloc_file(pfm_context_t *ctx)
        inode->i_uid  = current_fsuid();
        inode->i_gid  = current_fsgid();
 
-       sprintf(name, "[%lu]", inode->i_ino);
-       this.name = name;
-       this.len  = strlen(name);
-       this.hash = inode->i_ino;
-
        /*
         * allocate a new dcache entry
         */