socsvn commit: r224117 - in soc2011/gk/ino64-head/sys/gnu/fs:
reiserfs xfs xfs/FreeBSD
gk at FreeBSD.org
gk at FreeBSD.org
Mon Jul 11 07:11:25 UTC 2011
Author: gk
Date: Mon Jul 11 07:11:22 2011
New Revision: 224117
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=224117
Log:
Remove readdir cookies and set d_off in XFS and ReiserFS
Modified:
soc2011/gk/ino64-head/sys/gnu/fs/reiserfs/reiserfs_namei.c
soc2011/gk/ino64-head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
soc2011/gk/ino64-head/sys/gnu/fs/xfs/xfs_dir2.c
Modified: soc2011/gk/ino64-head/sys/gnu/fs/reiserfs/reiserfs_namei.c
==============================================================================
--- soc2011/gk/ino64-head/sys/gnu/fs/reiserfs/reiserfs_namei.c Mon Jul 11 07:11:08 2011 (r224116)
+++ soc2011/gk/ino64-head/sys/gnu/fs/reiserfs/reiserfs_namei.c Mon Jul 11 07:11:22 2011 (r224117)
@@ -13,9 +13,6 @@
const char *name, int namelen,
struct path * path_to_entry, struct reiserfs_dir_entry *de);
-MALLOC_DEFINE(M_REISERFSCOOKIES, "reiserfs_cookies",
- "ReiserFS VOP_READDIR cookies");
-
/* -------------------------------------------------------------------
* Lookup functions
* -------------------------------------------------------------------*/
@@ -128,8 +125,6 @@
struct uio *a_uio;
struct ucred *a_cred;
int *a_eofflag;
- int *a_ncookies;
- u_long **a_cookies;
} */*ap)
{
int error = 0;
@@ -146,10 +141,6 @@
INITIALIZE_PATH(path_to_entry);
int entry_num, item_num, search_res;
- /* The NFS part */
- int ncookies = 0;
- u_long *cookies = NULL;
-
/*
* Form key for search the next directory entry using f_pos field of
* file structure
@@ -166,12 +157,6 @@
reiserfs_log(LOG_DEBUG, "uio_offset = %jd, uio_resid = %d\n",
(intmax_t)uio->uio_offset, uio->uio_resid);
- if (ap->a_ncookies && ap->a_cookies) {
- cookies = (u_long *)malloc(
- uio->uio_resid / 16 * sizeof(u_long),
- M_REISERFSCOOKIES, M_WAITOK);
- }
-
while (1) {
//research:
/*
@@ -200,12 +185,6 @@
struct reiserfs_de_head *deh = B_I_DEH(bp, ih) +
entry_num;
- if (ap->a_ncookies == NULL) {
- cookies = NULL;
- } else {
- //ncookies =
- }
-
reiserfs_log(LOG_DEBUG,
"walking through directory entries\n");
for (; entry_num < I_ENTRY_COUNT(ih);
@@ -253,6 +232,7 @@
/* Copy to user land */
dstdp.d_fileno = d_ino;
+ dstdp.d_off = d_off + 1;
dstdp.d_type = DT_UNKNOWN;
dstdp.d_namlen = d_namlen;
dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp);
@@ -269,11 +249,6 @@
dstdp.d_reclen, uio);
if (error)
goto end;
- if (cookies != NULL) {
- cookies[ncookies] =
- d_off;
- ncookies++;
- }
} else
break;
} else {
@@ -343,12 +318,6 @@
pathrelse(&path_to_entry);
reiserfs_check_path(&path_to_entry);
out:
- if (error && cookies != NULL) {
- free(cookies, M_REISERFSCOOKIES);
- } else if (ap->a_ncookies != NULL && ap->a_cookies != NULL) {
- *ap->a_ncookies = ncookies;
- *ap->a_cookies = cookies;
- }
return (error);
}
Modified: soc2011/gk/ino64-head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
==============================================================================
--- soc2011/gk/ino64-head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Mon Jul 11 07:11:08 2011 (r224116)
+++ soc2011/gk/ino64-head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Mon Jul 11 07:11:22 2011 (r224117)
@@ -973,8 +973,6 @@
struct uio *a_uio;
struct ucred *a_cred;
int *a_eofflag;
- int *a_ncookies;
- u_long **a_cookies;
} */ *ap)
{
struct vnode *vp = ap->a_vp;
@@ -985,9 +983,6 @@
if (vp->v_type != VDIR)
return (EPERM);
- if (ap->a_ncookies) {
- return (EOPNOTSUPP);
- }
error = 0;
while (!eof){
Modified: soc2011/gk/ino64-head/sys/gnu/fs/xfs/xfs_dir2.c
==============================================================================
--- soc2011/gk/ino64-head/sys/gnu/fs/xfs/xfs_dir2.c Mon Jul 11 07:11:08 2011 (r224116)
+++ soc2011/gk/ino64-head/sys/gnu/fs/xfs/xfs_dir2.c Mon Jul 11 07:11:22 2011 (r224117)
@@ -721,6 +721,7 @@
uio->uio_resid -= reclen;
idbp->d_reclen = reclen;
idbp->d_fileno = pa->ino;
+ idbp->d_off = pa->cook;
idbp->d_type = DT_UNKNOWN;
idbp->d_namlen = namelen;
memcpy(idbp->d_name, pa->name, namelen);
@@ -759,6 +760,7 @@
idbp = &dtmp;
idbp->d_reclen = reclen;
idbp->d_fileno = pa->ino;
+ idbp->d_off = pa->cook;
idbp->d_type = DT_UNKNOWN;
idbp->d_namlen = namelen;
memcpy(idbp->d_name, pa->name, namelen);
More information about the svn-soc-all
mailing list