* [PATCH 0/X] exofs patches for after 2.6.32
@ 2009-11-08 10:34 Boaz Harrosh
2009-11-08 10:36 ` [PATCH 1/6] trivial: some small fixes in exofs documentation Boaz Harrosh
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Boaz Harrosh @ 2009-11-08 10:34 UTC (permalink / raw)
To: open-osd mailing-list, linux-fsdevel
Assorted bunch of patches to the exofs file system.
Most of these are a resend, they did not make it to 2.6.32
because the dependent bits from drivers/scsi/osd did not make
it into 2.6.32. I hope they finally will for 2.6.33.
These patches are just preliminary cleanups to some new
fixtures that will be sent next.
Thank you for reviewing
list of patches:
[PATCH 1/6] trivial: some small fixes in exofs documentation
[PATCH 2/6] exofs: More sane debug print
[PATCH 3/6] exofs: dbg-print less
[PATCH 4/6] exofs: refactor exofs_i_info initialization into common helper
[PATCH 5/6] exofs: Prints on mount and unmout
[PATCH 6/6] exofs: statfs blocks is sectors not FS blocks
Boaz
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/6] trivial: some small fixes in exofs documentation
2009-11-08 10:34 [PATCH 0/X] exofs patches for after 2.6.32 Boaz Harrosh
@ 2009-11-08 10:36 ` Boaz Harrosh
2009-11-08 10:36 ` [PATCH 2/6] exofs: More sane debug print Boaz Harrosh
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2009-11-08 10:36 UTC (permalink / raw)
To: open-osd, linux-fsdevel; +Cc: Thadeu Lima de Souza Cascardo
From: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Add exofs.txt to filesystems Documentation index and fix some typos,
identation and grammar.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
Documentation/filesystems/00-INDEX | 2 ++
Documentation/filesystems/exofs.txt | 23 ++++++++++++-----------
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
index f15621e..7001782 100644
--- a/Documentation/filesystems/00-INDEX
+++ b/Documentation/filesystems/00-INDEX
@@ -36,6 +36,8 @@ dnotify.txt
- info about directory notification in Linux.
ecryptfs.txt
- docs on eCryptfs: stacked cryptographic filesystem for Linux.
+exofs.txt
+ - info, usage, mount options, design about EXOFS.
ext2.txt
- info, mount options and specifications for the Ext2 filesystem.
ext3.txt
diff --git a/Documentation/filesystems/exofs.txt b/Documentation/filesystems/exofs.txt
index 0ced74c..abd2a9b 100644
--- a/Documentation/filesystems/exofs.txt
+++ b/Documentation/filesystems/exofs.txt
@@ -60,13 +60,13 @@ USAGE
mkfs.exofs --pid=65536 --format /dev/osd0
- The --format is optional if not specified no OSD_FORMAT will be
- preformed and a clean file system will be created in the specified pid,
+ The --format is optional. If not specified, no OSD_FORMAT will be
+ performed and a clean file system will be created in the specified pid,
in the available space of the target. (Use --format=size_in_meg to limit
the total LUN space available)
- If pid already exist it will be deleted and a new one will be created in it's
- place. Be careful.
+ If pid already exists, it will be deleted and a new one will be created in
+ its place. Be careful.
An exofs lives inside a single OSD partition. You can create multiple exofs
filesystems on the same device using multiple pids.
@@ -81,7 +81,7 @@ USAGE
7. For reference (See do-exofs example script):
do-exofs start - an example of how to perform the above steps.
- do-exofs stop - an example of how to unmount the file system.
+ do-exofs stop - an example of how to unmount the file system.
do-exofs format - an example of how to format and mkfs a new exofs.
8. Extra compilation flags (uncomment in fs/exofs/Kbuild):
@@ -104,8 +104,8 @@ Where:
exofs specific options: Options are separated by commas (,)
pid=<integer> - The partition number to mount/create as
container of the filesystem.
- This option is mandatory
- to=<integer> - Timeout in ticks for a single command
+ This option is mandatory.
+ to=<integer> - Timeout in ticks for a single command.
default is (60 * HZ) [for debugging only]
===============================================================================
@@ -116,7 +116,7 @@ DESIGN
with a special ID (defined in common.h).
Information included in the file system control block is used to fill the
in-memory superblock structure at mount time. This object is created before
- the file system is used by mkexofs.c It contains information such as:
+ the file system is used by mkexofs.c. It contains information such as:
- The file system's magic number
- The next inode number to be allocated
@@ -134,8 +134,8 @@ DESIGN
attributes. This applies to both regular files and other types (directories,
device files, symlinks, etc.).
-* Credentials are generated per object (inode and superblock) when they is
- created in memory (read off disk or created). The credential works for all
+* Credentials are generated per object (inode and superblock) when they are
+ created in memory (read from disk or created). The credential works for all
operations and is used as long as the object remains in memory.
* Async OSD operations are used whenever possible, but the target may execute
@@ -145,7 +145,8 @@ DESIGN
from executing in reverse order:
- The following are handled with the OBJ_CREATED and OBJ_2BCREATED
flags. OBJ_CREATED is set when we know the object exists on the OSD -
- in create's callback function, and when we successfully do a read_inode.
+ in create's callback function, and when we successfully do a
+ read_inode.
OBJ_2BCREATED is set in the beginning of the create function, so we
know that we should wait.
- create/delete: delete should wait until the object is created
--
1.6.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/6] exofs: More sane debug print
2009-11-08 10:34 [PATCH 0/X] exofs patches for after 2.6.32 Boaz Harrosh
2009-11-08 10:36 ` [PATCH 1/6] trivial: some small fixes in exofs documentation Boaz Harrosh
@ 2009-11-08 10:36 ` Boaz Harrosh
2009-11-08 10:37 ` [PATCH 3/6] exofs: dbg-print less Boaz Harrosh
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2009-11-08 10:36 UTC (permalink / raw)
To: open-osd, linux-fsdevel
debug prints should be somewhat useful without actually
reading the source code
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
fs/exofs/inode.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
index 6c10f74..4474861 100644
--- a/fs/exofs/inode.c
+++ b/fs/exofs/inode.c
@@ -950,8 +950,7 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino)
#ifdef EXOFS_DEBUG_OBJ_ISIZE
if ((inode->i_size != sanity) &&
(!exofs_inode_is_fast_symlink(inode))) {
- EXOFS_ERR("WARNING: Size of object from inode and "
- "attributes differ (%lld != %llu)\n",
+ EXOFS_ERR("WARNING: Size of inode=%llu != object=%llu\n",
inode->i_size, _LLU(sanity));
}
#endif
--
1.6.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/6] exofs: dbg-print less
2009-11-08 10:34 [PATCH 0/X] exofs patches for after 2.6.32 Boaz Harrosh
2009-11-08 10:36 ` [PATCH 1/6] trivial: some small fixes in exofs documentation Boaz Harrosh
2009-11-08 10:36 ` [PATCH 2/6] exofs: More sane debug print Boaz Harrosh
@ 2009-11-08 10:37 ` Boaz Harrosh
2009-11-08 10:37 ` [PATCH 4/6] exofs: refactor exofs_i_info initialization into common helper Boaz Harrosh
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2009-11-08 10:37 UTC (permalink / raw)
To: open-osd, linux-fsdevel
Iner-loops printing is converted to EXOFS_DBG2 which is #defined
to nothing.
It is now almost bareable to just leave debug-on. Every operation
is printed once, with most relevant info (I hope).
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
fs/exofs/inode.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
index 4474861..dc90f7c 100644
--- a/fs/exofs/inode.c
+++ b/fs/exofs/inode.c
@@ -41,6 +41,8 @@
# define EXOFS_DEBUG_OBJ_ISIZE 1
#endif
+#define EXOFS_DBGMSG2(M...) do{}while(0)
+
struct page_collect {
struct exofs_sb_info *sbi;
struct request_queue *req_q;
@@ -198,7 +200,7 @@ static int __readpages_done(struct osd_request *or, struct page_collect *pcol,
else
page_stat = ret;
- EXOFS_DBGMSG(" readpages_done(0x%lx, 0x%lx) %s\n",
+ EXOFS_DBGMSG2(" readpages_done(0x%lx, 0x%lx) %s\n",
inode->i_ino, page->index,
page_stat ? "bad_bytes" : "good_bytes");
@@ -370,7 +372,7 @@ try_again:
if (len != PAGE_CACHE_SIZE)
zero_user(page, len, PAGE_CACHE_SIZE - len);
- EXOFS_DBGMSG(" readpage_strip(0x%lx, 0x%lx) len=0x%zx\n",
+ EXOFS_DBGMSG2(" readpage_strip(0x%lx, 0x%lx) len=0x%zx\n",
inode->i_ino, page->index, len);
ret = pcol_add_page(pcol, page, len);
@@ -482,7 +484,7 @@ static void writepages_done(struct osd_request *or, void *p)
update_write_page(page, page_stat);
unlock_page(page);
- EXOFS_DBGMSG(" writepages_done(0x%lx, 0x%lx) status=%d\n",
+ EXOFS_DBGMSG2(" writepages_done(0x%lx, 0x%lx) status=%d\n",
inode->i_ino, page->index, page_stat);
length += bvec->bv_len;
@@ -609,7 +611,7 @@ try_again:
goto fail;
}
- EXOFS_DBGMSG(" writepage_strip(0x%lx, 0x%lx) len=0x%zx\n",
+ EXOFS_DBGMSG2(" writepage_strip(0x%lx, 0x%lx) len=0x%zx\n",
inode->i_ino, page->index, len);
ret = pcol_add_page(pcol, page, len);
--
1.6.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/6] exofs: refactor exofs_i_info initialization into common helper
2009-11-08 10:34 [PATCH 0/X] exofs patches for after 2.6.32 Boaz Harrosh
` (2 preceding siblings ...)
2009-11-08 10:37 ` [PATCH 3/6] exofs: dbg-print less Boaz Harrosh
@ 2009-11-08 10:37 ` Boaz Harrosh
2009-11-08 10:37 ` [PATCH 5/6] exofs: Prints on mount and unmout Boaz Harrosh
2009-11-08 10:38 ` [PATCH 6/6] exofs: statfs blocks is sectors not FS blocks Boaz Harrosh
5 siblings, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2009-11-08 10:37 UTC (permalink / raw)
To: open-osd, linux-fsdevel
There are two places that initialize inodes: exofs_iget() and
exofs_new_inode()
As more members of exofs_i_info that need initialization are
added this code will grow. (soon)
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
fs/exofs/inode.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
index dc90f7c..243bc46 100644
--- a/fs/exofs/inode.c
+++ b/fs/exofs/inode.c
@@ -908,6 +908,12 @@ out:
return ret;
}
+
+static void __oi_init(struct exofs_i_info *oi)
+{
+ init_waitqueue_head(&oi->i_wq);
+ oi->i_flags = 0;
+}
/*
* Fill in an inode read from the OSD and set it up for use
*/
@@ -925,13 +931,13 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino)
if (!(inode->i_state & I_NEW))
return inode;
oi = exofs_i(inode);
+ __oi_init(oi);
/* read the inode from the osd */
ret = exofs_get_inode(sb, oi, &fcb, &sanity);
if (ret)
goto bad_inode;
- init_waitqueue_head(&oi->i_wq);
set_obj_created(oi);
/* copy stuff from on-disk struct to in-memory struct */
@@ -1062,8 +1068,8 @@ struct inode *exofs_new_inode(struct inode *dir, int mode)
return ERR_PTR(-ENOMEM);
oi = exofs_i(inode);
+ __oi_init(oi);
- init_waitqueue_head(&oi->i_wq);
set_obj_2bcreated(oi);
sbi = sb->s_fs_info;
--
1.6.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/6] exofs: Prints on mount and unmout
2009-11-08 10:34 [PATCH 0/X] exofs patches for after 2.6.32 Boaz Harrosh
` (3 preceding siblings ...)
2009-11-08 10:37 ` [PATCH 4/6] exofs: refactor exofs_i_info initialization into common helper Boaz Harrosh
@ 2009-11-08 10:37 ` Boaz Harrosh
2009-11-08 10:38 ` [PATCH 6/6] exofs: statfs blocks is sectors not FS blocks Boaz Harrosh
5 siblings, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2009-11-08 10:37 UTC (permalink / raw)
To: open-osd, linux-fsdevel
It is important to print in the logs when a filesystem was
mounted and eventually unmounted.
Print the osd-device's osd_name and pid the FS was
mounted/unmounted on.
TODO: How to also print the namespace path the filesystem was
mounted on?
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
fs/exofs/super.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index 9f500de..920f016 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -257,6 +257,15 @@ static void exofs_write_super(struct super_block *sb)
sb->s_dirt = 0;
}
+static void _exofs_print_device(const char *msg, const char *dev_path,
+ struct osd_dev *od, u64 pid)
+{
+ const struct osd_dev_info *odi = osduld_device_info(od);
+
+ printk(KERN_NOTICE "exofs: %s %s osd_name-%s pid-0x%llx\n",
+ msg, dev_path ?: "", odi->osdname, _LLU(pid));
+}
+
/*
* This function is called when the vfs is freeing the superblock. We just
* need to free our own part.
@@ -279,6 +288,7 @@ static void exofs_put_super(struct super_block *sb)
msecs_to_jiffies(100));
}
+ _exofs_print_device("Unmounting", NULL, sbi->s_dev, sbi->s_pid);
osduld_put_device(sbi->s_dev);
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
@@ -395,6 +405,7 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
goto free_sbi;
}
+ _exofs_print_device("Mounting", opts->dev_name, sbi->s_dev, sbi->s_pid);
ret = 0;
out:
if (or)
--
1.6.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 6/6] exofs: statfs blocks is sectors not FS blocks
2009-11-08 10:34 [PATCH 0/X] exofs patches for after 2.6.32 Boaz Harrosh
` (4 preceding siblings ...)
2009-11-08 10:37 ` [PATCH 5/6] exofs: Prints on mount and unmout Boaz Harrosh
@ 2009-11-08 10:38 ` Boaz Harrosh
5 siblings, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2009-11-08 10:38 UTC (permalink / raw)
To: open-osd, linux-fsdevel
Even though exofs has a 4k block size, statfs blocks
is in sectors (512 bytes).
Also if target returns 0 for capacity then make it
ULLONG_MAX. df does not like zero-size filesystems
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
fs/exofs/super.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index 920f016..28add3e 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -473,9 +473,11 @@ static int exofs_statfs(struct dentry *dentry, struct kstatfs *buf)
goto out;
ret = extract_attr_from_req(or, &attrs[0]);
- if (likely(!ret))
+ if (likely(!ret)) {
capacity = get_unaligned_be64(attrs[0].val_ptr);
- else
+ if (unlikely(!capacity))
+ capacity = ULLONG_MAX;
+ } else
EXOFS_DBGMSG("exofs_statfs: get capacity failed.\n");
ret = extract_attr_from_req(or, &attrs[1]);
@@ -487,8 +489,8 @@ static int exofs_statfs(struct dentry *dentry, struct kstatfs *buf)
/* fill in the stats buffer */
buf->f_type = EXOFS_SUPER_MAGIC;
buf->f_bsize = EXOFS_BLKSIZE;
- buf->f_blocks = (capacity >> EXOFS_BLKSHIFT);
- buf->f_bfree = ((capacity - used) >> EXOFS_BLKSHIFT);
+ buf->f_blocks = capacity >> 9;
+ buf->f_bfree = (capacity - used) >> 9;
buf->f_bavail = buf->f_bfree;
buf->f_files = sbi->s_numfiles;
buf->f_ffree = EXOFS_MAX_ID - sbi->s_numfiles;
--
1.6.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-11-08 10:38 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-08 10:34 [PATCH 0/X] exofs patches for after 2.6.32 Boaz Harrosh
2009-11-08 10:36 ` [PATCH 1/6] trivial: some small fixes in exofs documentation Boaz Harrosh
2009-11-08 10:36 ` [PATCH 2/6] exofs: More sane debug print Boaz Harrosh
2009-11-08 10:37 ` [PATCH 3/6] exofs: dbg-print less Boaz Harrosh
2009-11-08 10:37 ` [PATCH 4/6] exofs: refactor exofs_i_info initialization into common helper Boaz Harrosh
2009-11-08 10:37 ` [PATCH 5/6] exofs: Prints on mount and unmout Boaz Harrosh
2009-11-08 10:38 ` [PATCH 6/6] exofs: statfs blocks is sectors not FS blocks Boaz Harrosh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.