From 0b26a0bf6ff398185546432420bb772bcfdf8d94 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sat, 20 Nov 2010 14:26:44 -0500 Subject: NFS: Ensure we return the dirent->d_type when it is known Store the dirent->d_type in the struct nfs_cache_array_entry so that we can use it in getdents() calls. This fixes a regression with the new readdir code. Signed-off-by: Trond Myklebust --- fs/nfs/internal.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fs/nfs/internal.h') diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index db08ff3ff45..e6356b750b7 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -361,6 +361,15 @@ unsigned int nfs_page_length(struct page *page) return 0; } +/* + * Convert a umode to a dirent->d_type + */ +static inline +unsigned char nfs_umode_to_dtype(umode_t mode) +{ + return (mode >> 12) & 15; +} + /* * Determine the number of pages in an array of length 'len' and * with a base offset of 'base' -- cgit v1.2.3