Commit 2b11e518 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] bdev: presto conversion

From: viro@parcelfarce.linux.theplanet.co.uk <viro@parcelfarce.linux.theplanet.co.uk>

presto_journal_close() switched to passing struct presto_file_data * instead
of bogus struct file *.  The only field of struct file we used to look at was
file->private_data and most of the callers allocated on-stack struct file,
assigned file.private_data and passed the sucker to presto_journal_close().
Idiocy removed.

Looks like they started with case where the data they wanted all along was,
indeed, in ->private_data of already available struct file, so they just
passed pointer to struct file.  And when they found that they need to call it
in other places where there was no such struct file, they'd done it the dumb
way instead of fixing the prototype...
parent 621d5c9e
......@@ -336,7 +336,7 @@ static void presto_apply_write_policy(struct file *file,
unlock_kernel();
return;
}
error = presto_journal_close(&rec, fset, file,
error = presto_journal_close(&rec, fset, fdata,
file->f_dentry,
&fdata->fd_version,
&new_file_ver);
......
......@@ -603,7 +603,7 @@ int presto_journal_rename(struct rec_info *rec, struct presto_file_set *fset,
int presto_journal_open(struct rec_info *, struct presto_file_set *,
struct dentry *, struct presto_version *old_ver);
int presto_journal_close(struct rec_info *rec, struct presto_file_set *,
struct file *, struct dentry *,
struct presto_file_data *, struct dentry *,
struct presto_version *old_file_ver,
struct presto_version *new_file_ver);
int presto_write_lml_close(struct rec_info *rec,
......
......@@ -2103,12 +2103,11 @@ int presto_journal_unlink(struct rec_info *rec, struct presto_file_set *fset,
int
presto_journal_close(struct rec_info *rec, struct presto_file_set *fset,
struct file *file, struct dentry *dentry,
struct presto_file_data *fd, struct dentry *dentry,
struct presto_version *old_file_ver,
struct presto_version *new_file_ver)
{
int opcode = KML_OPCODE_CLOSE;
struct presto_file_data *fd;
char *buffer, *path, *logrecord, record[316];
struct dentry *root;
int error, size, i;
......@@ -2137,7 +2136,6 @@ presto_journal_close(struct rec_info *rec, struct presto_file_set *fset,
root = fset->fset_dentry;
fd = (struct presto_file_data *)file->private_data;
if (fd) {
open_ngroups = fd->fd_ngroups;
for (i = 0; i < fd->fd_ngroups; i++)
......
......@@ -259,11 +259,8 @@ int lento_cancel_lml(char *path,
if (info->flags & LENTO_FL_WRITE_KML) {
struct file file;
file.private_data = NULL;
file.f_dentry = dentry;
presto_getversion(&new_ver, dentry->d_inode);
error = presto_journal_close(&rec, fset, &file, dentry,
error = presto_journal_close(&rec, fset, NULL, dentry,
&new_ver);
if ( error ) {
EXIT;
......
......@@ -321,7 +321,7 @@ int presto_do_close(struct presto_file_set *fset, struct file *file)
}
if (fdata->fd_info.flags & LENTO_FL_KML)
rc = presto_journal_close(&rec, fset, file, file->f_dentry,
rc = presto_journal_close(&rec, fset, fdata, file->f_dentry,
&fdata->fd_version,
&fdata->fd_info.remote_version);
if (rc) {
......@@ -431,14 +431,11 @@ int presto_do_setattr(struct presto_file_set *fset, struct dentry *dentry,
if ( presto_do_kml(info, dentry) ) {
if ((iattr->ia_valid & ATTR_SIZE) && (old_size != inode->i_size)) {
struct file file;
/* Journal a close whenever we see a potential truncate
* At the receiving end, lento should explicitly remove
* ATTR_SIZE from the list of valid attributes */
presto_getversion(&new_ver, inode);
file.private_data = NULL;
file.f_dentry = dentry;
error = presto_journal_close(&rec, fset, &file, dentry,
error = presto_journal_close(&rec, fset, NULL, dentry,
&old_ver, &new_ver);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment