*
*/
-#include <linux/config.h>
#include <linux/time.h>
#include <linux/errno.h>
#define ncp_symlink NULL
#endif
-struct file_operations ncp_dir_operations =
+const struct file_operations ncp_dir_operations =
{
.read = generic_read_dir,
.readdir = ncp_readdir,
{
int res=0x9c,res2;
struct nw_modify_dos_info info;
- __u32 old_nwattr;
+ __le32 old_nwattr;
struct inode *inode;
memset(&info, 0, sizeof(info));
struct nw_modify_dos_info info;
int res=0x90,res2;
struct inode *old_inode = old_dentry->d_inode;
- __u32 old_nwattr = NCP_FINFO(old_inode)->nwattr;
- __u32 new_nwattr = 0; /* shut compiler warning */
+ __le32 old_nwattr = NCP_FINFO(old_inode)->nwattr;
+ __le32 new_nwattr = 0; /* shut compiler warning */
int old_nwattr_changed = 0;
int new_nwattr_changed = 0;
spin_lock(&dcache_lock);
next = parent->d_subdirs.next;
while (next != &parent->d_subdirs) {
- dent = list_entry(next, struct dentry, d_child);
+ dent = list_entry(next, struct dentry, d_u.d_child);
if ((unsigned long)dent->d_fsdata == fpos) {
if (dent->d_inode)
dget_locked(dent);
if (ncp_obtain_info(server, inode, NULL, &i))
return 0;
- return ncp_date_dos2unix(le16_to_cpu(i.modifyTime),
- le16_to_cpu(i.modifyDate));
+ return ncp_date_dos2unix(i.modifyTime, i.modifyDate);
}
static int ncp_readdir(struct file *filp, void *dirent, filldir_t filldir)
DPRINTK("ncp_do_readdir: init failed, err=%d\n", err);
return;
}
-#ifdef USE_OLD_SLOW_DIRECTORY_LISTING
- for (;;) {
- err = ncp_search_for_file_or_subdir(server, &seq, &entry.i);
- if (err) {
- DPRINTK("ncp_do_readdir: search failed, err=%d\n", err);
- break;
- }
- entry.volume = entry.i.volNumber;
- if (!ncp_fill_cache(filp, dirent, filldir, ctl, &entry))
- break;
- }
-#else
/* We MUST NOT use server->buffer_size handshaked with server if we are
using UDP, as for UDP server uses max. buffer size determined by
MTU, and for TCP server uses hardwired value 65KB (== 66560 bytes).
}
} while (more);
vfree(buf);
-#endif
return;
}
if (ncp_single_volume(server)) {
int len;
struct dentry* dent;
- __u32 volNumber, dirEntNum, DosDirNum;
+ __u32 volNumber;
+ __le32 dirEntNum;
+ __le32 DosDirNum;
__u8 __name[NCP_MAXPATHLEN + 1];
len = sizeof(__name);
}
int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode,
- dev_t rdev, int attributes)
+ dev_t rdev, __le32 attributes)
{
struct ncp_server *server = NCP_SERVER(dir);
struct ncp_entry_info finfo;
error = -EACCES;
if (ncp_open_create_file_or_subdir(server, dir, __name,
- OC_MODE_CREATE, aDIR, 0xffff,
+ OC_MODE_CREATE, aDIR,
+ cpu_to_le16(0xffff),
&finfo) == 0)
{
if (ncp_is_nfs_extras(server, finfo.volume)) {
/* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */
int
-ncp_date_dos2unix(unsigned short time, unsigned short date)
+ncp_date_dos2unix(__le16 t, __le16 d)
{
+ unsigned short time = le16_to_cpu(t), date = le16_to_cpu(d);
int month, year, secs;
/* first subtract and mask after that... Otherwise, if
/* Convert linear UNIX date to a MS-DOS time/date pair. */
void
-ncp_date_unix2dos(int unix_date, unsigned short *time, unsigned short *date)
+ncp_date_unix2dos(int unix_date, __le16 *time, __le16 *date)
{
int day, year, nl_day, month;
unix_date = utc2local(unix_date);
- *time = (unix_date % 60) / 2 + (((unix_date / 60) % 60) << 5) +
- (((unix_date / 3600) % 24) << 11);
+ *time = cpu_to_le16(
+ (unix_date % 60) / 2 + (((unix_date / 60) % 60) << 5) +
+ (((unix_date / 3600) % 24) << 11));
day = unix_date / 86400 - 3652;
year = day / 365;
if ((year + 3) / 4 + 365 * year > day)
if (day_n[month] > nl_day)
break;
}
- *date = nl_day - day_n[month - 1] + 1 + (month << 5) + (year << 9);
+ *date = cpu_to_le16(nl_day - day_n[month - 1] + 1 + (month << 5) + (year << 9));
}