X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fsysfs%2Finode.c;h=4de5c6b899181b47c07bf7140cda467c1f68d8cc;hb=03feb0524660bcd890674d11d29a1873ca14d13c;hp=542d2bcc73df16583a0b9449c6ee6f052275076e;hpb=b592fcfe7f06c15ec11774b5be7ce0de3aa86e73;p=powerpc.git diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 542d2bcc73..4de5c6b899 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -29,7 +29,7 @@ static struct backing_dev_info sysfs_backing_dev_info = { .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK, }; -static struct inode_operations sysfs_inode_operations ={ +static const struct inode_operations sysfs_inode_operations ={ .setattr = sysfs_setattr, }; @@ -222,11 +222,12 @@ const unsigned char * sysfs_get_name(struct sysfs_dirent *sd) static inline void orphan_all_buffers(struct inode *node) { - struct sysfs_buffer_collection *set = node->i_private; + struct sysfs_buffer_collection *set; struct sysfs_buffer *buf; mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); - if (node->i_private) { + set = node->i_private; + if (set) { list_for_each_entry(buf, &set->associates, associates) { down(&buf->sem); buf->orphaned = 1;