summaryrefslogtreecommitdiff
path: root/fs/devfs/base.c
diff options
context:
space:
mode:
authorRichard Gooch <rgooch@atnf.csiro.au>2002-05-14 16:30:07 +0000
committerRichard Gooch <rgooch@atnf.csiro.au>2002-05-14 16:30:07 +0000
commit6a71fc3807f5c807aaf6f60433ac71bc13a7bf3d (patch)
tree31158366042b5bd2969d3d5cd5cf48d6a20c01f2 /fs/devfs/base.c
parentbc93ea47662d8835db8a52274fefcfeddb9b08bf (diff)
Minor cleanup of fs/devfs/base.c:scan_dir_for_removable().
Diffstat (limited to 'fs/devfs/base.c')
-rw-r--r--fs/devfs/base.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index a4ee7e9dd573..f6d4c7125ebf 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -630,6 +630,9 @@
Protected <scan_dir_for_removable> and <get_removable_partition>
from changing directory contents.
v1.16
+ 20020514 Richard Gooch <rgooch@atnf.csiro.au>
+ Minor cleanup of <scan_dir_for_removable>.
+ v1.17
*/
#include <linux/types.h>
#include <linux/errno.h>
@@ -662,7 +665,7 @@
#include <asm/bitops.h>
#include <asm/atomic.h>
-#define DEVFS_VERSION "1.16 (20020512)"
+#define DEVFS_VERSION "1.17 (20020514)"
#define DEVFS_NAME "devfs"
@@ -2466,13 +2469,16 @@ static void scan_dir_for_removable (struct devfs_entry *dir)
{
struct devfs_entry *de;
- if (dir->u.dir.num_removable < 1) return;
read_lock (&dir->u.dir.lock);
- for (de = dir->u.dir.first; de != NULL; de = de->next)
+ if (dir->u.dir.num_removable < 1) de = NULL;
+ else
{
- if (S_ISBLK (de->mode) && de->u.fcb.removable) break;
+ for (de = dir->u.dir.first; de != NULL; de = de->next)
+ {
+ if (S_ISBLK (de->mode) && de->u.fcb.removable) break;
+ }
+ devfs_get (de);
}
- devfs_get (de);
read_unlock (&dir->u.dir.lock);
if (de) check_disc_changed (de);
devfs_put (de);