From 2de874d738333b63db870c0990e3b59d1ebd48bd Mon Sep 17 00:00:00 2001 From: green Date: Fri, 29 Oct 2004 22:46:39 +0000 Subject: [PATCH] b=5094 r=adilger Get rid of EXT3* limiting definitions usage in llite --- lustre/llite/llite_internal.h | 1 + lustre/llite/llite_lib.c | 1 + lustre/llite/namei.c | 22 +++++----------------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index b86e05b..6d2fb9c 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -60,6 +60,7 @@ struct ll_sb_info { struct list_head ll_pglist; struct ll_ra_info ll_ra_info; + unsigned int ll_namelen; }; struct ll_readahead_state { diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index b785c87..33d93c2 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -127,6 +127,7 @@ int lustre_common_fill_super(struct super_block *sb, char *mdc, char *osc) sb->s_blocksize_bits = log2(osfs.os_bsize); sb->s_magic = LL_SUPER_MAGIC; sb->s_maxbytes = PAGE_CACHE_MAXBYTES; + sbi->ll_namelen = osfs.os_namelen; devno = get_uuid2int(sbi2mdc(sbi)->cl_import->imp_target_uuid.uuid, strlen(sbi2mdc(sbi)->cl_import->imp_target_uuid.uuid)); diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 66083de..549bd06 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -365,7 +365,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, int rc; ENTRY; - if (dentry->d_name.len > EXT3_NAME_LEN) + if (dentry->d_name.len > ll_i2sbi(parent)->ll_namelen) RETURN(ERR_PTR(-ENAMETOOLONG)); CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),intent=%s\n", @@ -527,15 +527,12 @@ static int ll_mknod_raw(struct nameidata *nd, int mode, dev_t rdev) struct inode *dir = nd->dentry->d_inode; struct ll_sb_info *sbi = ll_i2sbi(dir); struct mdc_op_data op_data; - int err = -EMLINK; + int err; ENTRY; CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n", nd->last.len, nd->last.name, dir->i_ino, dir->i_generation, dir); - if (dir->i_nlink >= EXT3_LINK_MAX) - RETURN(err); - mode &= ~current->fs->umask; switch (mode & S_IFMT) { @@ -571,16 +568,13 @@ static int ll_mknod(struct inode *dir, struct dentry *dchild, int mode, struct inode *inode = NULL; struct ll_sb_info *sbi = ll_i2sbi(dir); struct mdc_op_data op_data; - int err = -EMLINK; + int err; ENTRY; CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n", dchild->d_name.len, dchild->d_name.name, dir->i_ino, dir->i_generation, dir); - if (dir->i_nlink >= EXT3_LINK_MAX) - RETURN(err); - mode &= ~current->fs->umask; switch (mode & S_IFMT) { @@ -625,16 +619,13 @@ static int ll_symlink_raw(struct nameidata *nd, const char *tgt) struct ptlrpc_request *request = NULL; struct ll_sb_info *sbi = ll_i2sbi(dir); struct mdc_op_data op_data; - int err = -EMLINK; + int err; ENTRY; CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),target=%s\n", nd->last.len, nd->last.name, dir->i_ino, dir->i_generation, dir, tgt); - if (dir->i_nlink >= EXT3_LINK_MAX) - RETURN(err); - ll_prepare_mdc_op_data(&op_data, dir, NULL, nd->last.name, nd->last.len, 0); err = mdc_create(sbi->ll_mdc_exp, &op_data, @@ -680,14 +671,11 @@ static int ll_mkdir_raw(struct nameidata *nd, int mode) struct ptlrpc_request *request = NULL; struct ll_sb_info *sbi = ll_i2sbi(dir); struct mdc_op_data op_data; - int err = -EMLINK; + int err; ENTRY; CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n", nd->last.len, nd->last.name, dir->i_ino, dir->i_generation, dir); - if (dir->i_nlink >= EXT3_LINK_MAX) - RETURN(err); - mode = (mode & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR; ll_prepare_mdc_op_data(&op_data, dir, NULL, nd->last.name, nd->last.len, 0); -- 1.8.3.1