original development tree for Linux kernel GTP module; now long in mainline.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

631 lines
15 KiB

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
12 years ago
fs: Limit sys_mount to only request filesystem modules. Modify the request_module to prefix the file system type with "fs-" and add aliases to all of the filesystems that can be built as modules to match. A common practice is to build all of the kernel code and leave code that is not commonly needed as modules, with the result that many users are exposed to any bug anywhere in the kernel. Looking for filesystems with a fs- prefix limits the pool of possible modules that can be loaded by mount to just filesystems trivially making things safer with no real cost. Using aliases means user space can control the policy of which filesystem modules are auto-loaded by editing /etc/modprobe.d/*.conf with blacklist and alias directives. Allowing simple, safe, well understood work-arounds to known problematic software. This also addresses a rare but unfortunate problem where the filesystem name is not the same as it's module name and module auto-loading would not work. While writing this patch I saw a handful of such cases. The most significant being autofs that lives in the module autofs4. This is relevant to user namespaces because we can reach the request module in get_fs_type() without having any special permissions, and people get uncomfortable when a user specified string (in this case the filesystem type) goes all of the way to request_module. After having looked at this issue I don't think there is any particular reason to perform any filtering or permission checks beyond making it clear in the module request that we want a filesystem module. The common pattern in the kernel is to call request_module() without regards to the users permissions. In general all a filesystem module does once loaded is call register_filesystem() and go to sleep. Which means there is not much attack surface exposed by loading a filesytem module unless the filesystem is mounted. In a user namespace filesystems are not mounted unless .fs_flags = FS_USERNS_MOUNT, which most filesystems do not set today. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Acked-by: Kees Cook <keescook@chromium.org> Reported-by: Kees Cook <keescook@google.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
9 years ago
14 years ago
  1. /*
  2. * IBM ASM Service Processor Device Driver
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. *
  18. * Copyright (C) IBM Corporation, 2004
  19. *
  20. * Author: Max Asböck <amax@us.ibm.com>
  21. *
  22. */
  23. /*
  24. * Parts of this code are based on an article by Jonathan Corbet
  25. * that appeared in Linux Weekly News.
  26. */
  27. /*
  28. * The IBMASM file virtual filesystem. It creates the following hierarchy
  29. * dynamically when mounted from user space:
  30. *
  31. * /ibmasm
  32. * |-- 0
  33. * | |-- command
  34. * | |-- event
  35. * | |-- reverse_heartbeat
  36. * | `-- remote_video
  37. * | |-- depth
  38. * | |-- height
  39. * | `-- width
  40. * .
  41. * .
  42. * .
  43. * `-- n
  44. * |-- command
  45. * |-- event
  46. * |-- reverse_heartbeat
  47. * `-- remote_video
  48. * |-- depth
  49. * |-- height
  50. * `-- width
  51. *
  52. * For each service processor the following files are created:
  53. *
  54. * command: execute dot commands
  55. * write: execute a dot command on the service processor
  56. * read: return the result of a previously executed dot command
  57. *
  58. * events: listen for service processor events
  59. * read: sleep (interruptible) until an event occurs
  60. * write: wakeup sleeping event listener
  61. *
  62. * reverse_heartbeat: send a heartbeat to the service processor
  63. * read: sleep (interruptible) until the reverse heartbeat fails
  64. * write: wakeup sleeping heartbeat listener
  65. *
  66. * remote_video/width
  67. * remote_video/height
  68. * remote_video/width: control remote display settings
  69. * write: set value
  70. * read: read value
  71. */
  72. #include <linux/fs.h>
  73. #include <linux/pagemap.h>
  74. #include <linux/slab.h>
  75. #include <asm/uaccess.h>
  76. #include <asm/io.h>
  77. #include "ibmasm.h"
  78. #include "remote.h"
  79. #include "dot_command.h"
  80. #define IBMASMFS_MAGIC 0x66726f67
  81. static LIST_HEAD(service_processors);
  82. static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode);
  83. static void ibmasmfs_create_files (struct super_block *sb);
  84. static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);
  85. static struct dentry *ibmasmfs_mount(struct file_system_type *fst,
  86. int flags, const char *name, void *data)
  87. {
  88. return mount_single(fst, flags, data, ibmasmfs_fill_super);
  89. }
  90. static const struct super_operations ibmasmfs_s_ops = {
  91. .statfs = simple_statfs,
  92. .drop_inode = generic_delete_inode,
  93. };
  94. static const struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations;
  95. static struct file_system_type ibmasmfs_type = {
  96. .owner = THIS_MODULE,
  97. .name = "ibmasmfs",
  98. .mount = ibmasmfs_mount,
  99. .kill_sb = kill_litter_super,
  100. };
  101. MODULE_ALIAS_FS("ibmasmfs");
  102. static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent)
  103. {
  104. struct inode *root;
  105. sb->s_blocksize = PAGE_CACHE_SIZE;
  106. sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
  107. sb->s_magic = IBMASMFS_MAGIC;
  108. sb->s_op = &ibmasmfs_s_ops;
  109. sb->s_time_gran = 1;
  110. root = ibmasmfs_make_inode (sb, S_IFDIR | 0500);
  111. if (!root)
  112. return -ENOMEM;
  113. root->i_op = &simple_dir_inode_operations;
  114. root->i_fop = ibmasmfs_dir_ops;
  115. sb->s_root = d_make_root(root);
  116. if (!sb->s_root)
  117. return -ENOMEM;
  118. ibmasmfs_create_files(sb);
  119. return 0;
  120. }
  121. static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)
  122. {
  123. struct inode *ret = new_inode(sb);
  124. if (ret) {
  125. ret->i_ino = get_next_ino();
  126. ret->i_mode = mode;
  127. ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
  128. }
  129. return ret;
  130. }
  131. static struct dentry *ibmasmfs_create_file (struct super_block *sb,
  132. struct dentry *parent,
  133. const char *name,
  134. const struct file_operations *fops,
  135. void *data,
  136. int mode)
  137. {
  138. struct dentry *dentry;
  139. struct inode *inode;
  140. dentry = d_alloc_name(parent, name);
  141. if (!dentry)
  142. return NULL;
  143. inode = ibmasmfs_make_inode(sb, S_IFREG | mode);
  144. if (!inode) {
  145. dput(dentry);
  146. return NULL;
  147. }
  148. inode->i_fop = fops;
  149. inode->i_private = data;
  150. d_add(dentry, inode);
  151. return dentry;
  152. }
  153. static struct dentry *ibmasmfs_create_dir (struct super_block *sb,
  154. struct dentry *parent,
  155. const char *name)
  156. {
  157. struct dentry *dentry;
  158. struct inode *inode;
  159. dentry = d_alloc_name(parent, name);
  160. if (!dentry)
  161. return NULL;
  162. inode = ibmasmfs_make_inode(sb, S_IFDIR | 0500);
  163. if (!inode) {
  164. dput(dentry);
  165. return NULL;
  166. }
  167. inode->i_op = &simple_dir_inode_operations;
  168. inode->i_fop = ibmasmfs_dir_ops;
  169. d_add(dentry, inode);
  170. return dentry;
  171. }
  172. int ibmasmfs_register(void)
  173. {
  174. return register_filesystem(&ibmasmfs_type);
  175. }
  176. void ibmasmfs_unregister(void)
  177. {
  178. unregister_filesystem(&ibmasmfs_type);
  179. }
  180. void ibmasmfs_add_sp(struct service_processor *sp)
  181. {
  182. list_add(&sp->node, &service_processors);
  183. }
  184. /* struct to save state between command file operations */
  185. struct ibmasmfs_command_data {
  186. struct service_processor *sp;
  187. struct command *command;
  188. };
  189. /* struct to save state between event file operations */
  190. struct ibmasmfs_event_data {
  191. struct service_processor *sp;
  192. struct event_reader reader;
  193. int active;
  194. };
  195. /* struct to save state between reverse heartbeat file operations */
  196. struct ibmasmfs_heartbeat_data {
  197. struct service_processor *sp;
  198. struct reverse_heartbeat heartbeat;
  199. int active;
  200. };
  201. static int command_file_open(struct inode *inode, struct file *file)
  202. {
  203. struct ibmasmfs_command_data *command_data;
  204. if (!inode->i_private)
  205. return -ENODEV;
  206. command_data = kmalloc(sizeof(struct ibmasmfs_command_data), GFP_KERNEL);
  207. if (!command_data)
  208. return -ENOMEM;
  209. command_data->command = NULL;
  210. command_data->sp = inode->i_private;
  211. file->private_data = command_data;
  212. return 0;
  213. }
  214. static int command_file_close(struct inode *inode, struct file *file)
  215. {
  216. struct ibmasmfs_command_data *command_data = file->private_data;
  217. if (command_data->command)
  218. command_put(command_data->command);
  219. kfree(command_data);
  220. return 0;
  221. }
  222. static ssize_t command_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  223. {
  224. struct ibmasmfs_command_data *command_data = file->private_data;
  225. struct command *cmd;
  226. int len;
  227. unsigned long flags;
  228. if (*offset < 0)
  229. return -EINVAL;
  230. if (count == 0 || count > IBMASM_CMD_MAX_BUFFER_SIZE)
  231. return 0;
  232. if (*offset != 0)
  233. return 0;
  234. spin_lock_irqsave(&command_data->sp->lock, flags);
  235. cmd = command_data->command;
  236. if (cmd == NULL) {
  237. spin_unlock_irqrestore(&command_data->sp->lock, flags);
  238. return 0;
  239. }
  240. command_data->command = NULL;
  241. spin_unlock_irqrestore(&command_data->sp->lock, flags);
  242. if (cmd->status != IBMASM_CMD_COMPLETE) {
  243. command_put(cmd);
  244. return -EIO;
  245. }
  246. len = min(count, cmd->buffer_size);
  247. if (copy_to_user(buf, cmd->buffer, len)) {
  248. command_put(cmd);
  249. return -EFAULT;
  250. }
  251. command_put(cmd);
  252. return len;
  253. }
  254. static ssize_t command_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
  255. {
  256. struct ibmasmfs_command_data *command_data = file->private_data;
  257. struct command *cmd;
  258. unsigned long flags;
  259. if (*offset < 0)
  260. return -EINVAL;
  261. if (count == 0 || count > IBMASM_CMD_MAX_BUFFER_SIZE)
  262. return 0;
  263. if (*offset != 0)
  264. return 0;
  265. /* commands are executed sequentially, only one command at a time */
  266. if (command_data->command)
  267. return -EAGAIN;
  268. cmd = ibmasm_new_command(command_data->sp, count);
  269. if (!cmd)
  270. return -ENOMEM;
  271. if (copy_from_user(cmd->buffer, ubuff, count)) {
  272. command_put(cmd);
  273. return -EFAULT;
  274. }
  275. spin_lock_irqsave(&command_data->sp->lock, flags);
  276. if (command_data->command) {
  277. spin_unlock_irqrestore(&command_data->sp->lock, flags);
  278. command_put(cmd);
  279. return -EAGAIN;
  280. }
  281. command_data->command = cmd;
  282. spin_unlock_irqrestore(&command_data->sp->lock, flags);
  283. ibmasm_exec_command(command_data->sp, cmd);
  284. ibmasm_wait_for_response(cmd, get_dot_command_timeout(cmd->buffer));
  285. return count;
  286. }
  287. static int event_file_open(struct inode *inode, struct file *file)
  288. {
  289. struct ibmasmfs_event_data *event_data;
  290. struct service_processor *sp;
  291. if (!inode->i_private)
  292. return -ENODEV;
  293. sp = inode->i_private;
  294. event_data = kmalloc(sizeof(struct ibmasmfs_event_data), GFP_KERNEL);
  295. if (!event_data)
  296. return -ENOMEM;
  297. ibmasm_event_reader_register(sp, &event_data->reader);
  298. event_data->sp = sp;
  299. event_data->active = 0;
  300. file->private_data = event_data;
  301. return 0;
  302. }
  303. static int event_file_close(struct inode *inode, struct file *file)
  304. {
  305. struct ibmasmfs_event_data *event_data = file->private_data;
  306. ibmasm_event_reader_unregister(event_data->sp, &event_data->reader);
  307. kfree(event_data);
  308. return 0;
  309. }
  310. static ssize_t event_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  311. {
  312. struct ibmasmfs_event_data *event_data = file->private_data;
  313. struct event_reader *reader = &event_data->reader;
  314. struct service_processor *sp = event_data->sp;
  315. int ret;
  316. unsigned long flags;
  317. if (*offset < 0)
  318. return -EINVAL;
  319. if (count == 0 || count > IBMASM_EVENT_MAX_SIZE)
  320. return 0;
  321. if (*offset != 0)
  322. return 0;
  323. spin_lock_irqsave(&sp->lock, flags);
  324. if (event_data->active) {
  325. spin_unlock_irqrestore(&sp->lock, flags);
  326. return -EBUSY;
  327. }
  328. event_data->active = 1;
  329. spin_unlock_irqrestore(&sp->lock, flags);
  330. ret = ibmasm_get_next_event(sp, reader);
  331. if (ret <= 0)
  332. goto out;
  333. if (count < reader->data_size) {
  334. ret = -EINVAL;
  335. goto out;
  336. }
  337. if (copy_to_user(buf, reader->data, reader->data_size)) {
  338. ret = -EFAULT;
  339. goto out;
  340. }
  341. ret = reader->data_size;
  342. out:
  343. event_data->active = 0;
  344. return ret;
  345. }
  346. static ssize_t event_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
  347. {
  348. struct ibmasmfs_event_data *event_data = file->private_data;
  349. if (*offset < 0)
  350. return -EINVAL;
  351. if (count != 1)
  352. return 0;
  353. if (*offset != 0)
  354. return 0;
  355. ibmasm_cancel_next_event(&event_data->reader);
  356. return 0;
  357. }
  358. static int r_heartbeat_file_open(struct inode *inode, struct file *file)
  359. {
  360. struct ibmasmfs_heartbeat_data *rhbeat;
  361. if (!inode->i_private)
  362. return -ENODEV;
  363. rhbeat = kmalloc(sizeof(struct ibmasmfs_heartbeat_data), GFP_KERNEL);
  364. if (!rhbeat)
  365. return -ENOMEM;
  366. rhbeat->sp = inode->i_private;
  367. rhbeat->active = 0;
  368. ibmasm_init_reverse_heartbeat(rhbeat->sp, &rhbeat->heartbeat);
  369. file->private_data = rhbeat;
  370. return 0;
  371. }
  372. static int r_heartbeat_file_close(struct inode *inode, struct file *file)
  373. {
  374. struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
  375. kfree(rhbeat);
  376. return 0;
  377. }
  378. static ssize_t r_heartbeat_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  379. {
  380. struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
  381. unsigned long flags;
  382. int result;
  383. if (*offset < 0)
  384. return -EINVAL;
  385. if (count == 0 || count > 1024)
  386. return 0;
  387. if (*offset != 0)
  388. return 0;
  389. /* allow only one reverse heartbeat per process */
  390. spin_lock_irqsave(&rhbeat->sp->lock, flags);
  391. if (rhbeat->active) {
  392. spin_unlock_irqrestore(&rhbeat->sp->lock, flags);
  393. return -EBUSY;
  394. }
  395. rhbeat->active = 1;
  396. spin_unlock_irqrestore(&rhbeat->sp->lock, flags);
  397. result = ibmasm_start_reverse_heartbeat(rhbeat->sp, &rhbeat->heartbeat);
  398. rhbeat->active = 0;
  399. return result;
  400. }
  401. static ssize_t r_heartbeat_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
  402. {
  403. struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
  404. if (*offset < 0)
  405. return -EINVAL;
  406. if (count != 1)
  407. return 0;
  408. if (*offset != 0)
  409. return 0;
  410. if (rhbeat->active)
  411. ibmasm_stop_reverse_heartbeat(&rhbeat->heartbeat);
  412. return 1;
  413. }
  414. static int remote_settings_file_close(struct inode *inode, struct file *file)
  415. {
  416. return 0;
  417. }
  418. static ssize_t remote_settings_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  419. {
  420. void __iomem *address = (void __iomem *)file->private_data;
  421. unsigned char *page;
  422. int retval;
  423. int len = 0;
  424. unsigned int value;
  425. if (*offset < 0)
  426. return -EINVAL;
  427. if (count == 0 || count > 1024)
  428. return 0;
  429. if (*offset != 0)
  430. return 0;
  431. page = (unsigned char *)__get_free_page(GFP_KERNEL);
  432. if (!page)
  433. return -ENOMEM;
  434. value = readl(address);
  435. len = sprintf(page, "%d\n", value);
  436. if (copy_to_user(buf, page, len)) {
  437. retval = -EFAULT;
  438. goto exit;
  439. }
  440. *offset += len;
  441. retval = len;
  442. exit:
  443. free_page((unsigned long)page);
  444. return retval;
  445. }
  446. static ssize_t remote_settings_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
  447. {
  448. void __iomem *address = (void __iomem *)file->private_data;
  449. char *buff;
  450. unsigned int value;
  451. if (*offset < 0)
  452. return -EINVAL;
  453. if (count == 0 || count > 1024)
  454. return 0;
  455. if (*offset != 0)
  456. return 0;
  457. buff = kzalloc (count + 1, GFP_KERNEL);
  458. if (!buff)
  459. return -ENOMEM;
  460. if (copy_from_user(buff, ubuff, count)) {
  461. kfree(buff);
  462. return -EFAULT;
  463. }
  464. value = simple_strtoul(buff, NULL, 10);
  465. writel(value, address);
  466. kfree(buff);
  467. return count;
  468. }
  469. static const struct file_operations command_fops = {
  470. .open = command_file_open,
  471. .release = command_file_close,
  472. .read = command_file_read,
  473. .write = command_file_write,
  474. .llseek = generic_file_llseek,
  475. };
  476. static const struct file_operations event_fops = {
  477. .open = event_file_open,
  478. .release = event_file_close,
  479. .read = event_file_read,
  480. .write = event_file_write,
  481. .llseek = generic_file_llseek,
  482. };
  483. static const struct file_operations r_heartbeat_fops = {
  484. .open = r_heartbeat_file_open,
  485. .release = r_heartbeat_file_close,
  486. .read = r_heartbeat_file_read,
  487. .write = r_heartbeat_file_write,
  488. .llseek = generic_file_llseek,
  489. };
  490. static const struct file_operations remote_settings_fops = {
  491. .open = simple_open,
  492. .release = remote_settings_file_close,
  493. .read = remote_settings_file_read,
  494. .write = remote_settings_file_write,
  495. .llseek = generic_file_llseek,
  496. };
  497. static void ibmasmfs_create_files (struct super_block *sb)
  498. {
  499. struct list_head *entry;
  500. struct service_processor *sp;
  501. list_for_each(entry, &service_processors) {
  502. struct dentry *dir;
  503. struct dentry *remote_dir;
  504. sp = list_entry(entry, struct service_processor, node);
  505. dir = ibmasmfs_create_dir(sb, sb->s_root, sp->dirname);
  506. if (!dir)
  507. continue;
  508. ibmasmfs_create_file(sb, dir, "command", &command_fops, sp, S_IRUSR|S_IWUSR);
  509. ibmasmfs_create_file(sb, dir, "event", &event_fops, sp, S_IRUSR|S_IWUSR);
  510. ibmasmfs_create_file(sb, dir, "reverse_heartbeat", &r_heartbeat_fops, sp, S_IRUSR|S_IWUSR);
  511. remote_dir = ibmasmfs_create_dir(sb, dir, "remote_video");
  512. if (!remote_dir)
  513. continue;
  514. ibmasmfs_create_file(sb, remote_dir, "width", &remote_settings_fops, (void *)display_width(sp), S_IRUSR|S_IWUSR);
  515. ibmasmfs_create_file(sb, remote_dir, "height", &remote_settings_fops, (void *)display_height(sp), S_IRUSR|S_IWUSR);
  516. ibmasmfs_create_file(sb, remote_dir, "depth", &remote_settings_fops, (void *)display_depth(sp), S_IRUSR|S_IWUSR);
  517. }
  518. }