patch-2.1.55 linux/fs/smbfs/dir.c
Next file: linux/fs/smbfs/proc.c
Previous file: linux/fs/romfs/inode.c
Back to the patch index
Back to the overall index
- Lines: 139
- Date:
Sun Sep 7 14:00:24 1997
- Orig file:
v2.1.54/linux/fs/smbfs/dir.c
- Orig date:
Wed Sep 3 20:52:43 1997
diff -u --recursive --new-file v2.1.54/linux/fs/smbfs/dir.c linux/fs/smbfs/dir.c
@@ -24,8 +24,7 @@
char *buf, unsigned long count);
static int
-smb_readdir(struct inode *inode, struct file *filp,
- void *dirent, filldir_t filldir);
+smb_readdir(struct file *filp, void *dirent, filldir_t filldir);
static int smb_lookup(struct inode *, struct dentry *);
static int smb_create(struct inode *, struct dentry *, int);
@@ -105,9 +104,10 @@
}
static int
-smb_refill_dir_cache(struct inode *dir, unsigned long f_pos)
+smb_refill_dir_cache(struct dentry *dentry, unsigned long f_pos)
{
int result;
+ struct inode *dir = dentry->d_inode;
static struct semaphore sem = MUTEX;
int i;
ino_t ino;
@@ -115,7 +115,7 @@
do
{
down(&sem);
- result = smb_proc_readdir(dir, f_pos,
+ result = smb_proc_readdir(dentry, f_pos,
SMB_READDIR_CACHE_SIZE, c_entry);
if (result <= 0)
@@ -142,10 +142,11 @@
return result;
}
-static int
-smb_readdir(struct inode *dir, struct file *filp,
+static int smb_readdir(struct file *filp,
void *dirent, filldir_t filldir)
{
+ struct dentry *dentry = filp->f_dentry;
+ struct inode *dir = dentry->d_inode;
int result, i = 0;
struct smb_dirent *entry = NULL;
@@ -194,7 +195,7 @@
/* End of directory */
return 0;
}
- result = smb_refill_dir_cache(dir, filp->f_pos);
+ result = smb_refill_dir_cache(dentry, filp->f_pos);
if (result <= 0)
{
return result;
@@ -266,7 +267,7 @@
if (len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
- error = smb_proc_getattr(dir, &(d_entry->d_name), &finfo);
+ error = smb_proc_getattr(d_entry, &(d_entry->d_name), &finfo);
inode = NULL;
if (!error) {
@@ -297,7 +298,7 @@
if (dentry->d_name.len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
- error = smb_proc_create(dir, &(dentry->d_name), 0, CURRENT_TIME);
+ error = smb_proc_create(dentry, &(dentry->d_name), 0, CURRENT_TIME);
if (error < 0)
return error;
@@ -307,7 +308,7 @@
* state. Currently we close it directly again, although this
* is not necessary anymore. */
- error = smb_proc_getattr(dir, &(dentry->d_name), &fattr);
+ error = smb_proc_getattr(dentry, &(dentry->d_name), &fattr);
if (error < 0)
return error;
@@ -337,13 +338,13 @@
if (dentry->d_name.len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
- error = smb_proc_mkdir(dir, &(dentry->d_name));
+ error = smb_proc_mkdir(dentry, &(dentry->d_name));
if (error)
return error;
smb_invalid_dir_cache(dir->i_ino);
- error = smb_proc_getattr(dir, &(dentry->d_name), &fattr);
+ error = smb_proc_getattr(dentry, &(dentry->d_name), &fattr);
if (error < 0)
return error;
@@ -371,7 +372,7 @@
if (dentry->d_name.len > NFS_MAXNAMLEN)
return -ENAMETOOLONG;
- error = smb_proc_rmdir(dir, &(dentry->d_name));
+ error = smb_proc_rmdir(dentry, &(dentry->d_name));
if (error)
return error;
@@ -393,7 +394,7 @@
if (dentry->d_name.len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
- error = smb_proc_unlink(dir, &(dentry->d_name));
+ error = smb_proc_unlink(dentry, &(dentry->d_name));
if (error)
return error;
@@ -424,18 +425,18 @@
new_dentry->d_name.len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
- error = smb_proc_mv(old_dir, &(old_dentry->d_name),
- new_dir, &(new_dentry->d_name));
+ error = smb_proc_mv(old_dentry, &(old_dentry->d_name),
+ new_dentry, &(new_dentry->d_name));
if (error == -EEXIST)
{
- error = smb_proc_unlink(old_dir, &(new_dentry->d_name));
+ error = smb_proc_unlink(old_dentry, &(new_dentry->d_name));
if (error)
return error;
- error = smb_proc_mv(old_dir, &(old_dentry->d_name),
- new_dir, &(new_dentry->d_name));
+ error = smb_proc_mv(old_dentry, &(old_dentry->d_name),
+ new_dentry, &(new_dentry->d_name));
}
if (error)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov