Re: Does unmount() sync dirty buffers

2012-02-15 Thread Manish Katiyar
[Apparently I forgot to cc list]

On Tue, Feb 14, 2012 at 10:04 PM, Manish Katiyar mkati...@gmail.com wrote:
 On Tue, Feb 14, 2012 at 7:43 PM, Ravishankar cybera...@gmail.com wrote:
 Hello,

 When we unmount a file system with the umount command or the umount() system
 call, does the kernel sync the dirty buffers before the file system is
 unmounted?I am assuming that the file system is not 'busy' (i.e no open
 files etc) and no force options are specified. When I did a walk-through of
 do_umount() call in fs/namespace.c, I could not find calls to sync any dirty
 pages that might exist.

 yes, most of the filesystem have their own function to sync fs. Look
 for the function pointer sync_fs

 For eg..for ext4

 generic_shutdown_super - sync_filesystem - __sync_filesystem -
 sync_fs - ext4_sync_fs
 --
 Thanks -
 Manish



-- 
Thanks -
Manish

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Using Sysfs uevents.

2012-02-15 Thread Pranay Kumar Srivastava
Hi,

I was playing with sysfs and I'm able to create kset and kobjects within them 
as well. I need to know how do I use the uevents of these kobjects that I 
create. For example while reading the code I found that certain events like 
ADD, DEL a couple more were there are apparently fired. Now currently I'm not 
handling these events, the ops field is null, so they don't bother me hence 
they are not mandatory?

If I were to actually do something with these events what it should be? Since 
my module runs fine and the uevents are supposed to be for userland 
applications (Hotplug) but the point is again how will a userspace application 
get to know about it? Does the application needs to create netlink sockets for 
it? If it does then why bother with the uevents of kobject?




::DISCLAIMER::
---

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and
attachments please check them for viruses and defect.

---

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: [QUESTION] staging/easycap fix

2012-02-15 Thread Peter Senna Tschudin
Ezequiel,

The post: Intro to V4L2:
http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/Intro-to-V4L2/

And the post: The VIVI driver; a great starting point for V4L2 driver writers:
http://lwn.net/Articles/203971/

May be useful.

[]'s

Peter


2012/2/14 Greg KH g...@kroah.com:
 On Tue, Feb 14, 2012 at 07:01:25PM -0300, Ezequiel García wrote:
 Hi Greg,

 
  It's only recommended if you have a compiler that doesn't check for
  such foolish things.
 

 Understood. Thanks both.

 Another question (hope you don't mind me asking so much):

 I noticed easycap does lots of (redundant?) checks as:

 pvideo_device = video_devdata(file);
 if (!pvideo_device) {
   return -EFAULT;
 }

 Is this bad, good or doesn't matter?
 (There are more examples where the check is clearly not needed but
 this one makes me doubt a bit)

 Depends on what video_devdata() does, and how it could ever be NULL.

 Maybe I'm focusing on small issues (as you already pointed out),
 do you think this kind of patches would be accepted?

 Of course, I would submit separate patches, one for each change:
 1. split probe function
 2. remove redundant checks
 3. clean comment style
 ... and so on.

 That sounds great.

 Also, I'm reading driver cx231xx as it's also an usb video capture.
 Do you think it's a good code reference? Can you give me further reference?

 I don't know, ask the linux-media developers on their list for a good
 reference driver to follow, they would know best.

 thanks,

 greg k-h

 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
Peter Senna Tschudin
peter.se...@gmail.com
gpg id: 48274C36

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


System call trace

2012-02-15 Thread Swapnil Gaikwad
Can we see trace of how the system call works?
What are the functions are called in kernel space?
For example we want to trace cp command. Then what are the functions
is get called by that in kernel space? like how the inode allocation
take place for new destination file etc.
Is any tool for that?


-- 
Regards,

Swapnil Gaikwad.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: System call trace

2012-02-15 Thread Alexandru Juncu
On Wed, Feb 15, 2012 at 4:38 PM, Swapnil Gaikwad
swapnilgai...@gmail.com wrote:
 Can we see trace of how the system call works?
 What are the functions are called in kernel space?
 For example we want to trace cp command. Then what are the functions
 is get called by that in kernel space? like how the inode allocation
 take place for new destination file etc.
 Is any tool for that?

I think strace [0][1] is what you are looking for. strace executable
will list all the system calls made by the executable during runtime
(you can filter what calls you want traced).

A syscall is by definition a function that is ran in kernel space,
called by the userspace.

If you want to see what function is called when there's a certain
syscall, you should take a look at the syscall descriptor table. It's
an array for function pointers. You can talke a look at the kernel'
source code to see the implementation of the syscall.

Now, to track what the kernel is doing, while in a syscall, I can't
remember a tool that would do that... maybe somebody else can help.

[0] http://linux.die.net/man/1/strace
[1] http://en.wikipedia.org/wiki/Strace

--
Alexandru Juncu
ROSEdu

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: System call trace

2012-02-15 Thread Mulyadi Santosa
Hi :)

