Skip to content

Commit

Permalink
[POWERPC] Fix rtas_flash procfs interface
Browse files Browse the repository at this point in the history
Handling of the proc_dir_entry->count was changed in 2.6.24-rc5.
After this change, the default value for pde->count is 1 and not 0 as
before.  Therefore, if we want to check whether our procfs file is
already opened (already in use), we have to check if pde->count is
greater than 2 rather than 1.

Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com>
Signed-off-by: Jens Osterkamp <jens@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Maxim Shchetynin authored and Paul Mackerras committed Apr 3, 2008
1 parent b991f05 commit 7484839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/rtas_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static int rtas_excl_open(struct inode *inode, struct file *file)

/* Enforce exclusive open with use count of PDE */
spin_lock(&flash_file_open_lock);
if (atomic_read(&dp->count) > 1) {
if (atomic_read(&dp->count) > 2) {
spin_unlock(&flash_file_open_lock);
return -EBUSY;
}
Expand Down

0 comments on commit 7484839

Please sign in to comment.