lkml.org 
[lkml]   [2012]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectAccess files from kernel
On Wed, Oct 03, 2012 at 09:38:52AM -0700, Linus Torvalds wrote:
>+static bool fw_get_filesystem_firmware(struct firmware *fw, const char *name)
>+{
>+ int i;
>+ bool success = false;
>+ const char *fw_path[] = { "/lib/firmware/update", "/firmware", "/lib/firmware" };
>+ char *path = __getname();
>+
>+printk("Trying to load fw '%s' ", name);
>+ for (i = 0; i < ARRAY_SIZE(fw_path); i++) {
>+ struct file *file;
>+ snprintf(path, PATH_MAX, "%s/%s", fw_path[i], name);
>+
>+ file = filp_open(path, O_RDONLY, 0);

AFAIK, accessing files on filesystem form kernel directly was no-go for a
long time. What's the new rule here?

Is it worth to introduce an execption, if it's possible to solve the
problem in userspace.

--
Kirill A. Shutemov


\
 
 \ /
  Last update: 2012-10-03 22:22    [W:0.143 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site