[PATCH -mmotm] fs/sysfs/file.c d_path fix

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>, <jblunck@...>, <hch@...>
Cc: <linux-kernel@...>
Date: Saturday, February 16, 2008 - 3:12 pm

Using mmotm-2008-02-15-11-03, I get

  CC      fs/sysfs/file.o
fs/sysfs/file.c: In function 'sysfs_open_file':
fs/sysfs/file.c:334: warning: passing argument 1 of 'd_path' from incompatible pointer type
fs/sysfs/file.c:334: warning: passing argument 2 of 'd_path' from incompatible pointer type
fs/sysfs/file.c:334: warning: passing argument 3 of 'd_path' makes integer from pointer without a cast
fs/sysfs/file.c:334: error: too many arguments to function 'd_path'
make[2]: *** [fs/sysfs/file.o] Error 1
make[1]: *** [fs/sysfs] Error 2
make: *** [fs] Error 2

The following small patch fixes it for me.

Cheers,
Erez.


Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 02223e2..a57b024 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -329,9 +329,11 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
 	struct sysfs_ops *ops;
 	int error = -EACCES;
 	char *p;
+	struct path sysfs_path;
 
-	p = d_path(file->f_dentry, sysfs_mount, last_sysfs_file,
-		   sizeof(last_sysfs_file));
+	sysfs_path.dentry = file->f_dentry;
+	sysfs_path.mnt = sysfs_mount;
+	p = d_path(&sysfs_path, last_sysfs_file, sizeof(last_sysfs_file));
 	if (p)
 		memmove(last_sysfs_file, p, strlen(p) + 1);
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH -mmotm] fs/sysfs/file.c d_path fix, Erez Zadok, (Sat Feb 16, 3:12 pm)
Re: [PATCH -mmotm] fs/sysfs/file.c d_path fix, Christoph Hellwig, (Sun Feb 17, 9:07 am)
Re: [PATCH -mmotm] fs/sysfs/file.c d_path fix, Jan Blunck, (Mon Feb 18, 12:44 pm)