Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement for creating pretty extent at flush #211

Open
wants to merge 6 commits into
base: pretty-extent
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions messages/iosched_unified/root.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,16 @@ root:table {
13024I:string { "Clean up extents and append index at index partition (%d)." }
13025I:string { "Get error position (%d, %d)." }
13026E:string { "Write perm handling error : %s (%d)." }
13027D:string { "Created DPR : %s." }
13028D:string { "Removed DPR : %s." }
13029D:string { "DPR (%s): %s (%u)." }
13030D:string { "No DPR on %s (req = 0x%llx)." }
13031D:string { "Created a request (0x%llx)." }
13032D:string { "Removed a request (0x%llx)." }
13033D:string { "Flushing all (%s, %s)." }
13034D:string { "Send a broadcast from %s." }
13035D:string { "Waiting a broadcast signal." }
13036D:string { "Received a broadcast signal." }
13037D:string { "Flush all operation is finished." }
}
}
11 changes: 10 additions & 1 deletion src/iosched/fcfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,18 @@ int fcfs_destroy(void *iosched_handle)
*/
int fcfs_open(const char *path, bool open_write, struct dentry **dentry, void *iosched_handle)
{
int ret;
struct fcfs_data *priv = (struct fcfs_data *) iosched_handle;

CHECK_ARG_NULL(path, -LTFS_NULL_ARG);
CHECK_ARG_NULL(dentry, -LTFS_NULL_ARG);
CHECK_ARG_NULL(iosched_handle, -LTFS_NULL_ARG);

return ltfs_fsraw_open(path, open_write, dentry, priv->vol);
ret = ltfs_fsraw_open(path, open_write, dentry, priv->vol);
if (!ret)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least in the I/O schedulers we're used to write if (ret == 0) to check if a function call succeeded. I think it's good idea to use the same coding pattern, as ! ret is used to check if an operation failed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, if (!ret) is used in libltfs. So I think it is good to use. I'll use if (ret == 0).

I think Brian prefers to use if (!ret), good call, and if (ret < 0), bad call`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't remember we used that pattern in libltfs. No worries then -- this is a minor issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in my branch.

ltfs_fsraw_get_dentry(*dentry, priv->vol);

return ret;
}

/**
Expand All @@ -128,9 +133,13 @@ int fcfs_open(const char *path, bool open_write, struct dentry **dentry, void *i
*/
int fcfs_close(struct dentry *d, bool flush, void *iosched_handle)
{
struct fcfs_data *priv = (struct fcfs_data *) iosched_handle;

CHECK_ARG_NULL(d, -LTFS_NULL_ARG);
CHECK_ARG_NULL(iosched_handle, -LTFS_NULL_ARG);

ltfs_fsraw_put_dentry(d, priv->vol);

return ltfs_fsraw_close(d);
}

Expand Down
Loading