Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b506cfb authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd

* 'for-linus' of git://git.open-osd.org/linux-open-osd:
  exofs: deprecate the commands pending counter
  exofs: Write sbi->s_nextid as part of the Create command
  exofs: Add option to mount by osdname
  exofs: Override read-ahead to align on stripe_size
  exofs: simple fsync race fix
  exofs: Optimize read_4_write
  exofs: Trivial: fix some indentation and debug prints
  exofs: Remove redundant unlikely()
parents 4cc4d24e a49fb4c3
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -104,7 +104,15 @@ 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.
                                This option is mandatory. integer can be
                                Hex by pre-pending an 0x to the number.
		osdname=<id>  - Mount by a device's osdname.
                                osdname is usually a 36 character uuid of the
                                form "d2683732-c906-4ee1-9dbd-c10c27bb40df".
                                It is one of the device's uuid specified in the
                                mkfs.exofs format command.
                                If this option is specified then the /dev/osdX
                                above can be empty and is ignored.
                to=<integer>  - Timeout in ticks for a single command.
                                default is (60 * HZ) [for debugging only]

+16 −2
Original line number Diff line number Diff line
@@ -53,10 +53,14 @@
#define EXOFS_ROOT_ID	0x10002	/* object ID for root directory */

/* exofs Application specific page/attribute */
/* Inode attrs */
# define EXOFS_APAGE_FS_DATA	(OSD_APAGE_APP_DEFINED_FIRST + 3)
# define EXOFS_ATTR_INODE_DATA	1
# define EXOFS_ATTR_INODE_FILE_LAYOUT	2
# define EXOFS_ATTR_INODE_DIR_LAYOUT	3
/* Partition attrs */
# define EXOFS_APAGE_SB_DATA	(0xF0000000U + 3)
# define EXOFS_ATTR_SB_STATS	1

/*
 * The maximum number of files we can have is limited by the size of the
@@ -86,8 +90,8 @@ enum {
 */
