* block allocation for ext2_mkdir
@ 2008-12-18 18:42 Rohit Sharma
2008-12-18 19:52 ` Rohit Sharma
0 siblings, 1 reply; 11+ messages in thread
From: Rohit Sharma @ 2008-12-18 18:42 UTC (permalink / raw)
To: Kernelnewbies, ext4
How does ext2 allocate blocks for directory.
ext2_mkdir calls ext2_make_empty
ext2_make_empty calls __ext2_write_begin
__ ext2_write_begin calls block_write_begin
my query is that how does this function allocates blocks for directories. ??
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-18 18:42 block allocation for ext2_mkdir Rohit Sharma
@ 2008-12-18 19:52 ` Rohit Sharma
2008-12-18 22:39 ` Jan Kara
0 siblings, 1 reply; 11+ messages in thread
From: Rohit Sharma @ 2008-12-18 19:52 UTC (permalink / raw)
To: Kernelnewbies, ext4
On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
> How does ext2 allocate blocks for directory.
>
> ext2_mkdir calls ext2_make_empty
>
> ext2_make_empty calls __ext2_write_begin
>
> __ ext2_write_begin calls block_write_begin
>
> my query is that how does this function allocates blocks for directories. ??
>
Does ext2 uses ext2_get_block to allocate blocks for both files and
directories. ??
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-18 19:52 ` Rohit Sharma
@ 2008-12-18 22:39 ` Jan Kara
2008-12-19 7:42 ` Rohit Sharma
0 siblings, 1 reply; 11+ messages in thread
From: Jan Kara @ 2008-12-18 22:39 UTC (permalink / raw)
To: Rohit Sharma; +Cc: Kernelnewbies, ext4
> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
> > How does ext2 allocate blocks for directory.
> >
> > ext2_mkdir calls ext2_make_empty
> >
> > ext2_make_empty calls __ext2_write_begin
> >
> > __ ext2_write_begin calls block_write_begin
> >
> > my query is that how does this function allocates blocks for directories. ??
> >
>
> Does ext2 uses ext2_get_block to allocate blocks for both files and
> directories. ??
Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
ways as ordinary files and thus ext2_get_block is used for block
allocation.
Honza
--
Jan Kara <jack@suse.cz>
SuSE CR Labs
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-18 22:39 ` Jan Kara
@ 2008-12-19 7:42 ` Rohit Sharma
2008-12-19 9:21 ` Sandeep K Sinha
2008-12-19 9:35 ` Peter Teoh
0 siblings, 2 replies; 11+ messages in thread
From: Rohit Sharma @ 2008-12-19 7:42 UTC (permalink / raw)
To: Jan Kara; +Cc: Kernelnewbies, ext4
On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@suse.cz> wrote:
>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>> > How does ext2 allocate blocks for directory.
>> >
>> > ext2_mkdir calls ext2_make_empty
>> >
>> > ext2_make_empty calls __ext2_write_begin
>> >
>> > __ ext2_write_begin calls block_write_begin
>> >
>> > my query is that how does this function allocates blocks for directories. ??
>> >
>>
>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>> directories. ??
> Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
> ways as ordinary files and thus ext2_get_block is used for block
> allocation.
>
Can i modify this function to restrict allocation of blocks
to a particular block group ?
Like i want that my abc.txt file should be in block group 5 suppose, then
what should i do?
> Honza
>
> --
> Jan Kara <jack@suse.cz>
> SuSE CR Labs
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-19 7:42 ` Rohit Sharma
@ 2008-12-19 9:21 ` Sandeep K Sinha
2008-12-19 9:35 ` Peter Teoh
1 sibling, 0 replies; 11+ messages in thread
From: Sandeep K Sinha @ 2008-12-19 9:21 UTC (permalink / raw)
To: Rohit Sharma; +Cc: Jan Kara, Kernelnewbies, ext4
On Fri, Dec 19, 2008 at 1:12 PM, Rohit Sharma <imreckless@gmail.com> wrote:
> On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@suse.cz> wrote:
>>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>>> > How does ext2 allocate blocks for directory.
>>> >
>>> > ext2_mkdir calls ext2_make_empty
>>> >
>>> > ext2_make_empty calls __ext2_write_begin
>>> >
>>> > __ ext2_write_begin calls block_write_begin
>>> >
>>> > my query is that how does this function allocates blocks for directories. ??
>>> >
>>>
>>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>>> directories. ??
>> Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
>> ways as ordinary files and thus ext2_get_block is used for block
>> allocation.
>>
>
> Can i modify this function to restrict allocation of blocks
> to a particular block group ?
Did you forget to mention "ONLY FOR YOUR PERSONAL USE, IN YOUR PRIVATE KERNEL".
>
> Like i want that my abc.txt file should be in block group 5 suppose, then
> what should i do?
>
>> Honza
>>
>> --
>> Jan Kara <jack@suse.cz>
>> SuSE CR Labs
>>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
--
Regards,
Sandeep.
"To learn is to change. Education is a process that changes the learner."
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-19 7:42 ` Rohit Sharma
2008-12-19 9:21 ` Sandeep K Sinha
@ 2008-12-19 9:35 ` Peter Teoh
2008-12-19 11:18 ` Rohit Sharma
1 sibling, 1 reply; 11+ messages in thread
From: Peter Teoh @ 2008-12-19 9:35 UTC (permalink / raw)
To: Rohit Sharma; +Cc: Jan Kara, Kernelnewbies, ext4
On Fri, Dec 19, 2008 at 3:42 PM, Rohit Sharma <imreckless@gmail.com> wrote:
> On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@suse.cz> wrote:
>>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>>> > How does ext2 allocate blocks for directory.
>>> >
>>> > ext2_mkdir calls ext2_make_empty
>>> >
>>> > ext2_make_empty calls __ext2_write_begin
>>> >
>>> > __ ext2_write_begin calls block_write_begin
>>> >
>>> > my query is that how does this function allocates blocks for directories. ??
>>> >
>>>
>>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>>> directories. ??
>> Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
>> ways as ordinary files and thus ext2_get_block is used for block
>> allocation.
>>
>
> Can i modify this function to restrict allocation of blocks
> to a particular block group ?
>
> Like i want that my abc.txt file should be in block group 5 suppose, then
> what should i do?
>
I think this can be done. Or is done in the kernel source in several
ways (indirectly).
1. ext2_find_goal()-->this will look for the best new block. when
searching, it will try to find the block to be allocated to follow the
one last allocated in the file, so as to maintain storage contiguity.
2. looking into fs/ext2/balloc.c: ext2_try_to_allocate(), there is a
argument called group_goal, whose purpose is to specify the goal block
group, and the algorithm will start searching from the group specified
(look for "start=grp_goal"). Of course, if search is in vain it will
proceed to other block group, which u don't want ....so may be can
customize from here.
Not sure if I am right?
--
Regards,
Peter Teoh
Ernest Hemingway - "Never mistake motion for action."
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-19 9:35 ` Peter Teoh
@ 2008-12-19 11:18 ` Rohit Sharma
2008-12-19 15:29 ` Peter Teoh
0 siblings, 1 reply; 11+ messages in thread
From: Rohit Sharma @ 2008-12-19 11:18 UTC (permalink / raw)
To: Peter Teoh; +Cc: Jan Kara, Kernelnewbies, ext4
On Fri, Dec 19, 2008 at 3:05 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
> On Fri, Dec 19, 2008 at 3:42 PM, Rohit Sharma <imreckless@gmail.com> wrote:
>> On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@suse.cz> wrote:
>>>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>> > How does ext2 allocate blocks for directory.
>>>> >
>>>> > ext2_mkdir calls ext2_make_empty
>>>> >
>>>> > ext2_make_empty calls __ext2_write_begin
>>>> >
>>>> > __ ext2_write_begin calls block_write_begin
>>>> >
>>>> > my query is that how does this function allocates blocks for directories. ??
>>>> >
>>>>
>>>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>>>> directories. ??
>>> Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
>>> ways as ordinary files and thus ext2_get_block is used for block
>>> allocation.
>>>
>>
>> Can i modify this function to restrict allocation of blocks
>> to a particular block group ?
>>
>> Like i want that my abc.txt file should be in block group 5 suppose, then
>> what should i do?
>>
>
> I think this can be done. Or is done in the kernel source in several
> ways (indirectly).
>
> 1. ext2_find_goal()-->this will look for the best new block. when
> searching, it will try to find the block to be allocated to follow the
> one last allocated in the file, so as to maintain storage contiguity.
>
> 2. looking into fs/ext2/balloc.c: ext2_try_to_allocate(), there is a
> argument called group_goal, whose purpose is to specify the goal block
> group, and the algorithm will start searching from the group specified
> (look for "start=grp_goal"). Of course, if search is in vain it will
> proceed to other block group, which u don't want ....so may be can
> customize from here.
>
> Not sure if I am right?
>
When we create new file, do we use reservation window to allocate blocks
or we use reservation window every time we need a new data blocks
for file.
> --
> Regards,
> Peter Teoh
>
> Ernest Hemingway - "Never mistake motion for action."
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-19 11:18 ` Rohit Sharma
@ 2008-12-19 15:29 ` Peter Teoh
2008-12-19 18:49 ` Rohit Sharma
0 siblings, 1 reply; 11+ messages in thread
From: Peter Teoh @ 2008-12-19 15:29 UTC (permalink / raw)
To: Rohit Sharma; +Cc: Jan Kara, Kernelnewbies, ext4
On Fri, Dec 19, 2008 at 7:18 PM, Rohit Sharma <imreckless@gmail.com> wrote:
> On Fri, Dec 19, 2008 at 3:05 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
>> On Fri, Dec 19, 2008 at 3:42 PM, Rohit Sharma <imreckless@gmail.com> wrote:
>>> On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@suse.cz> wrote:
>>>>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>>> > How does ext2 allocate blocks for directory.
>>>>> >
>>>>> > ext2_mkdir calls ext2_make_empty
>>>>> >
>>>>> > ext2_make_empty calls __ext2_write_begin
>>>>> >
>>>>> > __ ext2_write_begin calls block_write_begin
>>>>> >
>>>>> > my query is that how does this function allocates blocks for directories. ??
>>>>> >
>>>>>
>>>>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>>>>> directories. ??
>>>> Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
>>>> ways as ordinary files and thus ext2_get_block is used for block
>>>> allocation.
>>>>
>>>
>>> Can i modify this function to restrict allocation of blocks
>>> to a particular block group ?
>>>
>>> Like i want that my abc.txt file should be in block group 5 suppose, then
>>> what should i do?
>>>
>>
>> I think this can be done. Or is done in the kernel source in several
>> ways (indirectly).
>>
>> 1. ext2_find_goal()-->this will look for the best new block. when
>> searching, it will try to find the block to be allocated to follow the
>> one last allocated in the file, so as to maintain storage contiguity.
>>
>> 2. looking into fs/ext2/balloc.c: ext2_try_to_allocate(), there is a
>> argument called group_goal, whose purpose is to specify the goal block
>> group, and the algorithm will start searching from the group specified
>> (look for "start=grp_goal"). Of course, if search is in vain it will
>> proceed to other block group, which u don't want ....so may be can
>> customize from here.
>>
>> Not sure if I am right?
>>
> When we create new file, do we use reservation window to allocate blocks
> or we use reservation window every time we need a new data blocks
> for file.
>
>
http://lwn.net/Articles/81357/ ===> from here, we deduced that it
should be done at every new block request level, and not at the file
level. This is because when file level request is initiated, the
first thing is see if any existing block can be reused or not, before
allocating new block (which then comes with reservation features - to
ensure contiguity of datablocks).
--
Regards,
Peter Teoh
Ernest Hemingway - "Never mistake motion for action."
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-19 15:29 ` Peter Teoh
@ 2008-12-19 18:49 ` Rohit Sharma
2008-12-19 19:01 ` Rohit Sharma
0 siblings, 1 reply; 11+ messages in thread
From: Rohit Sharma @ 2008-12-19 18:49 UTC (permalink / raw)
To: Peter Teoh; +Cc: Jan Kara, Kernelnewbies, ext4
Is there a difference between how ext2 allocates block between
inode's indirect blocks and data blocks.
On Fri, Dec 19, 2008 at 8:59 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
> On Fri, Dec 19, 2008 at 7:18 PM, Rohit Sharma <imreckless@gmail.com> wrote:
>> On Fri, Dec 19, 2008 at 3:05 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
>>> On Fri, Dec 19, 2008 at 3:42 PM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>> On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@suse.cz> wrote:
>>>>>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>>>> > How does ext2 allocate blocks for directory.
>>>>>> >
>>>>>> > ext2_mkdir calls ext2_make_empty
>>>>>> >
>>>>>> > ext2_make_empty calls __ext2_write_begin
>>>>>> >
>>>>>> > __ ext2_write_begin calls block_write_begin
>>>>>> >
>>>>>> > my query is that how does this function allocates blocks for directories. ??
>>>>>> >
>>>>>>
>>>>>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>>>>>> directories. ??
>>>>> Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
>>>>> ways as ordinary files and thus ext2_get_block is used for block
>>>>> allocation.
>>>>>
>>>>
>>>> Can i modify this function to restrict allocation of blocks
>>>> to a particular block group ?
>>>>
>>>> Like i want that my abc.txt file should be in block group 5 suppose, then
>>>> what should i do?
>>>>
>>>
>>> I think this can be done. Or is done in the kernel source in several
>>> ways (indirectly).
>>>
>>> 1. ext2_find_goal()-->this will look for the best new block. when
>>> searching, it will try to find the block to be allocated to follow the
>>> one last allocated in the file, so as to maintain storage contiguity.
>>>
>>> 2. looking into fs/ext2/balloc.c: ext2_try_to_allocate(), there is a
>>> argument called group_goal, whose purpose is to specify the goal block
>>> group, and the algorithm will start searching from the group specified
>>> (look for "start=grp_goal"). Of course, if search is in vain it will
>>> proceed to other block group, which u don't want ....so may be can
>>> customize from here.
>>>
>>> Not sure if I am right?
>>>
>> When we create new file, do we use reservation window to allocate blocks
>> or we use reservation window every time we need a new data blocks
>> for file.
>>
>>
>
> http://lwn.net/Articles/81357/ ===> from here, we deduced that it
> should be done at every new block request level, and not at the file
> level. This is because when file level request is initiated, the
> first thing is see if any existing block can be reused or not, before
> allocating new block (which then comes with reservation features - to
> ensure contiguity of datablocks).
>
>
> --
> Regards,
> Peter Teoh
>
> Ernest Hemingway - "Never mistake motion for action."
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-19 18:49 ` Rohit Sharma
@ 2008-12-19 19:01 ` Rohit Sharma
2008-12-19 20:24 ` Sandeep K Sinha
0 siblings, 1 reply; 11+ messages in thread
From: Rohit Sharma @ 2008-12-19 19:01 UTC (permalink / raw)
To: Peter Teoh; +Cc: Jan Kara, Kernelnewbies, ext4
I am not sure but ext2_alloc_blocks function
in inode.c, allocate blocks for indirect blocks.
On Sat, Dec 20, 2008 at 12:19 AM, Rohit Sharma <imreckless@gmail.com> wrote:
> Is there a difference between how ext2 allocates block between
> inode's indirect blocks and data blocks.
>
>
> On Fri, Dec 19, 2008 at 8:59 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
>> On Fri, Dec 19, 2008 at 7:18 PM, Rohit Sharma <imreckless@gmail.com> wrote:
>>> On Fri, Dec 19, 2008 at 3:05 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
>>>> On Fri, Dec 19, 2008 at 3:42 PM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>>> On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@suse.cz> wrote:
>>>>>>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>>>>> > How does ext2 allocate blocks for directory.
>>>>>>> >
>>>>>>> > ext2_mkdir calls ext2_make_empty
>>>>>>> >
>>>>>>> > ext2_make_empty calls __ext2_write_begin
>>>>>>> >
>>>>>>> > __ ext2_write_begin calls block_write_begin
>>>>>>> >
>>>>>>> > my query is that how does this function allocates blocks for directories. ??
>>>>>>> >
>>>>>>>
>>>>>>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>>>>>>> directories. ??
>>>>>> Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
>>>>>> ways as ordinary files and thus ext2_get_block is used for block
>>>>>> allocation.
>>>>>>
>>>>>
>>>>> Can i modify this function to restrict allocation of blocks
>>>>> to a particular block group ?
>>>>>
>>>>> Like i want that my abc.txt file should be in block group 5 suppose, then
>>>>> what should i do?
>>>>>
>>>>
>>>> I think this can be done. Or is done in the kernel source in several
>>>> ways (indirectly).
>>>>
>>>> 1. ext2_find_goal()-->this will look for the best new block. when
>>>> searching, it will try to find the block to be allocated to follow the
>>>> one last allocated in the file, so as to maintain storage contiguity.
>>>>
>>>> 2. looking into fs/ext2/balloc.c: ext2_try_to_allocate(), there is a
>>>> argument called group_goal, whose purpose is to specify the goal block
>>>> group, and the algorithm will start searching from the group specified
>>>> (look for "start=grp_goal"). Of course, if search is in vain it will
>>>> proceed to other block group, which u don't want ....so may be can
>>>> customize from here.
>>>>
>>>> Not sure if I am right?
>>>>
>>> When we create new file, do we use reservation window to allocate blocks
>>> or we use reservation window every time we need a new data blocks
>>> for file.
>>>
>>>
>>
>> http://lwn.net/Articles/81357/ ===> from here, we deduced that it
>> should be done at every new block request level, and not at the file
>> level. This is because when file level request is initiated, the
>> first thing is see if any existing block can be reused or not, before
>> allocating new block (which then comes with reservation features - to
>> ensure contiguity of datablocks).
>>
>>
>> --
>> Regards,
>> Peter Teoh
>>
>> Ernest Hemingway - "Never mistake motion for action."
>>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: block allocation for ext2_mkdir
2008-12-19 19:01 ` Rohit Sharma
@ 2008-12-19 20:24 ` Sandeep K Sinha
0 siblings, 0 replies; 11+ messages in thread
From: Sandeep K Sinha @ 2008-12-19 20:24 UTC (permalink / raw)
To: Rohit Sharma; +Cc: Peter Teoh, Jan Kara, Kernelnewbies, ext4
On Sat, Dec 20, 2008 at 12:31 AM, Rohit Sharma <imreckless@gmail.com> wrote:
> I am not sure but ext2_alloc_blocks function
> in inode.c, allocate blocks for indirect blocks.
>
You are right,
The allocation can be from direct or indirect blocks depending on the
availability.
What I feel is that you dont need any kind of optimizations for the
allocation of all your direct blocks, but surely for indirect blocks.
>
>
> On Sat, Dec 20, 2008 at 12:19 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>> Is there a difference between how ext2 allocates block between
>> inode's indirect blocks and data blocks.
>>
Ofcourse, you surely will have.
So, as a part of the block allocation optimization ext2 uses the
concepts of goals and reservation windows for its indirect blocks.
>>
>> On Fri, Dec 19, 2008 at 8:59 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
>>> On Fri, Dec 19, 2008 at 7:18 PM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>> On Fri, Dec 19, 2008 at 3:05 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
>>>>> On Fri, Dec 19, 2008 at 3:42 PM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>>>> On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@suse.cz> wrote:
>>>>>>>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@gmail.com> wrote:
>>>>>>>> > How does ext2 allocate blocks for directory.
>>>>>>>> >
>>>>>>>> > ext2_mkdir calls ext2_make_empty
>>>>>>>> >
>>>>>>>> > ext2_make_empty calls __ext2_write_begin
>>>>>>>> >
>>>>>>>> > __ ext2_write_begin calls block_write_begin
>>>>>>>> >
>>>>>>>> > my query is that how does this function allocates blocks for directories. ??
>>>>>>>> >
>>>>>>>>
>>>>>>>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>>>>>>>> directories. ??
>>>>>>> Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
>>>>>>> ways as ordinary files and thus ext2_get_block is used for block
>>>>>>> allocation.
>>>>>>>
>>>>>>
>>>>>> Can i modify this function to restrict allocation of blocks
>>>>>> to a particular block group ?
>>>>>>
>>>>>> Like i want that my abc.txt file should be in block group 5 suppose, then
>>>>>> what should i do?
>>>>>>
>>>>>
>>>>> I think this can be done. Or is done in the kernel source in several
>>>>> ways (indirectly).
>>>>>
>>>>> 1. ext2_find_goal()-->this will look for the best new block. when
>>>>> searching, it will try to find the block to be allocated to follow the
>>>>> one last allocated in the file, so as to maintain storage contiguity.
>>>>>
>>>>> 2. looking into fs/ext2/balloc.c: ext2_try_to_allocate(), there is a
>>>>> argument called group_goal, whose purpose is to specify the goal block
>>>>> group, and the algorithm will start searching from the group specified
>>>>> (look for "start=grp_goal"). Of course, if search is in vain it will
>>>>> proceed to other block group, which u don't want ....so may be can
>>>>> customize from here.
>>>>>
>>>>> Not sure if I am right?
>>>>>
>>>> When we create new file, do we use reservation window to allocate blocks
>>>> or we use reservation window every time we need a new data blocks
>>>> for file.
>>>>
>>>>
>>>
>>> http://lwn.net/Articles/81357/ ===> from here, we deduced that it
>>> should be done at every new block request level, and not at the file
>>> level. This is because when file level request is initiated, the
>>> first thing is see if any existing block can be reused or not, before
>>> allocating new block (which then comes with reservation features - to
>>> ensure contiguity of datablocks).
>>>
>>>
>>> --
>>> Regards,
>>> Peter Teoh
>>>
>>> Ernest Hemingway - "Never mistake motion for action."
>>>
>>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
--
Regards,
Sandeep.
"To learn is to change. Education is a process that changes the learner."
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-12-19 20:24 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 18:42 block allocation for ext2_mkdir Rohit Sharma
2008-12-18 19:52 ` Rohit Sharma
2008-12-18 22:39 ` Jan Kara
2008-12-19 7:42 ` Rohit Sharma
2008-12-19 9:21 ` Sandeep K Sinha
2008-12-19 9:35 ` Peter Teoh
2008-12-19 11:18 ` Rohit Sharma
2008-12-19 15:29 ` Peter Teoh
2008-12-19 18:49 ` Rohit Sharma
2008-12-19 19:01 ` Rohit Sharma
2008-12-19 20:24 ` Sandeep K Sinha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox