* [PATCH] update description in Documentation/filesystems/vfs.txt
@ 2007-06-24 12:21 Borislav Petkov
2007-06-25 9:34 ` Pekka Enberg
0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2007-06-24 12:21 UTC (permalink / raw)
To: Pekka Enberg; +Cc: linux-fsdevel, linux-kernel
While reading the said file I noticed some discrepancies between the actual
code and the info in the docs. Here's an update that attempts to match it to
the code in the current 2.6.22-rc5.
---
From: Borislav Petkov <bbpetkov@yahoo.de>
Update the description of struct file_system_type and get_sb() in
Documentation/filesystems/vfs.txt to match the current code.
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
--
Index: linux-2.6.22-rc5/Documentation/filesystems/vfs.txt
===================================================================
--- linux-2.6.22-rc5/Documentation/filesystems/vfs.txt.orig 2007-06-24 13:42:40.000000000 +0200
+++ linux-2.6.22-rc5/Documentation/filesystems/vfs.txt 2007-06-24 14:14:48.000000000 +0200
@@ -3,7 +3,7 @@
Original author: Richard Gooch <rgooch@atnf.csiro.au>
- Last updated on October 28, 2005
+ Last updated on Juni 24, 2007.
Copyright (C) 1999 Richard Gooch
Copyright (C) 2005 Pekka Enberg
@@ -107,7 +107,7 @@
struct file_system_type
-----------------------
-This describes the filesystem. As of kernel 2.6.13, the following
+This describes the filesystem. As of kernel 2.6.22, the following
members are defined:
struct file_system_type {
@@ -119,6 +119,8 @@
struct module *owner;
struct file_system_type * next;
struct list_head fs_supers;
+ struct lock_class_key s_lock_key;
+ struct lock_class_key s_umount_key;
};
name: the name of the filesystem type, such as "ext2", "iso9660",
@@ -137,11 +139,12 @@
next: for internal VFS use: you should initialize this to NULL
+ s_lock_key, s_umount_key: lockdep-specific
+
The get_sb() method has the following arguments:
- struct super_block *sb: the superblock structure. This is partially
- initialized by the VFS and the rest must be initialized by the
- get_sb() method
+ struct file_system_type *fs_type: decribes the filesystem, partly initialized
+ by the specific filesystem code
int flags: mount flags
@@ -150,12 +153,13 @@
void *data: arbitrary mount options, usually comes as an ASCII
string
- int silent: whether or not to be silent on error
+ struct vfsmount *mnt: a vfs-internal representation of a mount point
The get_sb() method must determine if the block device specified
-in the superblock contains a filesystem of the type the method
-supports. On success the method returns the superblock pointer, on
-failure it returns NULL.
+in the dev_name and fs_type contains a filesystem of the type the method
+supports. If it succeeds in opening the named block device, it initializes a
+struct super_block descriptor for the filesystem contained by the block device.
+On failure it returns an error.
The most interesting member of the superblock structure that the
get_sb() method fills in is the "s_op" field. This is a pointer to
--
Regards/Gruß,
Boris.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] update description in Documentation/filesystems/vfs.txt 2007-06-24 12:21 [PATCH] update description in Documentation/filesystems/vfs.txt Borislav Petkov @ 2007-06-25 9:34 ` Pekka Enberg 2007-06-25 19:06 ` [PATCH] update description in Documentation/filesystems/vfs.txt (typo fixed) Borislav Petkov 0 siblings, 1 reply; 4+ messages in thread From: Pekka Enberg @ 2007-06-25 9:34 UTC (permalink / raw) To: bbpetkov; +Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Hi Borislav, On 6/24/2007, "Borislav Petkov" <bbpetkov@yahoo.de> wrote: > @@ -3,7 +3,7 @@ > > Original author: Richard Gooch <rgooch@atnf.csiro.au> > > - Last updated on October 28, 2005 > + Last updated on Juni 24, 2007. There's a typo here so do s/Juni/June/g please before sending to Andrew. Other than that, looks good to me. Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] update description in Documentation/filesystems/vfs.txt (typo fixed) 2007-06-25 9:34 ` Pekka Enberg @ 2007-06-25 19:06 ` Borislav Petkov 2007-07-01 6:53 ` [PATCH] update Documentation/filesystems/vfs.txt (second part) Borislav Petkov 0 siblings, 1 reply; 4+ messages in thread From: Borislav Petkov @ 2007-06-25 19:06 UTC (permalink / raw) To: Pekka Enberg Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton On Mon, Jun 25, 2007 at 12:34:36PM +0300, Pekka Enberg wrote: > > Hi Borislav, > > On 6/24/2007, "Borislav Petkov" <bbpetkov@yahoo.de> wrote: > > @@ -3,7 +3,7 @@ > > > > Original author: Richard Gooch <rgooch@atnf.csiro.au> > > > > - Last updated on October 28, 2005 > > + Last updated on Juni 24, 2007. > > There's a typo here so do s/Juni/June/g please before sending to Andrew. > Other than that, looks good to me. > > Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Index: linux-2.6.22-rc5/Documentation/filesystems/vfs.txt =================================================================== --- linux-2.6.22-rc5/Documentation/filesystems/vfs.txt.orig 2007-06-24 13:42:40.000000000 +0200 +++ linux-2.6.22-rc5/Documentation/filesystems/vfs.txt 2007-06-24 14:14:48.000000000 +0200 @@ -3,7 +3,7 @@ Original author: Richard Gooch <rgooch@atnf.csiro.au> - Last updated on October 28, 2005 + Last updated on June 24, 2007. Copyright (C) 1999 Richard Gooch Copyright (C) 2005 Pekka Enberg @@ -107,7 +107,7 @@ struct file_system_type ----------------------- -This describes the filesystem. As of kernel 2.6.13, the following +This describes the filesystem. As of kernel 2.6.22, the following members are defined: struct file_system_type { @@ -119,6 +119,8 @@ struct module *owner; struct file_system_type * next; struct list_head fs_supers; + struct lock_class_key s_lock_key; + struct lock_class_key s_umount_key; }; name: the name of the filesystem type, such as "ext2", "iso9660", @@ -137,11 +139,12 @@ next: for internal VFS use: you should initialize this to NULL + s_lock_key, s_umount_key: lockdep-specific + The get_sb() method has the following arguments: - struct super_block *sb: the superblock structure. This is partially - initialized by the VFS and the rest must be initialized by the - get_sb() method + struct file_system_type *fs_type: decribes the filesystem, partly initialized + by the specific filesystem code int flags: mount flags @@ -150,12 +153,13 @@ void *data: arbitrary mount options, usually comes as an ASCII string - int silent: whether or not to be silent on error + struct vfsmount *mnt: a vfs-internal representation of a mount point The get_sb() method must determine if the block device specified -in the superblock contains a filesystem of the type the method -supports. On success the method returns the superblock pointer, on -failure it returns NULL. +in the dev_name and fs_type contains a filesystem of the type the method +supports. If it succeeds in opening the named block device, it initializes a +struct super_block descriptor for the filesystem contained by the block device. +On failure it returns an error. The most interesting member of the superblock structure that the get_sb() method fills in is the "s_op" field. This is a pointer to -- Regards/Gruß, Boris. - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] update Documentation/filesystems/vfs.txt (second part) 2007-06-25 19:06 ` [PATCH] update description in Documentation/filesystems/vfs.txt (typo fixed) Borislav Petkov @ 2007-07-01 6:53 ` Borislav Petkov 0 siblings, 0 replies; 4+ messages in thread From: Borislav Petkov @ 2007-07-01 6:53 UTC (permalink / raw) To: Pekka Enberg; +Cc: linux-fsdevel, lkml, Andrew Morton --- From: Borislav Petkov <bbpetkov@yahoo.de> Update the rest of Documentation/filesystems/vfs.txt Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> -- Index: linux-2.6.22-rc6/Documentation/filesystems/vfs.txt =================================================================== --- linux-2.6.22-rc6/Documentation/filesystems/vfs.txt.orig 2007-07-01 08:47:29.000000000 +0200 +++ linux-2.6.22-rc6/Documentation/filesystems/vfs.txt 2007-07-01 08:47:48.000000000 +0200 @@ -193,7 +193,7 @@ ----------------------- This describes how the VFS can manipulate the superblock of your -filesystem. As of kernel 2.6.13, the following members are defined: +filesystem. As of kernel 2.6.22, the following members are defined: struct super_operations { struct inode *(*alloc_inode)(struct super_block *sb); @@ -216,8 +216,6 @@ void (*clear_inode) (struct inode *); void (*umount_begin) (struct super_block *); - void (*sync_inodes) (struct super_block *sb, - struct writeback_control *wbc); int (*show_options)(struct seq_file *, struct vfsmount *); ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); @@ -300,9 +298,6 @@ umount_begin: called when the VFS is unmounting a filesystem. - sync_inodes: called when the VFS is writing out dirty data associated with - a superblock. - show_options: called by the VFS to show mount options for /proc/<pid>/mounts. quota_read: called by the VFS to read from filesystem quota file. @@ -324,7 +319,7 @@ ----------------------- This describes how the VFS can manipulate an inode in your -filesystem. As of kernel 2.6.13, the following members are defined: +filesystem. As of kernel 2.6.22, the following members are defined: struct inode_operations { int (*create) (struct inode *,struct dentry *,int, struct nameidata *); @@ -348,6 +343,7 @@ ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); ssize_t (*listxattr) (struct dentry *, char *, size_t); int (*removexattr) (struct dentry *, const char *); + void (*truncate_range)(struct inode *, loff_t, loff_t); }; Again, all methods are called without any locks being held, unless @@ -444,6 +440,9 @@ removexattr: called by the VFS to remove an extended attribute from a file. This method is called by removexattr(2) system call. + truncate_range: a method provided by the underlying filesystem to truncate a + range of blocks , i.e. punch a hole somewhere in a file. + The Address Space Object ======================== @@ -522,7 +521,7 @@ ------------------------------- This describes how the VFS can manipulate mapping of a file to page cache in -your filesystem. As of kernel 2.6.16, the following members are defined: +your filesystem. As of kernel 2.6.22, the following members are defined: struct address_space_operations { int (*writepage)(struct page *page, struct writeback_control *wbc); @@ -543,6 +542,7 @@ int); /* migrate the contents of a page to the specified target */ int (*migratepage) (struct page *, struct page *); + int (*launder_page) (struct page *); }; writepage: called by the VM to write a dirty page to backing store. @@ -689,6 +689,10 @@ transfer any private data across and update any references that it has to the page. + launder_page: Called before freeing a page - it writes back the dirty page. To + prevent redirtying the page, it is kept locked during the whole + operation. + The File Object =============== @@ -699,9 +703,10 @@ ---------------------- This describes how the VFS can manipulate an open file. As of kernel -2.6.17, the following members are defined: +2.6.22, the following members are defined: struct file_operations { + struct module *owner; loff_t (*llseek) (struct file *, loff_t, int); ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); @@ -728,10 +733,8 @@ int (*check_flags)(int); int (*dir_notify)(struct file *filp, unsigned long arg); int (*flock) (struct file *, int, struct file_lock *); - ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned -int); - ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned -int); + ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int); + ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); }; Again, all methods are called without any locks being held, unless -- Regards/Gruß, Boris. - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-07-01 7:00 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-06-24 12:21 [PATCH] update description in Documentation/filesystems/vfs.txt Borislav Petkov 2007-06-25 9:34 ` Pekka Enberg 2007-06-25 19:06 ` [PATCH] update description in Documentation/filesystems/vfs.txt (typo fixed) Borislav Petkov 2007-07-01 6:53 ` [PATCH] update Documentation/filesystems/vfs.txt (second part) Borislav Petkov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).