enum {EXOFS_FSCB_VER = 1, EXOFS_DT_VER = 1};
struct exofs_fscb {
	__le64  s_nextid;	/* Highest object ID used */
	__le64  s_numfiles;	/* Number of files on fs */
	__le64  s_nextid;	/* Only used after mkfs */
	__le64  s_numfiles;	/* Only used after mkfs */
	__le32	s_version;	/* == EXOFS_FSCB_VER */
	__le16  s_magic;	/* Magic signature */
	__le16  s_newfs;	/* Non-zero if this is a new fs */
@@ -97,6 +101,16 @@ struct exofs_fscb {
	__le64	s_dev_table_count; /* == 0 means no dev_table */
} __packed;

/*
 * This struct is set on the FS partition's attributes.
 * [EXOFS_APAGE_SB_DATA, EXOFS_ATTR_SB_STATS] and is written together
 * with the create command, to atomically persist the sb writeable information.
 */
struct exofs_sb_stats {
	__le64  s_nextid;	/* Highest object ID used */
	__le64  s_numfiles;	/* Number of files on fs */
} __packed;

/*
 * Describes the raid used in the FS. It is part of the device table.
 * This here is taken from the pNFS-objects definition. In exofs we
+18 −15
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ out:

Ebadsize:
	EXOFS_ERR("ERROR [exofs_check_page]: "
		"size of directory #%lu is not a multiple of chunk size",
		"size of directory(0x%lx) is not a multiple of chunk size\n",
		dir->i_ino
	);
	goto fail;
@@ -142,8 +142,8 @@ Espan:
	goto bad_entry;
bad_entry:
	EXOFS_ERR(
		"ERROR [exofs_check_page]: bad entry in directory #%lu: %s - "
		"offset=%lu, inode=%llu, rec_len=%d, name_len=%d",
		"ERROR [exofs_check_page]: bad entry in directory(0x%lx): %s - "
		"offset=%lu, inode=0x%llu, rec_len=%d, name_len=%d\n",
		dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs,
		_LLU(le64_to_cpu(p->inode_no)),
		rec_len, p->name_len);
@@ -151,8 +151,8 @@ bad_entry:
Eend:
	p = (struct exofs_dir_entry *)(kaddr + offs);
	EXOFS_ERR("ERROR [exofs_check_page]: "
		"entry in directory #%lu spans the page boundary"
		"offset=%lu, inode=%llu",
		"entry in directory(0x%lx) spans the page boundary"
		"offset=%lu, inode=0x%llx\n",
		dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
		_LLU(le64_to_cpu(p->inode_no)));
fail:
@@ -261,8 +261,7 @@ exofs_readdir(struct file *filp, void *dirent, filldir_t filldir)
		struct page *page = exofs_get_page(inode, n);

		if (IS_ERR(page)) {
			EXOFS_ERR("ERROR: "
				   "bad page in #%lu",
			EXOFS_ERR("ERROR: bad page in directory(0x%lx)\n",
				  inode->i_ino);
			filp->f_pos += PAGE_CACHE_SIZE - offset;
			return PTR_ERR(page);
@@ -283,7 +282,8 @@ exofs_readdir(struct file *filp, void *dirent, filldir_t filldir)
		for (; (char *)de <= limit; de = exofs_next_entry(de)) {
			if (de->rec_len == 0) {
				EXOFS_ERR("ERROR: "
					"zero-length directory entry");
				     "zero-length entry in directory(0x%lx)\n",
				     inode->i_ino);
				exofs_put_page(page);
				return -EIO;
			}
@@ -342,9 +342,9 @@ struct exofs_dir_entry *exofs_find_entry(struct inode *dir,
			kaddr += exofs_last_byte(dir, n) - reclen;
			while ((char *) de <= kaddr) {
				if (de->rec_len == 0) {
					EXOFS_ERR(
						"ERROR: exofs_find_entry: "
						"zero-length directory entry");
					EXOFS_ERR("ERROR: zero-length entry in "
						  "directory(0x%lx)\n",
						  dir->i_ino);
					exofs_put_page(page);
					goto out;
				}
@@ -472,7 +472,8 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode)
			}
			if (de->rec_len == 0) {
				EXOFS_ERR("ERROR: exofs_add_link: "
					"zero-length directory entry");
				      "zero-length entry in directory(0x%lx)\n",
				      inode->i_ino);
				err = -EIO;
				goto out_unlock;
			}
@@ -491,7 +492,8 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode)
		exofs_put_page(page);
	}

	EXOFS_ERR("exofs_add_link: BAD dentry=%p or inode=%p", dentry, inode);
	EXOFS_ERR("exofs_add_link: BAD dentry=%p or inode=0x%lx\n",
		  dentry, inode->i_ino);
	return -EINVAL;

got_it:
@@ -542,7 +544,8 @@ int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page)
	while (de < dir) {
		if (de->rec_len == 0) {
			EXOFS_ERR("ERROR: exofs_delete_entry:"
				"zero-length directory entry");
				  "zero-length entry in directory(0x%lx)\n",
				  inode->i_ino);
			err = -EIO;
			goto out;
		}
+4 −2
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ struct exofs_layout {
 * our extension to the in-memory superblock
 */
struct exofs_sb_info {
	struct exofs_fscb s_fscb;		/* Written often, pre-allocate*/
	struct exofs_sb_stats s_ess;		/* Written often, pre-allocate*/
	int		s_timeout;		/* timeout for OSD operations */
	uint64_t	s_nextid;		/* highest object ID used     */
	uint32_t	s_numfiles;		/* number of files on fs      */
@@ -256,6 +256,8 @@ static inline int exofs_oi_read(struct exofs_i_info *oi,
}

/* inode.c               */
unsigned exofs_max_io_pages(struct exofs_layout *layout,
			    unsigned expected_pages);
int exofs_setattr(struct dentry *, struct iattr *);
int exofs_write_begin(struct file *file, struct address_space *mapping,
		loff_t pos, unsigned len, unsigned flags,
@@ -279,7 +281,7 @@ int exofs_set_link(struct inode *, struct exofs_dir_entry *, struct page *,
		    struct inode *);

/* super.c               */
int exofs_sync_fs(struct super_block *sb, int wait);
int exofs_sbi_write_stats(struct exofs_sb_info *sbi);

/*********************
 * operation vectors *
+1 −15
Original line number Diff line number Diff line
@@ -45,22 +45,8 @@ static int exofs_release_file(struct inode *inode, struct file *filp)
static int exofs_file_fsync(struct file *filp, int datasync)
{
	int ret;
	struct inode *inode = filp->f_mapping->host;
	struct super_block *sb;

	if (!(inode->i_state & I_DIRTY))
		return 0;
	if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
		return 0;

	ret = sync_inode_metadata(inode, 1);

	/* This is a good place to write the sb */
	/* TODO: Sechedule an sb-sync on create */
	sb = inode->i_sb;
	if (sb->s_dirt)
		exofs_sync_fs(sb, 1);

	ret = sync_inode_metadata(filp->f_mapping->host, 1);
	return ret;
}

Loading