]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[POWERPC] Fix rtas_flash procfs interface
authorMaxim Shchetynin <maxim@de.ibm.com>
Tue, 1 Apr 2008 13:12:20 +0000 (00:12 +1100)
committerPaul Mackerras <paulus@samba.org>
Thu, 3 Apr 2008 11:11:11 +0000 (22:11 +1100)
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>
arch/powerpc/kernel/rtas_flash.c

index f2276593f41648c7dc00330458622d63bca14b9b..538baf46f15f9471e8b9d8490399d9fbf1760be3 100644 (file)
@@ -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;
        }