expfs.c (5b825c3af1d8a0af4deb4a5eb349d0d0050c62e5) | expfs.c (a528d35e8bfcc521d7cb70aaf03e1bd296c8493f) |
---|---|
1/* 2 * Copyright (C) Neil Brown 2002 3 * Copyright (C) Christoph Hellwig 2007 4 * 5 * This file contains the code mapping from inodes to NFS file handles, 6 * and for mapping back from file handles to dentries. 7 * 8 * For details on why we do all the strange and hairy things in here 9 * take a look at Documentation/filesystems/nfs/Exporting. 10 */ 11#include <linux/exportfs.h> 12#include <linux/fs.h> 13#include <linux/file.h> 14#include <linux/module.h> 15#include <linux/mount.h> 16#include <linux/namei.h> 17#include <linux/sched.h> | 1/* 2 * Copyright (C) Neil Brown 2002 3 * Copyright (C) Christoph Hellwig 2007 4 * 5 * This file contains the code mapping from inodes to NFS file handles, 6 * and for mapping back from file handles to dentries. 7 * 8 * For details on why we do all the strange and hairy things in here 9 * take a look at Documentation/filesystems/nfs/Exporting. 10 */ 11#include <linux/exportfs.h> 12#include <linux/fs.h> 13#include <linux/file.h> 14#include <linux/module.h> 15#include <linux/mount.h> 16#include <linux/namei.h> 17#include <linux/sched.h> |
18#include <linux/cred.h> | |
19 20#define dprintk(fmt, args...) do{}while(0) 21 22 23static int get_name(const struct path *path, char *name, struct dentry *child); 24 25 26static int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir, --- 268 unchanged lines hidden (view full) --- 295 if (!dir->i_fop) 296 goto out; 297 /* 298 * inode->i_ino is unsigned long, kstat->ino is u64, so the 299 * former would be insufficient on 32-bit hosts when the 300 * filesystem supports 64-bit inode numbers. So we need to 301 * actually call ->getattr, not just read i_ino: 302 */ | 18 19#define dprintk(fmt, args...) do{}while(0) 20 21 22static int get_name(const struct path *path, char *name, struct dentry *child); 23 24 25static int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir, --- 268 unchanged lines hidden (view full) --- 294 if (!dir->i_fop) 295 goto out; 296 /* 297 * inode->i_ino is unsigned long, kstat->ino is u64, so the 298 * former would be insufficient on 32-bit hosts when the 299 * filesystem supports 64-bit inode numbers. So we need to 300 * actually call ->getattr, not just read i_ino: 301 */ |
303 error = vfs_getattr_nosec(&child_path, &stat); | 302 error = vfs_getattr_nosec(&child_path, &stat, 303 STATX_INO, AT_STATX_SYNC_AS_STAT); |
304 if (error) 305 return error; 306 buffer.ino = stat.ino; 307 /* 308 * Open the directory ... 309 */ 310 file = dentry_open(path, O_RDONLY, cred); 311 error = PTR_ERR(file); --- 240 unchanged lines hidden --- | 304 if (error) 305 return error; 306 buffer.ino = stat.ino; 307 /* 308 * Open the directory ... 309 */ 310 file = dentry_open(path, O_RDONLY, cred); 311 error = PTR_ERR(file); --- 240 unchanged lines hidden --- |