Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-11 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/30/2014 05:58 PM, Qu Wenruo wrote: > 2. Heavy dependency If use it, btrfs-progs will include RDBMS as > the make and runtime dependency. Such low level progs depend on > high level programs like sqlite3 may be very strange. BTW SQLite is designe

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-11 Thread Martin Steigerwald
Hi Qu, Am Dienstag, 2. Dezember 2014, 08:37:44 schrieb Qu Wenruo: > Original Message > Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? > From: Austin S Hemmelgarn > To: Qu Wenruo , linux-btrfs > > Date: 2014年12月01日 20:53 > &g

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-10 Thread Zygo Blaxell
On Thu, Dec 11, 2014 at 10:05:20AM +0800, Qu Wenruo wrote: > > Original Message > Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? > From: Zygo Blaxell > To: Qu Wenruo > Date: 2014年12月11日 05:57 > >On Thu, Dec 04, 2014 at 02:

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-10 Thread Qu Wenruo
Original Message Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? From: Zygo Blaxell To: Qu Wenruo Date: 2014年12月11日 05:57 On Thu, Dec 04, 2014 at 02:56:55PM +0800, Qu Wenruo wrote: The main memory usage in btrfsck is extent record, which we

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-10 Thread Zygo Blaxell
On Thu, Dec 04, 2014 at 02:56:55PM +0800, Qu Wenruo wrote: > The main memory usage in btrfsck is extent record, which > we can't free them until we read them all in and checked, so even we > mmap/unmap, it can only help with > the extent_buffer(which is already freed if not used according to refs).

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-03 Thread Qu Wenruo
Original Message Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? From: Robert White To: Qu Wenruo , linux-btrfs Date: 2014年12月04日 03:18 On 12/01/2014 05:17 PM, Qu Wenruo wrote: But I am also somewhat tired of bringing new structure new

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-03 Thread Robert White
On 12/01/2014 05:17 PM, Qu Wenruo wrote: But I am also somewhat tired of bringing new structure new searching functions or even bring larger change on the btrfsck record infrastructure when I found that can't provide the function when new recovery function is going to be implemented. DISCLAIMER

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-01 Thread Qu Wenruo
Original Message Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? From: Robert White To: Qu Wenruo , linux-btrfs Date: 2014年12月02日 02:10 On 11/30/2014 10:18 PM, Qu Wenruo wrote: (advocacy for using SQL internally for btrfsck) All of these

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-01 Thread Qu Wenruo
Original Message Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? From: Austin S Hemmelgarn To: Qu Wenruo , linux-btrfs Date: 2014年12月01日 20:53 On 2014-11-30 20:58, Qu Wenruo wrote: [snipped] So, I think this does a good job of highlighting

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-01 Thread Robert White
On 11/30/2014 10:18 PM, Qu Wenruo wrote: (advocacy for using SQL internally for btrfsck) All of these ideas you want to toss a entire SQL front end on are more simply handled with simple data structures. In C++ terms "map" and/or "map>" beats the heck out of including all of SQL and its rel

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-12-01 Thread Austin S Hemmelgarn
On 2014-11-30 20:58, Qu Wenruo wrote: [BACKGROUND] I'm trying to implement the function to repair missing inode item. Under that case, inode type must be salvaged(although it can be fallback to FILE). One case should be, if there is any dir_item/index or inode_ref refers the inode as parent, the

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-11-30 Thread Qu Wenruo
Original Message Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? From: Duncan <1i5t5.dun...@cox.net> To: Date: 2014年12月01日 13:47 Qu Wenruo posted on Mon, 01 Dec 2014 11:24:50 +0800 as excerpted: The db file is mostly used in memory, onl

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-11-30 Thread Qu Wenruo
Original Message Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? From: Robert White To: Qu Wenruo , linux-btrfs Date: 2014年12月01日 12:03 On 11/30/2014 05:58 PM, Qu Wenruo wrote: ("why not use SQL to..." suggestion) SQL, as in Struct

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-11-30 Thread Duncan
Qu Wenruo posted on Mon, 01 Dec 2014 11:24:50 +0800 as excerpted: > The db file is mostly used in memory, only when the metadata is really > really big, maybe when the fs tree's level is 7 or 8 we may need to use > db file. So fscking the database in ordered to fsck the database isn't an issue.

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-11-30 Thread Robert White
On 11/30/2014 05:58 PM, Qu Wenruo wrote: ("why not use SQL to..." suggestion) SQL, as in Structured Query Language, is _terrible_ for recursion. It expresses all of its elements in terms of set theory and really can only implement union and intersection of flat sets. Several companies offer

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-11-30 Thread Qu Wenruo
Original Message Subject: Re: Crazy idea of cleanup the inode_record btrfsck things with SQL? From: Duncan <1i5t5.dun...@cox.net> To: Date: 2014年12月01日 11:08 Qu Wenruo posted on Mon, 01 Dec 2014 09:58:27 +0800 as excerpted: [CRAZY IDEA] So why not using SQL to impleme

Re: Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-11-30 Thread Duncan
Qu Wenruo posted on Mon, 01 Dec 2014 09:58:27 +0800 as excerpted: > [CRAZY IDEA] > So why not using SQL to implement the btrfsck inode-record things? > 2. Heavy dependency > If use it, btrfs-progs will include RDBMS as the make and runtime > dependency. Such low level progs depend on hig

Crazy idea of cleanup the inode_record btrfsck things with SQL?

2014-11-30 Thread Qu Wenruo
[BACKGROUND] I'm trying to implement the function to repair missing inode item. Under that case, inode type must be salvaged(although it can be fallback to FILE). One case should be, if there is any dir_item/index or inode_ref refers the inode as parent, the type of that inode must be DIR. Howev