On Wed, Feb 15, 2012 at 21:38, Swapnil Gaikwad swapnilgai...@gmail.com wrote:
 Can we see trace of how the system call works?
 What are the functions are called in kernel space?
 For example we want to trace cp command. Then what are the functions
 is get called by that in kernel space? like how the inode allocation
 take place for new destination file etc.
 Is any tool for that?

Besides using strace, you might find User Mode Linux useful in this
case. Just attach gdb to the UML kernel, put breakpoint into system
call entry, and then do step to follow how it goes.

Note that UML might not precisely mimic real kernel, but at least it
will give you idea.

Other than that, cscope and/or websites like lxr.linux.no are your
best friend for such code exploration :)

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Using Sysfs uevents.

2012-02-15 Thread Greg KH
On Wed, Feb 15, 2012 at 06:17:28PM +0530, Pranay Kumar Srivastava wrote:
 Hi,
 
 I was playing with sysfs and I'm able to create kset and kobjects
 within them as well.

Nice, but why?  Almost no one ever should be touching raw sysfs
kobjects and ksets.

 I need to know how do I use the uevents of these kobjects that I
 create. For example while reading the code I found that certain events
 like ADD, DEL a couple more were there are apparently fired. Now
 currently I'm not handling these events, the ops field is null, so
 they don't bother me hence they are not mandatory?

They are created by the kobject core automatically for you.

 If I were to actually do something with these events what it should
 be? Since my module runs fine and the uevents are supposed to be for
 userland applications (Hotplug) but the point is again how will a
 userspace application get to know about it? Does the application needs
 to create netlink sockets for it? If it does then why bother with the
 uevents of kobject?

No, udev grabs all of these events and allows other programs to
subscribe to it and get that information.  You don't have to write your
own program to do this, the infrastructure is all there already.

But I wouldn't really worry about it to much, you shouldn't be messing
with kobjects directly anyway, why not use 'struct device' instead?

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


arm assembly doubt

2012-02-15 Thread subin gangadharan
Hi ,

I am trying to understand how system call is implmented in linux for
arm.And I am not that familiar with arm assembly.

Could any body please help me to understand what exactly this ^ does
in this instruction stmdb r8,{sp,lr}^

-- 
With Regards
Subin Gangadharan

I am not afraid and I am also not afraid of being afraid.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: arm assembly doubt

2012-02-15 Thread Surenkumar Nihalani
Hi,
On Feb 15, 2012, at 11:30 PM, subin gangadharan wrote:

 Hi ,
 
 I am trying to understand how system call is implmented in linux for
 arm.And I am not that familiar with arm assembly.
 
 Could any body please help me to understand what exactly this ^ does
 in this instruction stmdb r8,{sp,lr}^
 
 -- 
 With Regards
 Subin Gangadharan
 
 I am not afraid and I am also not afraid of being afraid.
 
 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Example:
LDFMD sp!, {r0-r12, pc}^
- The ^ qualifier specifies that the CPSR is restored from the SPSR. 
   It must be used only from a privileged mode.


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Dual booting of Smartphone

2012-02-15 Thread Abhijit Pawar
Hi All,
I know its pre-mature to ask this question but is there any support of
dual booting in smartphones which can allow me have two different OS's
( for ex. Android 2.1 + Android 2.3 ) on a single phone? There may be
other combinations as well. Is this something which we are looking at
near future or is it just a dream at this moment?

Regards,
Abhijit Pawar


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies