diff options
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r-- | fs/reiserfs/super.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index bcdf2438d152..31e75125f48b 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -110,7 +110,7 @@ static void reiserfs_unlockfs(struct super_block *s) { | |||
110 | reiserfs_allow_writes(s) ; | 110 | reiserfs_allow_writes(s) ; |
111 | } | 111 | } |
112 | 112 | ||
113 | extern const struct reiserfs_key MAX_KEY; | 113 | extern const struct in_core_key MAX_IN_CORE_KEY; |
114 | 114 | ||
115 | 115 | ||
116 | /* this is used to delete "save link" when there are no items of a | 116 | /* this is used to delete "save link" when there are no items of a |
@@ -164,7 +164,7 @@ static int finish_unfinished (struct super_block * s) | |||
164 | 164 | ||
165 | /* compose key to look for "save" links */ | 165 | /* compose key to look for "save" links */ |
166 | max_cpu_key.version = KEY_FORMAT_3_5; | 166 | max_cpu_key.version = KEY_FORMAT_3_5; |
167 | max_cpu_key.on_disk_key = MAX_KEY; | 167 | max_cpu_key.on_disk_key = MAX_IN_CORE_KEY; |
168 | max_cpu_key.key_length = 3; | 168 | max_cpu_key.key_length = 3; |
169 | 169 | ||
170 | #ifdef CONFIG_QUOTA | 170 | #ifdef CONFIG_QUOTA |
@@ -216,10 +216,10 @@ static int finish_unfinished (struct super_block * s) | |||
216 | 216 | ||
217 | /* reiserfs_iget needs k_dirid and k_objectid only */ | 217 | /* reiserfs_iget needs k_dirid and k_objectid only */ |
218 | item = B_I_PITEM (bh, ih); | 218 | item = B_I_PITEM (bh, ih); |
219 | obj_key.on_disk_key.k_dir_id = le32_to_cpu (*(__u32 *)item); | 219 | obj_key.on_disk_key.k_dir_id = le32_to_cpu (*(__le32 *)item); |
220 | obj_key.on_disk_key.k_objectid = le32_to_cpu (ih->ih_key.k_objectid); | 220 | obj_key.on_disk_key.k_objectid = le32_to_cpu (ih->ih_key.k_objectid); |
221 | obj_key.on_disk_key.u.k_offset_v1.k_offset = 0; | 221 | obj_key.on_disk_key.k_offset = 0; |
222 | obj_key.on_disk_key.u.k_offset_v1.k_uniqueness = 0; | 222 | obj_key.on_disk_key.k_type = 0; |
223 | 223 | ||
224 | pathrelse (&path); | 224 | pathrelse (&path); |
225 | 225 | ||
@@ -304,7 +304,7 @@ void add_save_link (struct reiserfs_transaction_handle * th, | |||
304 | int retval; | 304 | int retval; |
305 | struct cpu_key key; | 305 | struct cpu_key key; |
306 | struct item_head ih; | 306 | struct item_head ih; |
307 | __u32 link; | 307 | __le32 link; |
308 | 308 | ||
309 | BUG_ON (!th->t_trans_id); | 309 | BUG_ON (!th->t_trans_id); |
310 | 310 | ||
@@ -889,12 +889,18 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st | |||
889 | char * p; | 889 | char * p; |
890 | 890 | ||
891 | p = NULL; | 891 | p = NULL; |
892 | /* "resize=NNN" */ | 892 | /* "resize=NNN" or "resize=auto" */ |
893 | *blocks = simple_strtoul (arg, &p, 0); | 893 | |
894 | if (*p != '\0') { | 894 | if (!strcmp(arg, "auto")) { |
895 | /* NNN does not look like a number */ | 895 | /* From JFS code, to auto-get the size.*/ |
896 | reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg); | 896 | *blocks = s->s_bdev->bd_inode->i_size >> s->s_blocksize_bits; |
897 | return 0; | 897 | } else { |
898 | *blocks = simple_strtoul (arg, &p, 0); | ||
899 | if (*p != '\0') { | ||
900 | /* NNN does not look like a number */ | ||
901 | reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg); | ||
902 | return 0; | ||
903 | } | ||
898 | } | 904 | } |
899 | } | 905 | } |
900 | 906 | ||
@@ -903,7 +909,8 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st | |||
903 | unsigned long val = simple_strtoul (arg, &p, 0); | 909 | unsigned long val = simple_strtoul (arg, &p, 0); |
904 | /* commit=NNN (time in seconds) */ | 910 | /* commit=NNN (time in seconds) */ |
905 | if ( *p != '\0' || val >= (unsigned int)-1) { | 911 | if ( *p != '\0' || val >= (unsigned int)-1) { |
906 | reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg); return 0; | 912 | reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg); |
913 | return 0; | ||
907 | } | 914 | } |
908 | *commit_max_age = (unsigned int)val; | 915 | *commit_max_age = (unsigned int)val; |
909 | } | 916 | } |
@@ -1329,7 +1336,7 @@ static int read_super_block (struct super_block * s, int offset) | |||
1329 | return 1; | 1336 | return 1; |
1330 | } | 1337 | } |
1331 | 1338 | ||
1332 | if ( rs->s_v1.s_root_block == -1 ) { | 1339 | if ( rs->s_v1.s_root_block == cpu_to_le32(-1) ) { |
1333 | brelse(bh) ; | 1340 | brelse(bh) ; |
1334 | reiserfs_warning (s, "Unfinished reiserfsck --rebuild-tree run detected. Please run\n" | 1341 | reiserfs_warning (s, "Unfinished reiserfsck --rebuild-tree run detected. Please run\n" |
1335 | "reiserfsck --rebuild-tree and wait for a completion. If that fails\n" | 1342 | "reiserfsck --rebuild-tree and wait for a completion. If that fails\n" |