summaryrefslogtreecommitdiffstats
path: root/fs/smbfs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-13 16:29:25 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-13 16:29:25 +0000
commitdb7d4daea91e105e3859cf461d7e53b9b77454b2 (patch)
tree9bb65b95440af09e8aca63abe56970dd3360cc57 /fs/smbfs
parent9c1c01ead627bdda9211c9abd5b758d6c687d8ac (diff)
Merge with Linux 2.2.8.
Diffstat (limited to 'fs/smbfs')
-rw-r--r--fs/smbfs/cache.c5
-rw-r--r--fs/smbfs/dir.c28
-rw-r--r--fs/smbfs/file.c11
3 files changed, 11 insertions, 33 deletions
diff --git a/fs/smbfs/cache.c b/fs/smbfs/cache.c
index 292493dac..36f1650ac 100644
--- a/fs/smbfs/cache.c
+++ b/fs/smbfs/cache.c
@@ -12,7 +12,6 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/mm.h>
-#include <linux/errno.h>
#include <linux/dirent.h>
#include <linux/smb_fs.h>
@@ -142,7 +141,7 @@ smb_add_to_cache(struct cache_head * cachep, struct cache_dirent *entry,
#ifdef SMBFS_DEBUG_VERBOSE
printk("smb_add_to_cache: cache inode %p, status %d, adding %s at %ld\n",
-inode, cachep->status, entry->d_name, fpos);
+inode, cachep->status, entry->name, fpos);
#endif
/*
* Don't do anything if we've had an error ...
@@ -171,7 +170,7 @@ inode, cachep->status, entry->d_name, fpos);
cachep->entries++;
#ifdef SMBFS_DEBUG_VERBOSE
printk("smb_add_to_cache: added entry %s, len=%d, pos=%ld, entries=%d\n",
-entry->d_name, len, fpos, cachep->entries);
+entry->name, len, fpos, cachep->entries);
#endif
return;
}
diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c
index 30138872b..4f942db80 100644
--- a/fs/smbfs/dir.c
+++ b/fs/smbfs/dir.c
@@ -22,7 +22,7 @@ static ssize_t smb_dir_read(struct file *, char *, size_t, loff_t *);
static int smb_readdir(struct file *, void *, filldir_t);
static int smb_dir_open(struct inode *, struct file *);
-static int smb_lookup(struct inode *, struct dentry *);
+static struct dentry *smb_lookup(struct inode *, struct dentry *);
static int smb_create(struct inode *, struct dentry *, int);
static int smb_mkdir(struct inode *, struct dentry *, int);
static int smb_rmdir(struct inode *, struct dentry *);
@@ -191,14 +191,14 @@ file->f_dentry->d_name.name);
/*
* Dentry operations routines
*/
-static int smb_lookup_validate(struct dentry *);
+static int smb_lookup_validate(struct dentry *, int);
static int smb_hash_dentry(struct dentry *, struct qstr *);
static int smb_compare_dentry(struct dentry *, struct qstr *, struct qstr *);
static void smb_delete_dentry(struct dentry *);
static struct dentry_operations smbfs_dentry_operations =
{
- smb_lookup_validate, /* d_validate(struct dentry *) */
+ smb_lookup_validate, /* d_revalidate(struct dentry *) */
smb_hash_dentry, /* d_hash */
smb_compare_dentry, /* d_compare */
smb_delete_dentry /* d_delete(struct dentry *) */
@@ -208,7 +208,7 @@ static struct dentry_operations smbfs_dentry_operations =
* This is the callback when the dcache has a lookup hit.
*/
static int
-smb_lookup_validate(struct dentry * dentry)
+smb_lookup_validate(struct dentry * dentry, int flags)
{
struct inode * inode = dentry->d_inode;
unsigned long age = jiffies - dentry->d_time;
@@ -324,7 +324,7 @@ smb_renew_times(struct dentry * dentry)
}
}
-static int
+static struct dentry *
smb_lookup(struct inode *dir, struct dentry *dentry)
{
struct smb_fattr finfo;
@@ -360,7 +360,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, error);
}
}
out:
- return error;
+ return ERR_PTR(error);
}
/*
@@ -423,9 +423,6 @@ smb_create(struct inode *dir, struct dentry *dentry, int mode)
printk("smb_create: creating %s/%s, mode=%d\n",
dentry->d_parent->d_name.name, dentry->d_name.name, mode);
#endif
- error = -ENAMETOOLONG;
- if (dentry->d_name.len > SMB_MAXNAMELEN)
- goto out;
smb_invalid_dir_cache(dir);
error = smb_proc_create(dentry, 0, CURRENT_TIME, &fileid);
@@ -439,7 +436,6 @@ printk("smb_create: %s/%s failed, error=%d\n",
dentry->d_parent->d_name.name, dentry->d_name.name, error);
#endif
}
-out:
return error;
}
@@ -449,17 +445,12 @@ smb_mkdir(struct inode *dir, struct dentry *dentry, int mode)
{
int error;
- error = -ENAMETOOLONG;
- if (dentry->d_name.len > SMB_MAXNAMELEN)
- goto out;
-
smb_invalid_dir_cache(dir);
error = smb_proc_mkdir(dentry);
if (!error)
{
error = smb_instantiate(dentry, 0, 0);
}
-out:
return error;
}
@@ -514,11 +505,6 @@ smb_rename(struct inode *old_dir, struct dentry *old_dentry,
{
int error;
- error = -ENAMETOOLONG;
- if (old_dentry->d_name.len > SMB_MAXNAMELEN ||
- new_dentry->d_name.len > SMB_MAXNAMELEN)
- goto out;
-
/*
* Close any open files, and check whether to delete the
* target before attempting the rename.
@@ -537,6 +523,7 @@ new_dentry->d_parent->d_name.name, new_dentry->d_name.name, error);
#endif
goto out;
}
+ /* FIXME */
d_delete(new_dentry);
}
@@ -547,7 +534,6 @@ new_dentry->d_parent->d_name.name, new_dentry->d_name.name, error);
{
smb_renew_times(old_dentry);
smb_renew_times(new_dentry);
- d_move(old_dentry, new_dentry);
}
out:
return error;
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index a6cf24ce1..aff45ef9b 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -144,7 +144,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, count, offset, wsize);
result = smb_proc_write(dentry, offset, wsize, buffer);
if (result < 0)
- goto io_error;
+ break;
/* N.B. what if result < wsize?? */
#ifdef SMBFS_PARANOIA
if (result < wsize)
@@ -162,15 +162,7 @@ printk("smb_writepage_sync: short write, wsize=%d, result=%d\n", wsize, result);
inode->i_size = offset;
inode->u.smbfs_i.cache_valid |= SMB_F_LOCALWRITE;
} while (count);
-
-out:
- smb_unlock_page(page);
return written ? written : result;
-
-io_error:
- /* Must mark the page invalid after I/O error */
- clear_bit(PG_uptodate, &page->flags);
- goto out;
}
/*
@@ -190,6 +182,7 @@ smb_writepage(struct file *file, struct page *page)
set_bit(PG_locked, &page->flags);
atomic_inc(&page->count);
result = smb_writepage_sync(dentry, page, 0, PAGE_SIZE);
+ smb_unlock_page(page);
free_page(page_address(page));
return result;
}