Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125767
b: refs/heads/master
c: d8e9650
h: refs/heads/master
i:
  125765: 0025f15
  125763: 66c4ce4
  125759: 514de88
v: v3
  • Loading branch information
Li Zefan authored and Al Viro committed Jan 5, 2009
1 parent c50d88e commit b45832c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c728ef583b3d82266584da5cb068294c09df31e
refs/heads/master: d8e9650dff48055057253ca30933605bd7d0733b
23 changes: 13 additions & 10 deletions trunk/fs/filesystems.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,24 +253,27 @@ static int __init proc_filesystems_init(void)
module_init(proc_filesystems_init);
#endif

struct file_system_type *get_fs_type(const char *name)
static struct file_system_type *__get_fs_type(const char *name, int len)
{
struct file_system_type *fs;
const char *dot = strchr(name, '.');
unsigned len = dot ? dot - name : strlen(name);

read_lock(&file_systems_lock);
fs = *(find_filesystem(name, len));
if (fs && !try_module_get(fs->owner))
fs = NULL;
read_unlock(&file_systems_lock);
if (!fs && (request_module("%.*s", len, name) == 0)) {
read_lock(&file_systems_lock);
fs = *(find_filesystem(name, len));
if (fs && !try_module_get(fs->owner))
fs = NULL;
read_unlock(&file_systems_lock);
}
return fs;
}

struct file_system_type *get_fs_type(const char *name)
{
struct file_system_type *fs;
const char *dot = strchr(name, '.');
int len = dot ? dot - name : strlen(name);

fs = __get_fs_type(name, len);
if (!fs && (request_module("%.*s", len, name) == 0))
fs = __get_fs_type(name, len);

if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) {
put_filesystem(fs);
Expand Down

0 comments on commit b45832c

Please sign in to comment.