minix filesystem: Corrected patch
Hi Pekka!
Quoted 8 lines · you
+ offset = p - kaddr;
Review
Quoted 3 lines
(quoted diff) +3
-0+ over = filldir(dirent, de3->name, l, + (n<<PAGE_CACHE_SHIFT) | offset, + de3->inode, DT_UNKNOWN);Hmm, strange formatting. Wouldn't it be better if you introduced a name pointer and moved those filldir bits outside of the if-else block? Less code duplication that way.
+ if (namecompare(namelen,sbi->s_namelen,name,de3->name))
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ goto found; + }Same here.
+ gotoout_unlock;Review
Quoted 2 lines
(quoted diff) +2
-0+ de = minix_next_entry(de, sbi); + de3 = minix_next_entry(de3, sbi);Why do you do both here?
You are right, but I thought that duplication was the appropiate to be the most conservative with the preexistent code and also providing for the needed duplication of the strucutre minix_dir_entry. The secondary structure (minix3_dir_entry) has to follow all the endeavours of its parent one, so both are here.
Quoted 5 lines
+
sbi->s_log_zone_size= *(__u16 *)(bh->b_data + 12);Review
Quoted 2 lines
(quoted diff) +2
-0+ sbi->s_max_size = *(__u32 *)(bh->b_data + 16); + sbi->s_nzones = *(__u32 *)(bh->b_data + 20);You probably want to introduce a struct
minix3_super_blockfor this. It's much more readable that way.
Yes, but if I do, is closer to a rewrite of the preexistent code. And I think that it not deserves it. Minix is not so important (sorry if some one is listening).
Quoted 3 lines
+ goto
out_bad_hblock;Quoted 1 line
+ }
You're now setting the block size twice for the V3 case.
You are right.
Quoted 3 lines
+#define
MINIX2_INODES_PER_BLOCK(b)((b)/(sizeof (structminix2_inode))) Maybe this should be calledminix_inodes_per_blockinstead and be a static inline function?
Just to follow the style found.
Hi Daniel,
Quoted 3 lines · Daniel Aragonés
Yes, but if I do, is closer to a rewrite of the preexistent code. And I think that it not deserves it. Minix is not so important (sorry if some one is listening).
Then what's the point of merging your patch to the mainline? We want clean maintainable code in the kernel so I hope you reconsider addressing my comments. Thanks.
Pekka