5 |
* |
* |
6 |
* Copyright (C) 2005-2007 NTT DATA CORPORATION |
* Copyright (C) 2005-2007 NTT DATA CORPORATION |
7 |
* |
* |
8 |
* Version: 1.5.3-pre 2007/12/03 |
* Version: 1.5.3-pre 2007/12/17 |
9 |
* |
* |
10 |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
11 |
* See README.ccs for ChangeLog. |
* See README.ccs for ChangeLog. |
205 |
static void NormalizeLine(unsigned char *buffer) |
static void NormalizeLine(unsigned char *buffer) |
206 |
{ |
{ |
207 |
unsigned char *sp = buffer, *dp = buffer; |
unsigned char *sp = buffer, *dp = buffer; |
208 |
int first = 1; |
_Bool first = 1; |
209 |
while (*sp && (*sp <= ' ' || *sp >= 127)) sp++; |
while (*sp && (*sp <= ' ' || *sp >= 127)) sp++; |
210 |
while (*sp) { |
while (*sp) { |
211 |
if (!first) *dp++ = ' '; |
if (!first) *dp++ = ' '; |
277 |
|
|
278 |
struct syaoran_sb_info { |
struct syaoran_sb_info { |
279 |
struct list_head list; |
struct list_head list; |
280 |
int initialize_done; /* Zero if initialization is in progress. */ |
_Bool initialize_done; /* False if initialization is in progress. */ |
281 |
int is_permissive_mode; /* Nonzero if permissive mode. */ |
_Bool is_permissive_mode; /* True if permissive mode. */ |
282 |
}; |
}; |
283 |
|
|
284 |
static int RegisterNodeInfo(char *buffer, struct super_block *sb) |
static int RegisterNodeInfo(char *buffer, struct super_block *sb) |
505 |
static int Syaoran_Initialize(struct super_block *sb, void *data) |
static int Syaoran_Initialize(struct super_block *sb, void *data) |
506 |
{ |
{ |
507 |
int error = -EINVAL; |
int error = -EINVAL; |
508 |
static int first = 1; |
static _Bool first = 1; |
509 |
if (first) { |
if (first) { |
510 |
first = 0; |
first = 0; |
511 |
printk("SYAORAN: 1.5.3-pre 2007/12/03\n"); |
printk("SYAORAN: 1.5.3-pre 2007/12/17\n"); |
512 |
} |
} |
513 |
{ |
{ |
514 |
struct inode *inode = new_inode(sb); |
struct inode *inode = new_inode(sb); |
533 |
if (data) { |
if (data) { |
534 |
struct file *f; |
struct file *f; |
535 |
char *filename = (char *) data; |
char *filename = (char *) data; |
536 |
int is_permissive_mode = syaoran_default_mode; |
_Bool is_permissive_mode = syaoran_default_mode; |
537 |
/* If mode is given with mount operation, use it. */ |
/* If mode is given with mount operation, use it. */ |
538 |
if (strncmp(filename, "accept=", 7) == 0) { |
if (strncmp(filename, "accept=", 7) == 0) { |
539 |
filename += 7; |
filename += 7; |
541 |
} else if (strncmp(filename, "enforce=", 8) == 0) { |
} else if (strncmp(filename, "enforce=", 8) == 0) { |
542 |
filename += 8; |
filename += 8; |
543 |
is_permissive_mode = 0; |
is_permissive_mode = 0; |
544 |
} else if (is_permissive_mode == -1) { |
} else if (syaoran_default_mode == -1) { |
545 |
/* If mode is not given with command line, abort mount. */ |
/* If mode is not given with command line, abort mount. */ |
546 |
printk("SYAORAN: Missing 'accept=' or 'enforce='.\n"); |
printk("SYAORAN: Missing 'accept=' or 'enforce='.\n"); |
547 |
return -EINVAL; |
return -EINVAL; |