diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-03-04 13:42:57 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-03-04 13:42:57 +1100 |
commit | f9899b0499235c821ea736fb4c6488031fc085e4 (patch) | |
tree | 49ab6778d66dc2a1f4113494a6aadfc35e64d613 /fs | |
parent | 976dde010e513a9c7c3117a32b7b015f84b37430 (diff) | |
parent | 58afb39d7b03752e11c9cbd90cbc99c9bad60c26 (diff) |
Merge branch 'quilt/driver-core'
Diffstat (limited to 'fs')
-rw-r--r-- | fs/debugfs/inode.c | 4 | ||||
-rw-r--r-- | fs/sysfs/file.c | 13 | ||||
-rw-r--r-- | fs/sysfs/mount.c | 2 | ||||
-rw-r--r-- | fs/sysfs/sysfs.h | 1 |
4 files changed, 15 insertions, 5 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index d26e2826ba5b..e9602d85c11d 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -29,10 +29,6 @@ #define DEBUGFS_MAGIC 0x64626720 -/* declared over in file.c */ -extern struct file_operations debugfs_file_operations; -extern struct inode_operations debugfs_link_operations; - static struct vfsmount *debugfs_mount; static int debugfs_mount_count; diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index a271c87c4472..861459e60a6f 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -16,10 +16,18 @@ #include <linux/poll.h> #include <linux/list.h> #include <linux/mutex.h> +#include <linux/limits.h> #include <asm/uaccess.h> #include "sysfs.h" +/* used in crash dumps to help with debugging */ +static char last_sysfs_file[PATH_MAX]; +void sysfs_printk_last_file(void) +{ + printk(KERN_EMERG "last sysfs file: %s\n", last_sysfs_file); +} + /* * There's one sysfs_buffer for each open file and one * sysfs_open_dirent for each sysfs_dirent with one or more open @@ -320,6 +328,11 @@ static int sysfs_open_file(struct inode *inode, struct file *file) struct sysfs_buffer *buffer; struct sysfs_ops *ops; int error = -EACCES; + char *p; + + p = d_path(&file->f_path, last_sysfs_file, sizeof(last_sysfs_file)); + if (p) + memmove(last_sysfs_file, p, strlen(p) + 1); /* need attr_sd for attr and ops, its parent for kobj */ if (!sysfs_get_active_two(attr_sd)) diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index 74168266cd59..a3410d6b34a7 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -22,7 +22,7 @@ /* Random magic number */ #define SYSFS_MAGIC 0x62656572 -static struct vfsmount *sysfs_mount; +struct vfsmount *sysfs_mount; struct super_block * sysfs_sb = NULL; struct kmem_cache *sysfs_dir_cachep; diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index ff17f8da9b43..52aaa8c11f92 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -91,6 +91,7 @@ struct sysfs_addrm_cxt { extern struct sysfs_dirent sysfs_root; extern struct super_block *sysfs_sb; extern struct kmem_cache *sysfs_dir_cachep; +extern struct vfsmount *sysfs_mount; /* * dir.c |